The DWC3 runtime suspend routine checks for the USB connected parameter to
determine if the controller can enter into a low power state. The
connected state is only set to false after receiving a disconnect event.
However, in the case of a device initiated disconnect (i.e. UDC unbind),
the controller is halted and a disconnect event is never generated. Set
the connected flag to false if issuing a device initiated disconnect to
allow the controller to be suspended.
Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Link: https://lore.kernel.org/r/1609283136-22140-2-git-send-email-wcheng@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 177879761
(cherry picked from commit 77adb8bdf4227257e26b7ff67272678e66a0b250)
Change-Id: Ida95a1274f186cf81d40489ae0bdf2c702779a7c
Signed-off-by: Ray Chi <raychi@google.com>
This patch effectively reverts 2df99b6397 ("ANDROID: KVM: arm64: disable
CFI for hypervisor code") now that the arm64 KVM hypervisor code builds
correctly with LTO enabled, which is also the case upstream. CFI remains
disabled, but only for the nVHE hyp object at EL2.
Cc: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 145210207
Change-Id: I5084f880576dd6a23b8e15eec840f666f36bd2b1
It recently became apparent that the ARMv8 architecture has interesting
rules regarding attributes being used when fetching instructions
if the MMU is off at Stage-1.
In this situation, the CPU is allowed to fetch from the PoC and
allocate into the I-cache (unless the memory is mapped with
the XN attribute at Stage-2).
If we transpose this to vcpus sharing a single physical CPU,
it is possible for a vcpu running with its MMU off to influence
another vcpu running with its MMU on, as the latter is expected to
fetch from the PoU (and self-patching code doesn't flush below that
level).
In order to solve this, reuse the vcpu-private TLB invalidation
code to apply the same policy to the I-cache, nuking it every time
the vcpu runs on a physical CPU that ran another vcpu of the same
VM in the past.
This involve renaming __kvm_tlb_flush_local_vmid() to
__kvm_flush_cpu_context(), and inserting a local i-cache invalidation
there.
Cc: stable@vger.kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210303164505.68492-1-maz@kernel.org
(cherry picked from commit 01dc9262ff5797b675c32c0c6bc682777d23de05
git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git fixes)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 178098380
Test: atest VirtualizationHostTestCases on an EL2-enabled device
Change-Id: I05b5c2065f522225c744264caa781951d8b7888c
allmodconfig + CONFIG_LTO_CLANG_THIN=y fails to build due to following
linker errors:
ld.lld: error: irqbypass.c:(function __guest_enter: .text+0x21CC):
relocation R_AARCH64_CONDBR19 out of range: 2031220 is not in
[-1048576, 1048575]; references hyp_panic
>>> defined in vmlinux.o
ld.lld: error: irqbypass.c:(function __guest_enter: .text+0x21E0):
relocation R_AARCH64_ADR_PREL_LO21 out of range: 2031200 is not in
[-1048576, 1048575]; references hyp_panic
>>> defined in vmlinux.o
This is because with LTO, the compiler ends up placing hyp_panic()
more than 1MB away from __guest_enter(). Use an unconditional branch
and adr_l instead to fix the issue.
Link: https://github.com/ClangBuiltLinux/linux/issues/1317
Reported-by: Nathan Chancellor <nathan@kernel.org>
Suggested-by: Marc Zyngier <maz@kernel.org>
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Will Deacon <will@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210305202124.3768527-1-samitolvanen@google.com
(cherry picked from commit dbaee836d60a8e1b03e7d53a37893235662ba124
git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git fixes)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 178098380
Test: atest VirtualizationHostTestCases on an EL2-enabled device
Change-Id: I1c567b1aa44fc96ac044d572248bf1b4b4e13a68
When walking the page tables at a given level, and if the start
address for the range isn't aligned for that level, we propagate
the misalignment on each iteration at that level.
This results in the walker ignoring a number of entries (depending
on the original misalignment) on each subsequent iteration.
Properly aligning the address before the next iteration addresses
this issue.
Cc: stable@vger.kernel.org
Reported-by: Howard Zhang <Howard.Zhang@arm.com>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Jia He <justin.he@arm.com>
Fixes: b1e57de62c ("KVM: arm64: Add stand-alone page-table walker infrastructure")
[maz: rewrite commit message]
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210303024225.2591-1-justin.he@arm.com
(cherry picked from commit e85583b3f1fe62c9b371a3100c1c91af94005ca9
git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git fixes)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 178098380
Test: atest VirtualizationHostTestCases on an EL2-enabled device
Change-Id: Ic5d8a5966201610ead899eacf1d75b94df572be8
Add and export get_each_dmabuf function which helps in
traversing the db_list, this will be used by the minidump
module to get dmabuf info.
Bug: 181203151
Change-Id: Ie24788fcf9cf0a49316cb871dcb9191e8084ccde
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
There is a possible chance that some cooling device stats buffer
allocation fails due to very high cooling device max state value.
Later cooling device update sysfs can try to access stats data
for the same cooling device. It will lead to NULL pointer
dereference issue.
Add a NULL pointer check before accessing thermal cooling device
stats data. It fixes the following bug
[ 26.812833] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000004
[ 27.122960] Call trace:
[ 27.122963] do_raw_spin_lock+0x18/0xe8
[ 27.122966] _raw_spin_lock+0x24/0x30
[ 27.128157] thermal_cooling_device_stats_update+0x24/0x98
[ 27.128162] cur_state_store+0x88/0xb8
[ 27.128166] dev_attr_store+0x40/0x58
[ 27.128169] sysfs_kf_write+0x50/0x68
[ 27.133358] kernfs_fop_write+0x12c/0x1c8
[ 27.133362] __vfs_write+0x54/0x160
[ 27.152297] vfs_write+0xcc/0x188
[ 27.157132] ksys_write+0x78/0x108
[ 27.162050] ksys_write+0xf8/0x108
[ 27.166968] __arm_smccc_hvc+0x158/0x4b0
[ 27.166973] __arm_smccc_hvc+0x9c/0x4b0
[ 27.186005] el0_svc+0x8/0xc
Link: https://lore.kernel.org/linux-pm/7486c27b-c6fb-4686-811c-85945ec5a273@linaro.org/T/#m0ea0afc9eb655a66d5352520a650b4525141a041
Bug: 182193227
Change-Id: I67831afb887d4c97f9cdf3274024f5d38ea2c22d
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
The product config for GKI should be as optimized as possible, and
"full" LTO can result in additional optimizations that are not possible
with "thin" LTO.
Bug: 167259389
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: I3a3f2e0069a77f501d0b4cffc35d9c813735d210
This helps in reducing the static memory usage of stack
depot when CONFIG_PAGE_OWNER is set.
Bug: 171354330
Change-Id: I7dceceacef5610bde53877f57bbbd72366ff61b4
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
move hook to collect scheduling information and apply vendor's
tuning before task's scheduling priority is changed
Bug: 163431711
Signed-off-by: Frankie Chang <frankie.chang@mediatek.com>
Change-Id: I61a7ab663316c0fbcb28d1b6e523649a6374b492
(cherry picked from commit 5cf5bc7523bd5608590de487de896c1026161a18)
Add __cfi_slowpath to android/abi_gki_aarch64_qcom since CFI was enabled
in gki_defconfig.
Bug: 182137499
Change-Id: Ic67fb6fcdf652fbcc94a19ef3334dc0df01d19ec
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
While interpreting CC_STATUS, ROLE_CONTROL has to be read to make
sure that CC1/CC2 is not forced presenting Rp/Rd.
>From the TCPCI spec:
4.4.5.2 ROLE_CONTROL (Normative):
The TCPM shall write B6 (DRP) = 0b and B3..0 (CC1/CC2) if it wishes
to control the Rp/Rd directly instead of having the TCPC perform
DRP toggling autonomously. When controlling Rp/Rd directly, the
TCPM writes to B3..0 (CC1/CC2) each time it wishes to change the
CC1/CC2 values. This control is used for TCPM-TCPC implementing
Source or Sink only as well as when a connection has been detected
via DRP toggling but the TCPM wishes to attempt Try.Src or Try.Snk.
Table 4-22. CC_STATUS Register Definition:
If (ROLE_CONTROL.CC1 = Rd) or ConnectResult=1)
00b: SNK.Open (Below maximum vRa)
01b: SNK.Default (Above minimum vRd-Connect)
10b: SNK.Power1.5 (Above minimum vRd-Connect) Detects Rp-1.5A
11b: SNK.Power3.0 (Above minimum vRd-Connect) Detects Rp-3.0A
If (ROLE_CONTROL.CC2=Rd) or (ConnectResult=1)
00b: SNK.Open (Below maximum vRa)
01b: SNK.Default (Above minimum vRd-Connect)
10b: SNK.Power1.5 (Above minimum vRd-Connect) Detects Rp 1.5A
11b: SNK.Power3.0 (Above minimum vRd-Connect) Detects Rp 3.0A
Fixes: 74e656d6b0 ("staging: typec: Type-C Port Controller Interface driver (tcpci)")
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20210304070931.1947316-1-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 175d5cd62631dedbaee68ec88f1103cbac679518
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id4da23c64cfda464ddcbf6aa8d0fd678cc1a3914
Add the calc_index vendor hook symbol which is needed for
vendor modules.
Bug: 182018614
Signed-off-by: Huang Yiwei <hyiwei@codeaurora.org>
Change-Id: Id15183b0423dd2ee4baf72234f425904e29494f9
Add a vendor hook after attaching a task to a cgroup to
recognize the group_id for performance tuning
Bug: 181917687
Signed-off-by: Frankie Chang <frankie.chang@mediatek.com>
Change-Id: I603afa3d893dd575a7dcb97f83bd9eacb8315bab
(cherry picked from commit de089a37a3d248608a1d5855a4ae82ebad3ec2ab)
In USB2 Spec:
"11.18.5 TT Response Generation
In general, there will be two (or more) complete-split
transactions scheduled for a periodic endpoint.
However, for interrupt endpoints, the maximum size of
the full-/low-speed transaction guarantees that it can
never require more than two complete-split transactions.
Two complete-split transactions are only required
when the transaction spans a microframe boundary."
Due to the maxp is 64, and less then 188 (at most in one
microframe), seems never span boundary, so use only one CS
for FS/LS interrupt transfer, this will save some bandwidth.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/5b9ff09f53d23cf9e5c5437db4ffc18b798bf60c.1615170625.git.chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit fe2ee2b69416f3696b0b0f1eafe6b869cc0448bf
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5670c8ac20acb974204deba8db82658de9876a61
Export cpu_frequency_limits trace point so that vendor modules
can register callbacks.
Bug: 182088677
Change-Id: I169c4c906ee3c760839c0757b5699f9e7b9e7646
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
The external modules "headers_install" target does not copy the
out-of-tree kernel headers from external modules obj folders to
INSTALL_HDR_PATH.
Add $(hdr-prefix) as the rsync command source folder prefix to copy
out-of-tree kernel headers.
Bug: 173331163
Signed-off-by: Tai Kuo <taikuo@google.com>
Change-Id: Ie54c64d026acda65894e048a785c0b66cc9a7ddf
Disable both LTO_CLANG_THIN and LTO_CLANG_FULL for KASAN and Kprobes
builds.
Bug: 167259389
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Change-Id: I0c55b1cf9c8f7d23094230553c266cb5df7801e8
LTO is in thin mode, and CFI is in enforcing (non-permissive) mode.
This change aligns ARM64 to the current x86_64 settings.
Bug: 167259389
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: I61323735aa1dd5444212caeb7b8a8b0c7b8d0d95
Changes in 5.10.21
net: usb: qmi_wwan: support ZTE P685M modem
Input: elantech - fix protocol errors for some trackpoints in SMBus mode
Input: elan_i2c - add new trackpoint report type 0x5F
drm/virtio: use kvmalloc for large allocations
x86/build: Treat R_386_PLT32 relocation as R_386_PC32
JFS: more checks for invalid superblock
sched/core: Allow try_invoke_on_locked_down_task() with irqs disabled
udlfb: Fix memory leak in dlfb_usb_probe
media: mceusb: sanity check for prescaler value
erofs: fix shift-out-of-bounds of blkszbits
media: v4l2-ctrls.c: fix shift-out-of-bounds in std_validate
xfs: Fix assert failure in xfs_setattr_size()
net/af_iucv: remove WARN_ONCE on malformed RX packets
smackfs: restrict bytes count in smackfs write functions
tomoyo: ignore data race while checking quota
net: fix up truesize of cloned skb in skb_prepare_for_shift()
riscv: Get rid of MAX_EARLY_MAPPING_SIZE
nbd: handle device refs for DESTROY_ON_DISCONNECT properly
mm/hugetlb.c: fix unnecessary address expansion of pmd sharing
RDMA/rtrs: Do not signal for heatbeat
RDMA/rtrs-clt: Use bitmask to check sess->flags
RDMA/rtrs-srv: Do not signal REG_MR
tcp: fix tcp_rmem documentation
mptcp: do not wakeup listener for MPJ subflows
net: bridge: use switchdev for port flags set through sysfs too
net/sched: cls_flower: Reject invalid ct_state flags rules
net: dsa: tag_rtl4_a: Support also egress tags
net: ag71xx: remove unnecessary MTU reservation
net: hsr: add support for EntryForgetTime
net: psample: Fix netlink skb length with tunnel info
net: fix dev_ifsioc_locked() race condition
dt-bindings: ethernet-controller: fix fixed-link specification
dt-bindings: net: btusb: DT fix s/interrupt-name/interrupt-names/
ASoC: qcom: Remove useless debug print
rsi: Fix TX EAPOL packet handling against iwlwifi AP
rsi: Move card interrupt handling to RX thread
EDAC/amd64: Do not load on family 0x15, model 0x13
staging: fwserial: Fix error handling in fwserial_create
x86/reboot: Add Zotac ZBOX CI327 nano PCI reboot quirk
vt/consolemap: do font sum unsigned
wlcore: Fix command execute failure 19 for wl12xx
Bluetooth: hci_h5: Set HCI_QUIRK_SIMULTANEOUS_DISCOVERY for btrtl
Bluetooth: btusb: fix memory leak on suspend and resume
mt76: mt7615: reset token when mac_reset happens
pktgen: fix misuse of BUG_ON() in pktgen_thread_worker()
ath10k: fix wmi mgmt tx queue full due to race condition
net: sfp: add mode quirk for GPON module Ubiquiti U-Fiber Instant
Bluetooth: Add new HCI_QUIRK_NO_SUSPEND_NOTIFIER quirk
Bluetooth: Fix null pointer dereference in amp_read_loc_assoc_final_data
staging: most: sound: add sanity check for function argument
staging: bcm2835-audio: Replace unsafe strcpy() with strscpy()
brcmfmac: Add DMI nvram filename quirk for Predia Basic tablet
brcmfmac: Add DMI nvram filename quirk for Voyo winpad A15 tablet
drm/hisilicon: Fix use-after-free
crypto: tcrypt - avoid signed overflow in byte count
fs: make unlazy_walk() error handling consistent
drm/amdgpu: Add check to prevent IH overflow
PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse
ASoC: Intel: bytcr_rt5640: Add new BYT_RT5640_NO_SPEAKERS quirk-flag
drm/amd/display: Guard against NULL pointer deref when get_i2c_info fails
drm/amd/amdgpu: add error handling to amdgpu_virt_read_pf2vf_data
media: uvcvideo: Allow entities with no pads
f2fs: handle unallocated section and zone on pinned/atgc
f2fs: fix to set/clear I_LINKABLE under i_lock
nvme-core: add cancel tagset helpers
nvme-rdma: add clean action for failed reconnection
nvme-tcp: add clean action for failed reconnection
ASoC: Intel: Add DMI quirk table to soc_intel_is_byt_cr()
btrfs: fix error handling in commit_fs_roots
perf/x86/kvm: Add Cascade Lake Xeon steppings to isolation_ucodes[]
ASoC: Intel: sof-sdw: indent and add quirks consistently
ASoC: Intel: sof_sdw: detect DMIC number based on mach params
parisc: Bump 64-bit IRQ stack size to 64 KB
sched/features: Fix hrtick reprogramming
ASoC: Intel: bytcr_rt5640: Add quirk for the Estar Beauty HD MID 7316R tablet
ASoC: Intel: bytcr_rt5640: Add quirk for the Voyo Winpad A15 tablet
ASoC: Intel: bytcr_rt5651: Add quirk for the Jumper EZpad 7 tablet
ASoC: Intel: bytcr_rt5640: Add quirk for the Acer One S1002 tablet
scsi: iscsi: Restrict sessions and handles to admin capabilities
scsi: iscsi: Ensure sysfs attributes are limited to PAGE_SIZE
scsi: iscsi: Verify lengths on passthrough PDUs
Xen/gnttab: handle p2m update errors on a per-slot basis
xen-netback: respect gnttab_map_refs()'s return value
xen: fix p2m size in dom0 for disabled memory hotplug case
zsmalloc: account the number of compacted pages correctly
remoteproc/mediatek: Fix kernel test robot warning
swap: fix swapfile read/write offset
powerpc/sstep: Check instruction validity against ISA version before emulation
powerpc/sstep: Fix incorrect return from analyze_instr()
tty: fix up iterate_tty_read() EOVERFLOW handling
tty: fix up hung_up_tty_read() conversion
tty: clean up legacy leftovers from n_tty line discipline
tty: teach n_tty line discipline about the new "cookie continuations"
tty: teach the n_tty ICANON case about the new "cookie continuations" too
media: v4l: ioctl: Fix memory leak in video_usercopy
ALSA: hda/realtek: Add quirk for Clevo NH55RZQ
ALSA: hda/realtek: Add quirk for Intel NUC 10
ALSA: hda/realtek: Apply dual codec quirks for MSI Godlike X570 board
net: sfp: VSOL V2801F / CarlitoxxPro CPGOS03-0490 v2.0 workaround
net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips
Linux 5.10.21
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I52b1105b73d893779b3886b577accfabe9f83a16