5.10.94-rc1 review
Subsystems (9)
Greg Kroah-Hartman
maintainerPATCH 35/563 dma_fence_array: Fix PENDING_ERROR leak in dma_fence_array_signaled()
In reply to Greg Kroah-HartmanFrom: Thomas Hellström <[email protected]>
commit 95d35838880fb040ccb9fe4a48816bd0c8b62df5 upstream.
If a dma_fence_array is reported signaled by a call to dma_fence_is_signaled(), it may leak the PENDING_ERROR status.
Fix this by clearing the PENDING_ERROR status if we return true in dma_fence_array_signaled().
v2:
- Update Cc list, and add R-b.
--- drivers/dma-buf/dma-fence-array.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/dma-buf/dma-fence-array.c +5 -1
@@ -104,7 +104,11 @@ static bool dma_fence_array_signaled(str {struct dma_fence_array *array =to_dma_fence_array (fence); -return atomic_read (&array->num_pending) <=0 ; +if (atomic_read (&array->num_pending) >0 ) +return false; + +dma_fence_array_clear_pending_error (array); +return true; }static void dma_fence_array_release (struct dma_fence *fence)
Greg Kroah-Hartman
maintainerPATCH 16/563 tools/nolibc: i386: fix initial stack alignment
In reply to Greg Kroah-HartmanFrom: Willy Tarreau <[email protected]>
commit ebbe0d8a449d183fa43b42d84fcb248e25303985 upstream.
After re-checking in the spec and comparing stack offsets with glibc, The last pushed argument must be 16-byte aligned (i.e. aligned before the call) so that in the callee esp+4 is multiple of 16, so the principle is the 32-bit equivalent to what Ammar fixed for x86_64. It's possible that 32-bit code using SSE2 or MMX could have been affected. In addition the frame pointer ought to be zero at the deepest level.
--- tools/include/nolibc/nolibc.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
tools/include/nolibc/nolibc.h +9 -1
@@ -606,13 +606,21 @@ struct sys_stat_struct { })/* startup code */ +/* +* i386 System V ABI mandates: +* 1) last pushed argument must be 16-byte aligned. +* 2) The deepest stack frame should be set to zero +* +*/ asm(".section .text\n" ".global _start\n" "_start:\n" "pop %eax\n" // argc (first arg, %eax) "mov %esp, %ebx\n" // argv[] (second arg, %ebx) "lea 4(%ebx,%eax,4),%ecx\n" // then a NULL then envp (third arg, %ecx) -"and $-16, %esp\n" // x86 ABI : esp must be 16-byte aligned when +"xor %ebp, %ebp\n" // zero the stack frame +"and $-16, %esp\n" // x86 ABI : esp must be 16-byte aligned before +"sub $4, %esp\n" // the call instruction (args are aligned) "push %ecx\n" // push all registers on the stack so that we "push %ebx\n" // support both regparm and plain stack modes "push %eax\n"
Greg Kroah-Hartman
maintainerPATCH 15/563 tools/nolibc: x86-64: Fix startup code bug
In reply to Greg Kroah-HartmanFrom: Ammar Faizi <[email protected]>
commit 937ed91c712273131de6d2a02caafd3ee84e0c72 upstream.
Before this patch, the _start function looks like this:
```
0000000000001170 <_start>:
1170: pop %rdi
1171: mov %rsp,%rsi
1174: lea 0x8(%rsi,%rdi,8),%rdx
1179: and $0xfffffffffffffff0,%rsp
117d: sub $0x8,%rsp
1181: call 1000 <main>
1186: movzbq %al,%rdi
118a: mov $0x3c,%rax
1191: syscall
1193: hlt
1194: data16 cs nopw 0x0(%rax,%rax,1)
119f: nop
```Note the "and" to %rsp with $-16, it makes the %rsp be 16-byte aligned, but then there is a "sub" with $0x8 which makes the %rsp no longer 16-byte aligned, then it calls main. That's the bug!
What actually the x86-64 System V ABI mandates is that right before the "call", the %rsp must be 16-byte aligned, not after the "call". So the "sub" with $0x8 here breaks the alignment. Remove it.
An example where this rule matters is when the callee needs to align its stack at 16-byte for aligned move instruction, like movdqa and movaps. If the callee can't align its stack properly, it will result in segmentation fault.
x86-64 System V ABI also mandates the deepest stack frame should be zero. Just to be safe, let's zero the %rbp on startup as the content of %rbp may be unspecified when the program starts. Now it looks like this:
```
0000000000001170 <_start>:
1170: pop %rdi
1171: mov %rsp,%rsi
1174: lea 0x8(%rsi,%rdi,8),%rdx
1179: xor %ebp,%ebp # zero the %rbp
117b: and $0xfffffffffffffff0,%rsp # align the %rsp
117f: call 1000 <main>
1184: movzbq %al,%rdi
1188: mov $0x3c,%rax
118f: syscall
1191: hlt
1192: data16 cs nopw 0x0(%rax,%rax,1)
119d: nopl (%rax)
```[wt: I did this on purpose due to a misunderstanding of the spec, other
archs will thus have to be rechecked, particularly i386]
--- tools/include/nolibc/nolibc.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
tools/include/nolibc/nolibc.h +8 -2
@@ -422,14 +422,20 @@ struct stat { })/* startup code */ +/* +* x86-64 System V ABI mandates: +* 1) %rsp must be 16-byte aligned right before the function call. +* 2) The deepest stack frame should be zero (the %rbp). +* +*/ asm(".section .text\n" ".global _start\n" "_start:\n" "pop %rdi\n" // argc (first arg, %rdi) "mov %rsp, %rsi\n" // argv[] (second arg, %rsi) "lea 8(%rsi,%rdi,8),%rdx\n" // then a NULL then envp (third arg, %rdx) -"and $-16, %rsp\n" // x86 ABI : esp must be 16-byte aligned when -"sub $8, %rsp\n" // entering the callee +"xor %ebp, %ebp\n" // zero the stack frame +"and $-16, %rsp\n" // x86 ABI : esp must be 16-byte aligned before call "call main\n" // main() returns the status code, we'll exit with it. "movzb %al, %rdi\n" // retrieve exit code from 8 lower bits "mov $60, %rax\n" // NR_exit == 60
Greg Kroah-Hartman
maintainerPATCH 32/563 lkdtm: Fix content of section containing lkdtm_rodata_do_nothing()
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
commit bc93a22a19eb2b68a16ecf04cdf4b2ed65aaf398 upstream.
On a kernel without CONFIG_STRICT_KERNEL_RWX, running EXEC_RODATA test leads to "Illegal instruction" failure.
Looking at the content of rodata_objcopy.o, we see that the function content zeroes only:
Disassembly of section .rodata: 0000000000000000 <.lkdtm_rodata_do_nothing>: 0: 00 00 00 00 .long 0x0
Add the contents flag in order to keep the content of the section while renaming it.
Disassembly of section .rodata: 0000000000000000 <.lkdtm_rodata_do_nothing>: 0: 4e 80 00 20 blr
--- drivers/misc/lkdtm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/lkdtm/Makefile +1 -1
@@ -16,7 +16,7 @@ KCOV_INSTRUMENT_rodata.o := n OBJCOPYFLAGS := OBJCOPYFLAGS_rodata_objcopy.o := \ - --rename-section .noinstr.text=.rodata,alloc,readonly,load + --rename-section .noinstr.text=.rodata,alloc,readonly,load,contents targets += rodata.o rodata_objcopy.o $(obj)/rodata_objcopy.o: $(obj)/rodata.o FORCE $(call if_changed,objcopy)
Greg Kroah-Hartman
maintainerPATCH 4/563 HID: wacom: Ignore the confidence flag when a touch is removed
In reply to Greg Kroah-HartmanFrom: Jason Gerecke <[email protected]>
commit df03e9bd6d4806619b4cdc91a3d7695818a8e2b7 upstream.
AES hardware may internally re-classify a contact that it thought was intentional as a palm. Intentional contacts are reported as "down" with the confidence bit set. When this re-classification occurs, however, the state transitions to "up" with the confidence bit cleared. This kind of transition appears to be legal according to Microsoft docs, but we do not handle it correctly. Because the confidence bit is clear, we don't call wacom_wac_finger_slot and update userspace. This causes hung touches that confuse userspace and interfere with pen arbitration.
This commit adds a special case to ignore the confidence flag if a contact is reported as removed. This ensures we do not leave a hung touch if one of these re-classification events occured. Ideally we'd have some way to also let userspace know that the touch has been re-classified as a palm and needs to be canceled, but that's not possible right now :)
--- drivers/hid/wacom_wac.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-)
drivers/hid/wacom_wac.c +26 -3
@@ -2566,6 +2566,24 @@ static void wacom_wac_finger_slot(struct } } +static bool wacom_wac_slot_is_active (struct input_dev *dev,int key) +{ +struct input_mt *mt = dev->mt; +struct input_mt_slot *s; + +if (!mt) +return false; + +for (s = mt->slots; s != mt->slots + mt->num_slots; s++) { +if (s->key == key && +input_mt_get_value (s,ABS_MT_TRACKING_ID ) >=0 ) { +return true; + } + } + +return false; +} +static void wacom_wac_finger_event (struct hid_device *hdev,struct hid_field *field,struct hid_usage *usage,__s32 value) {
@@ -2613,9 +2631,14 @@ static void wacom_wac_finger_event(struc }if (usage->usage_index +1 == field->report_count) { -if (equivalent_usage == wacom_wac->hid_data.last_slot_field && - wacom_wac->hid_data.confidence) -wacom_wac_finger_slot (wacom_wac, wacom_wac->touch_input); +if (equivalent_usage == wacom_wac->hid_data.last_slot_field) { +bool touch_removed =wacom_wac_slot_is_active (wacom_wac->touch_input, + wacom_wac->hid_data.id) && !wacom_wac->hid_data.tipswitch; + +if (wacom_wac->hid_data.confidence || touch_removed) { +wacom_wac_finger_slot (wacom_wac, wacom_wac->touch_input); + } + } } }
Greg Kroah-Hartman
maintainerPATCH 20/563 media: flexcop-usb: fix control-message timeouts
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit cd1798a387825cc4a51282f5a611ad05bb1ad75f upstream.
USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ.
Note that the driver was multiplying some of the timeout values with HZ twice resulting in 3000-second timeouts with HZ=1000.
Also note that two of the timeout defines are currently unused.
--- drivers/media/usb/b2c2/flexcop-usb.c | 10 +++++----- drivers/media/usb/b2c2/flexcop-usb.h | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-)
drivers/media/usb/b2c2/flexcop-usb.c +5 -5
@@ -87,7 +87,7 @@ static int flexcop_usb_readwrite_dw(stru0 , fc_usb->data,sizeof (u32), - B2C2_WAIT_FOR_OPERATION_RDW * HZ); + B2C2_WAIT_FOR_OPERATION_RDW);if (ret !=sizeof (u32)) { err("error while %s dword from %d (%d).", read ? "reading" :
@@ -155,7 +155,7 @@ static int flexcop_usb_v8_memory_req(str wIndex, fc_usb->data, buflen, - nWaitTime * HZ); + nWaitTime);if (ret != buflen) ret = -EIO ;
@@ -249,13 +249,13 @@ static int flexcop_usb_i2c_req(struct fl/* DKT 020208 - add this to support special case of DiSEqC */ case USB_FUNC_I2C_CHECKWRITE : pipe =B2C2_USB_CTRL_PIPE_OUT ; - nWaitTime =2 ; + nWaitTime =2000 ; request_type |=USB_DIR_OUT ;break ;case USB_FUNC_I2C_READ :case USB_FUNC_I2C_REPEATREAD : pipe =B2C2_USB_CTRL_PIPE_IN ; - nWaitTime =2 ; + nWaitTime =2000 ; request_type |=USB_DIR_IN ;break ;default :
@@ -282,7 +282,7 @@ static int flexcop_usb_i2c_req(struct fl wIndex, fc_usb->data, buflen, - nWaitTime * HZ); + nWaitTime);if (ret != buflen) ret = -EIO ;
drivers/media/usb/b2c2/flexcop-usb.h +6 -6
@@ -91,13 +91,13 @@ typedef enum {UTILITY_SRAM_TESTVERIFY =0x16 , } flexcop_usb_utility_function_t; -#define B2C2_WAIT_FOR_OPERATION_RW (1*HZ) -#define B2C2_WAIT_FOR_OPERATION_RDW (3*HZ) -#define B2C2_WAIT_FOR_OPERATION_WDW (1*HZ) +#define B2C2_WAIT_FOR_OPERATION_RW 1000 +#define B2C2_WAIT_FOR_OPERATION_RDW 3000 +#define B2C2_WAIT_FOR_OPERATION_WDW 1000 -#define B2C2_WAIT_FOR_OPERATION_V8READ (3*HZ) -#define B2C2_WAIT_FOR_OPERATION_V8WRITE (3*HZ) -#define B2C2_WAIT_FOR_OPERATION_V8FLASH (3*HZ) +#define B2C2_WAIT_FOR_OPERATION_V8READ 3000 +#define B2C2_WAIT_FOR_OPERATION_V8WRITE 3000 +#define B2C2_WAIT_FOR_OPERATION_V8FLASH 3000 typedef enum { V8_MEMORY_PAGE_DVB_CI = 0x20,
Greg Kroah-Hartman
maintainercover 5.10.94-rc1 review
This is the start of the stable review cycle for the 5.10.94 release. There are 563 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 26 Jan 2022 18:39:11 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.94-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.10.94-rc1
Fabio Estevam <[email protected]>
ath10k: Fix the MTU size on QCA9377 SDIO
Doyle, Patrick <[email protected]>
mtd: nand: bbt: Fix corner case in bad block table handling
Andrey Konovalov <[email protected]>
lib/test_meminit: destroy cache in kmem_cache_alloc_bulk() test
Alistair Popple <[email protected]>
mm/hmm.c: allow VM_MIXEDMAP to work with hmm_range_fault
Miaoqian Lin <[email protected]>
lib82596: Fix IRQ check in sni_82596_probe
Matthias Schiffer <[email protected]>
scripts/dtc: dtx_diff: remove broken example from help text
Sam Protsenko <[email protected]>
dt-bindings: watchdog: Require samsung,syscon-phandle for Exynos7
Alexander Stein <[email protected]>
dt-bindings: display: meson-vpu: Add missing amlogic,canvas property
Alexander Stein <[email protected]>
dt-bindings: display: meson-dw-hdmi: add missing sound-name-prefix property
Tom Rix <[email protected]>
net: mscc: ocelot: fix using match before it is set
Russell King (Oracle) <[email protected]>
net: sfp: fix high power modules without diagnostic monitoring
Tom Rix <[email protected]>
net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config()
Sergey Shtylyov <[email protected]>
bcmgenet: add WOL IRQ check
Kevin Bracey <[email protected]>
net_sched: restore "mpu xxx" handling
Jie Wang <[email protected]>
net: bonding: fix bond_xmit_broadcast return value error bug
David Heidelberg <[email protected]>
arm64: dts: qcom: msm8996: drop not documented adreno properties
Leon Romanovsky <[email protected]>
devlink: Remove misleading internal_flags from health reporter dump
Zechuan Chen <[email protected]>
perf probe: Fix ppc64 'perf probe add events failed' case
Tudor Ambarus <[email protected]>
dmaengine: at_xdmac: Fix at_xdmac_lld struct definition
Tudor Ambarus <[email protected]>
dmaengine: at_xdmac: Fix lld view setting
Tudor Ambarus <[email protected]>
dmaengine: at_xdmac: Fix concurrency over xfers_list
Tudor Ambarus <[email protected]>
dmaengine: at_xdmac: Print debug message after realeasing the lock
Tudor Ambarus <[email protected]>
dmaengine: at_xdmac: Start transfer for cyclic channels in issue_pending
Tudor Ambarus <[email protected]>
dmaengine: at_xdmac: Don't start transactions at tx_submit level
Adrian Hunter <[email protected]>
perf script: Fix hex dump character output
Guillaume Nault <[email protected]>
libcxgb: Don't accidentally set RTO_ONLINK in cxgb_find_route()
Guillaume Nault <[email protected]>
gre: Don't accidentally set RTO_ONLINK in gre_fill_metadata_dst()
Guillaume Nault <[email protected]>
xfrm: Don't accidentally set RTO_ONLINK in decode_session4()
Eric Dumazet <[email protected]>
netns: add schedule point in ops_exit_list()
Eric Dumazet <[email protected]>
inet: frags: annotate races around fqdir->dead and fqdir->high_thresh
Eric W. Biederman <[email protected]>
taskstats: Cleanup the use of task->exit_code
Michael S. Tsirkin <[email protected]>
virtio_ring: mark ring unused on error
Eli Cohen <[email protected]>
vdpa/mlx5: Fix wrong configuration of virtio_version_1_0
Laurence de Bruxelles <[email protected]>
rtc: pxa: fix null pointer dereference
Dmitry Torokhov <[email protected]>
HID: vivaldi: fix handling devices not using numbered reports
Robert Hancock <[email protected]>
net: axienet: increase default TX ring size to 128
Robert Hancock <[email protected]>
net: axienet: fix for TX busy handling
Robert Hancock <[email protected]>
net: axienet: fix number of TX ring slots for available check
Robert Hancock <[email protected]>
net: axienet: Fix TX ring slot available check
Robert Hancock <[email protected]>
net: axienet: limit minimum TX ring size
Robert Hancock <[email protected]>
net: axienet: add missing memory barriers
Robert Hancock <[email protected]>
net: axienet: reset core on initialization prior to MDIO access
Robert Hancock <[email protected]>
net: axienet: Wait for PhyRstCmplt after core reset
Robert Hancock <[email protected]>
net: axienet: increase reset timeout
Wen Gu <[email protected]>
net/smc: Fix hung_task when removing SMC-R devices
Robert Hancock <[email protected]>
clk: si5341: Fix clock HW provider cleanup
Stephen Boyd <[email protected]>
clk: Emit a stern warning with writable debugfs enabled
Eric Dumazet <[email protected]>
af_unix: annote lockless accesses to unix_tot_inflight & gc_in_progress
Chao Yu <[email protected]>
f2fs: fix to reserve space for IO align feature
Hyeong-Jun Kim <[email protected]>
f2fs: compress: fix potential deadlock of compress file
Miaoqian Lin <[email protected]>
parisc: pdc_stable: Fix memory leak in pdcs_register_pathentries
Tobias Waldekranz <[email protected]>
net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module
Tobias Waldekranz <[email protected]>
net/fsl: xgmac_mdio: Add workaround for erratum A-009885
Eric Dumazet <[email protected]>
ipv4: avoid quadratic behavior in netns dismantle
Eric Dumazet <[email protected]>
ipv4: update fib_info_cnt under spinlock protection
German Gomez <[email protected]>
perf evsel: Override attr->sample_period for non-libpfm4 events
Toke Høiland-Jørgensen <[email protected]>
xdp: check prog type before updating BPF link
Quentin Monnet <[email protected]>
bpftool: Remove inclusion of utilities.mak from Makefiles
Russell King <[email protected]>
arm64/bpf: Remove 128MB limit for BPF JIT programs
Ye Bin <[email protected]>
block: Fix fsync always failed if once failed
Tobias Waldekranz <[email protected]>
powerpc/fsl/dts: Enable WA for erratum A-009885 on fman3l MDIO buses
Anders Roxell <[email protected]>
powerpc/cell: Fix clang -Wimplicit-fallthrough warning
Moshe Shemesh <[email protected]>
Revert "net/mlx5: Add retry mechanism to the command entry index allocation"
Amelie Delaunay <[email protected]>
dmaengine: stm32-mdma: fix STM32_MDMA_CTBR_TSEL_MASK
Chengguang Xu <[email protected]>
RDMA/rxe: Fix a typo in opcode name
Yixing Liu <[email protected]>
RDMA/hns: Modify the mapping attribute of doorbell to device
Kunihiko Hayashi <[email protected]>
dmaengine: uniphier-xdmac: Fix type of address variables
Bart Van Assche <[email protected]>
scsi: core: Show SCMD_LAST in text form
Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_sync: Fix not setting adv set duration
Randy Dunlap <[email protected]>
Documentation: fix firewire.rst ABI file path error
Lukas Bulwahn <[email protected]>
Documentation: refer to config RANDOMIZE_BASE for kernel address-space randomization
Sakari Ailus <[email protected]>
Documentation: ACPI: Fix data node reference documentation
Daniel Thompson <[email protected]>
Documentation: dmaengine: Correctly describe dmatest with channel unset
Randy Dunlap <[email protected]>
media: correct MEDIA_TEST_SUPPORT help text
Maxime Ripard <[email protected]>
drm/vc4: hdmi: Make sure the device is powered with CEC
Suresh Udipi <[email protected]>
media: rcar-csi2: Optimize the selection PHTW register
Marc Kleine-Budde <[email protected]>
can: mcp251xfd: mcp251xfd_tef_obj_read(): fix typo in error message
Ben Hutchings <[email protected]>
firmware: Update Kconfig help text for Google firmware
Baruch Siach <[email protected]>
of: base: Improve argument length mismatch error
Christian König <[email protected]>
drm/radeon: fix error handling in radeon_driver_open_kms
Theodore Ts'o <[email protected]>
ext4: don't use the orphan list when migrating an inode
Ye Bin <[email protected]>
ext4: fix null-ptr-deref in '__ext4_journal_ensure_credits'
Sebastian Andrzej Siewior <[email protected]>
ext4: destroy ext4_fc_dentry_cachep kmemcache on module removal
Xin Yin <[email protected]>
ext4: fast commit may miss tracking unwritten range during ftruncate
Xin Yin <[email protected]>
ext4: use ext4_ext_remove_space() for fast commit replay delete range
Ye Bin <[email protected]>
ext4: Fix BUG_ON in ext4_bread when write quota data
Luís Henriques <[email protected]>
ext4: set csum seed in tmp inode while migrating to extents
Xin Yin <[email protected]>
ext4: fix fast commit may miss tracking range for FALLOC_FL_ZERO_RANGE
Harshad Shirwadkar <[email protected]>
ext4: initialize err_blk before calling __ext4_get_inode_loc
Chunguang Xu <[email protected]>
ext4: fix a possible ABBA deadlock due to busy PA
Jan Kara <[email protected]>
ext4: make sure quota gets properly shutdown on error
Jan Kara <[email protected]>
ext4: make sure to reset inode lockdep class when quota enabling fails
Filipe Manana <[email protected]>
btrfs: respect the max size in the header when activating swap file
Josef Bacik <[email protected]>
btrfs: check the root node for uptodate before returning it
Filipe Manana <[email protected]>
btrfs: fix deadlock between quota enable and other quota operations
Ghalem Boudour <[email protected]>
xfrm: fix policy lookup for ipv6 gre packets
Pali Rohár <[email protected]>
PCI: pci-bridge-emul: Set PCI_STATUS_CAP_LIST for PCIe device
Pali Rohár <[email protected]>
PCI: pci-bridge-emul: Correctly set PCIe capabilities
Pali Rohár <[email protected]>
PCI: pci-bridge-emul: Fix definitions of reserved bits
Pali Rohár <[email protected]>
PCI: pci-bridge-emul: Properly mark reserved PCIe bits in PCI config space
Pali Rohár <[email protected]>
PCI: pci-bridge-emul: Make expansion ROM Base Address register read-only
Lukas Wunner <[email protected]>
PCI: pciehp: Fix infinite loop in IRQ handler upon power fault
Hans de Goede <[email protected]>
PCI: pciehp: Use down_read/write_nested(reset_lock) to fix lockdep errors
Rob Herring <[email protected]>
PCI: xgene: Fix IB window setup
Nicholas Piggin <[email protected]>
powerpc/64s/radix: Fix huge vmap false positive
John David Anglin <[email protected]>
parisc: Fix lpa and lpa_user defines
Brian Norris <[email protected]>
drm/bridge: analogix_dp: Make PSR-exit block less
Ilia Mirkin <[email protected]>
drm/nouveau/kms/nv04: use vzalloc for nv04_display
Lucas Stach <[email protected]>
drm/etnaviv: limit submit sizes
Sakari Ailus <[email protected]>
device property: Fix fwnode_graph_devcon_match() fwnode leak
Alexander Gordeev <[email protected]>
s390/mm: fix 2KB pgtable release race
Ilan Peer <[email protected]>
iwlwifi: mvm: Increase the scan timeout guard to 30 seconds
Xiangyang Zhang <[email protected]>
tracing/kprobes: 'nmissed' not showed correctly for kretprobe
Andrey Ryabinin <[email protected]>
cputime, cpuacct: Include guest time in user time in cpuacct.stat
Lukas Wunner <[email protected]>
serial: Fix incorrect rs485 polarity on uart open
Xie Yongji <[email protected]>
fuse: Pass correct lend value to filemap_write_and_wait_range()
Oleksandr Andrushchenko <[email protected]>
xen/gntdev: fix unmap notification order
Kunihiko Hayashi <[email protected]>
spi: uniphier: Fix a bug that doesn't point to private data correctly
Patrick Williams <[email protected]>
tpm: fix NPE on probe for missing device
Petr Cvachoucek <[email protected]>
ubifs: Error path in ubifs_remount_rw() seems to wrongly free write buffers
Meng Li <[email protected]>
crypto: caam - replace this_cpu_ptr with raw_cpu_ptr
Marek Vasut <[email protected]>
crypto: stm32/crc32 - Fix kernel BUG triggered in probe()
Heiner Kallweit <[email protected]>
crypto: omap-aes - Fix broken pm_runtime_and_get() usage
Arnaud Pouliquen <[email protected]>
rpmsg: core: Clean up resources on announce_create failure.
Miaoqian Lin <[email protected]>
phy: mediatek: Fix missing check in mtk_mipi_tx_probe
Tzung-Bi Shih <[email protected]>
ASoC: mediatek: mt8183: fix device_node leak
Tzung-Bi Shih <[email protected]>
ASoC: mediatek: mt8173: fix device_node leak
Christoph Hellwig <[email protected]>
scsi: sr: Don't use GFP_DMA
Tianjia Zhang <[email protected]>
MIPS: Octeon: Fix build errors using clang
Lakshmi Sowjanya D <[email protected]>
i2c: designware-pci: Fix to change data types of hcnt and lcnt parameters
Marc Zyngier <[email protected]>
irqchip/gic-v4: Disable redistributors' view of the VPE table at boot time
Ye Guojin <[email protected]>
MIPS: OCTEON: add put_device() after of_find_device_by_node()
Jan Kara <[email protected]>
udf: Fix error handling in udf_new_inode()
Hari Bathini <[email protected]>
powerpc/fadump: Fix inaccurate CPU state info in vmcore generated with panic
Hari Bathini <[email protected]>
powerpc: handle kdump appropriately with crash_kexec_post_notifiers option
Thadeu Lima de Souza Cascardo <[email protected]>
selftests/powerpc/spectre_v2: Return skip code when miss_percent is high
Christophe Leroy <[email protected]>
powerpc/40x: Map 32Mbytes of memory at startup
Nathan Chancellor <[email protected]>
MIPS: Loongson64: Use three arguments for slti
Takashi Iwai <[email protected]>
ALSA: seq: Set upper limit of processed events
James Smart <[email protected]>
scsi: lpfc: Trigger SLI4 firmware dump before doing driver cleanup
Christoph Hellwig <[email protected]>
dm: fix alloc_dax error handling in alloc_dev
Srinivas Kandagatla <[email protected]>
nvmem: core: set size for sysfs bin file
Christophe Leroy <[email protected]>
w1: Misuse of get_user()/put_user() reported by sparse
Alexey Kardashevskiy <[email protected]>
KVM: PPC: Book3S: Suppress failed alloc warning in H_COPY_TOFROM_GUEST
Alexey Kardashevskiy <[email protected]>
KVM: PPC: Book3S: Suppress warnings when allocating too big memory slots
Christophe Leroy <[email protected]>
powerpc/powermac: Add missing lockdep_register_key()
Martin Blumenstingl <[email protected]>
clk: meson: gxbb: Fix the SDM_EN bit for MPLL0 on GXBB
Joakim Tjernlund <[email protected]>
i2c: mpc: Correct I2C reset procedure
Michael Ellerman <[email protected]>
powerpc/smp: Move setup_profiling_timer() under CONFIG_PROFILING
Heiner Kallweit <[email protected]>
i2c: i801: Don't silently correct invalid transfer size
Nicholas Piggin <[email protected]>
powerpc/watchdog: Fix missed watchdog reset due to memory ordering race
Julia Lawall <[email protected]>
powerpc/btext: add missing of_node_put
Julia Lawall <[email protected]>
powerpc/cell: add missing of_node_put
Julia Lawall <[email protected]>
powerpc/powernv: add missing of_node_put
Julia Lawall <[email protected]>
powerpc/6xx: add missing of_node_put
Ingo Molnar <[email protected]>
x86/kbuild: Enable CONFIG_KALLSYMS_ALL=y in the defconfigs
Mauro Carvalho Chehab <[email protected]>
scripts: sphinx-pre-install: Fix ctex support on Debian
John David Anglin <[email protected]>
parisc: Avoid calling faulthandler_disabled() twice
Jason A. Donenfeld <[email protected]>
random: do not throw away excess input to crng_fast_load
Lukas Wunner <[email protected]>
serial: core: Keep mctrl register state and cached copy in sync
Lukas Wunner <[email protected]>
serial: pl010: Drop CR register reset on set_termios
Konrad Dybcio <[email protected]>
regulator: qcom_smd: Align probe function with rpmh-regulator
Russell King (Oracle) <[email protected]>
net: gemini: allow any RGMII interface mode
Russell King (Oracle) <[email protected]>
net: phy: marvell: configure RGMII delays for 88E1118
Danielle Ratson <[email protected]>
mlxsw: pci: Avoid flow control for EMAD packets
Joe Thornber <[email protected]>
dm space map common: add bounds check to sm_ll_lookup_bitmap()
Joe Thornber <[email protected]>
dm btree: add a defensive bounds check to insert_at()
Ping-Ke Shih <[email protected]>
mac80211: allow non-standard VHT MCS-10/11
Florian Fainelli <[email protected]>
net: mdio: Demote probed message to debug print
Josef Bacik <[email protected]>
btrfs: remove BUG_ON(!eie) in find_parent_nodes
Josef Bacik <[email protected]>
btrfs: remove BUG_ON() in find_parent_nodes()
Thomas Weißschuh <[email protected]>
ACPI: battery: Add the ThinkPad "Not Charging" quirk
Marina Nikolic <[email protected]>
amdgpu/pm: Make sysfs pm attributes as read-only for VFs
Zongmin Zhou <[email protected]>
drm/amdgpu: fixup bad vram size on gmc v8
Kirill A. Shutemov <[email protected]>
ACPICA: Hardware: Do not flush CPU cache when entering S4 and S5
Sudeep Holla <[email protected]>
ACPICA: Fix wrong interpretation of PCC address
Rafael J. Wysocki <[email protected]>
ACPICA: Executer: Fix the REFCLASS_REFOF case in acpi_ex_opcode_1A_0T_1R()
Rafael J. Wysocki <[email protected]>
ACPICA: Utilities: Avoid deleting the same object twice in a row
Mark Langsdorf <[email protected]>
ACPICA: actypes.h: Expand the ACPI_ACCESS_ definitions
Kyeong Yoo <[email protected]>
jffs2: GC deadlock reading a page that is used in jffs2_write_begin()
Lucas Stach <[email protected]>
drm/etnaviv: consider completed fence seqno in hang check
Antony Antony <[email protected]>
xfrm: rate limit SA mapping change message to user space
Luiz Augusto von Dentz <[email protected]>
Bluetooth: vhci: Set HCI_QUIRK_VALID_LE_STATES
Ben Greear <[email protected]>
ath11k: Fix napi related hang
Randy Dunlap <[email protected]>
um: registers: Rename function names to avoid conflicts and build problems
Luca Coelho <[email protected]>
iwlwifi: pcie: make sure prph_info is set when treating wakeup IRQ
Ilan Peer <[email protected]>
iwlwifi: mvm: Fix calculation of frame length
Johannes Berg <[email protected]>
iwlwifi: remove module loading failure message
Johannes Berg <[email protected]>
iwlwifi: fix leaks/bad data after failed firmware load
Changcheng Deng <[email protected]>
PM: AVS: qcom-cpr: Use div64_ul instead of do_div
Po-Hao Huang <[email protected]>
rtw88: 8822c: update rx settings to prevent potential hw deadlock
Zekun Shen <[email protected]>
ath9k: Fix out-of-bound memcpy in ath9k_hif_usb_rx_stream
Kai-Heng Feng <[email protected]>
usb: hub: Add delay for SuperSpeed hub resume to let links transit to U0
Rafael J. Wysocki <[email protected]>
cpufreq: Fix initialization of min and max frequency QoS requests
Rafael J. Wysocki <[email protected]>
PM: runtime: Add safety net to supplier device release
Thierry Reding <[email protected]>
arm64: tegra: Adjust length of CCPLEX cluster MMIO region
Biwen Li <[email protected]>
arm64: dts: ls1028a-qds: move rtc node to the correct i2c bus
Paul Moore <[email protected]>
audit: ensure userspace is penalized the same as the kernel when under pressure
Ulf Hansson <[email protected]>
mmc: core: Fixup storing of OCR for MMC_QUIRK_NONSTD_SDIO
Zhou Qingyang <[email protected]>
media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach()
Sean Young <[email protected]>
media: igorplugusb: receiver overflow should be reported
Alistair Francis <[email protected]>
HID: quirks: Allow inverting the absolute X/Y values
Paolo Abeni <[email protected]>
bpf: Do not WARN in bpf_warn_invalid_xdp_action()
Suresh Kumar <[email protected]>
net: bonding: debug: avoid printing debug logs when bond is not notifying peers
Borislav Petkov <[email protected]>
x86/mce: Mark mce_read_aux() noinstr
Borislav Petkov <[email protected]>
x86/mce: Mark mce_end() noinstr
Borislav Petkov <[email protected]>
x86/mce: Mark mce_panic() noinstr
Borislav Petkov <[email protected]>
x86/mce: Allow instrumentation during task work queueing
Baochen Qiang <[email protected]>
ath11k: Avoid false DEADLOCK warning reported by lockdep
Heiko Carstens <[email protected]>
selftests/ftrace: make kprobe profile testcase description unique
Iwona Winiarska <[email protected]>
gpio: aspeed: Convert aspeed_gpio.lock to raw_spinlock
Russell King (Oracle) <[email protected]>
net: phy: prefer 1000baseT over 1000baseKX
Antoine Tenart <[email protected]>
net-sysfs: update the queue counts in the unregistration path
Sebastian Gottschall <[email protected]>
ath10k: Fix tx hanging
Wen Gong <[email protected]>
ath11k: avoid deadlock by change ieee80211_queue_work for regd_update_work
Shaul Triebitz <[email protected]>
iwlwifi: mvm: avoid clearing a just saved session protection id
Johannes Berg <[email protected]>
iwlwifi: mvm: synchronize with FW after multicast commands
Mika Westerberg <[email protected]>
thunderbolt: Runtime PM activate both ends of the device link
Mauro Carvalho Chehab <[email protected]>
media: m920x: don't use stack on USB reads
Zhou Qingyang <[email protected]>
media: saa7146: hexium_orion: Fix a NULL pointer dereference in hexium_attach()
Niklas Söderlund <[email protected]>
media: rcar-vin: Update format alignment constraints
James Hilliard <[email protected]>
media: uvcvideo: Increase UVC_CTRL_CONTROL_TIMEOUT to 5 seconds.
Laurent Pinchart <[email protected]>
drm: rcar-du: Fix CRTC timings when CMM is used
Joerg Roedel <[email protected]>
x86/mm: Flush global TLB when switching to trampoline page-table
Xiongwei Song <[email protected]>
floppy: Add max size check for user space request
Neal Liu <[email protected]>
usb: uhci: add aspeed ast2600 uhci support
Kishon Vijay Abraham I <[email protected]>
arm64: dts: ti: j7200-main: Fix 'dtbs_check' serdes_ln_ctrl node
Hans de Goede <[email protected]>
ACPI / x86: Add not-present quirk for the PCI0.SDHB.BRC1 device on the GPD win
Hans de Goede <[email protected]>
ACPI / x86: Allow specifying acpi_device_override_status() quirks by path
Hans de Goede <[email protected]>
ACPI: Change acpi_device_always_present() into acpi_device_override_status()
Hans de Goede <[email protected]>
ACPI / x86: Drop PWM2 device on Lenovo Yoga Book from always present table
Mansur Alisha Shaik <[email protected]>
media: venus: avoid calling core_clk_setrate() concurrently during concurrent video sessions
Sriram R <[email protected]>
ath11k: Avoid NULL ptr access during mgmt tx cleanup
Zekun Shen <[email protected]>
rsi: Fix out-of-bounds read in rsi_read_pkt()
Zekun Shen <[email protected]>
rsi: Fix use-after-free in rsi_rx_done_handler()
Zekun Shen <[email protected]>
mwifiex: Fix skb_over_panic in mwifiex_usb_recv()
Stephan Müller <[email protected]>
crypto: jitter - consider 32 LSB for APT
Chengfeng Ye <[email protected]>
HSI: core: Fix return freed object in hsi_new_client
Hans de Goede <[email protected]>
gpiolib: acpi: Do not set the IRQ type if the IRQ is already in use
Fugang Duan <[email protected]>
tty: serial: imx: disable UCR4_OREN in .stop_rx() instead of .shutdown()
Martyn Welch <[email protected]>
drm/bridge: megachips: Ensure both bridges are probed before registration
Danielle Ratson <[email protected]>
mlxsw: pci: Add shutdown method in PCI driver
Jan Kiszka <[email protected]>
soc: ti: pruss: fix referenced node in error message
Alex Deucher <[email protected]>
drm/amdgpu/display: set vblank_disable_immediate for DC
Yang Li <[email protected]>
drm/amd/display: check top_pipe_to_program pointer
Lukas Bulwahn <[email protected]>
ARM: imx: rename DEBUG_IMX21_IMX27_UART to DEBUG_IMX27_UART
Dinh Nguyen <[email protected]>
EDAC/synopsys: Use the quirk for version instead of ddr version
Zheyu Ma <[email protected]>
media: b2c2: Add missing check in flexcop_pci_isr:
José Expósito <[email protected]>
HID: apple: Do not reset quirks when the Fn key is not found
Hans de Goede <[email protected]>
drm: panel-orientation-quirks: Add quirk for the Lenovo Yoga Book X91F/L
Pavankumar Kondeti <[email protected]>
usb: gadget: f_fs: Use stream_open() for endpoint files
Baochen Qiang <[email protected]>
ath11k: Fix crash caused by uninitialized TX ring
Mauro Carvalho Chehab <[email protected]>
media: atomisp: handle errors at sh_css_create_isp_params()
Linus Lüssing <[email protected]>
batman-adv: allow netlink usage in unprivileged containers
Wan Jiabing <[email protected]>
ARM: shmobile: rcar-gen2: Add missing of_node_put()
Hans de Goede <[email protected]>
media: atomisp-ov2680: Fix ov2680_set_fmt() clobbering the exposure
Mauro Carvalho Chehab <[email protected]>
media: atomisp: set per-device's default mode
Mauro Carvalho Chehab <[email protected]>
media: atomisp: fix try_fmt logic
Ben Skeggs <[email protected]>
drm/nouveau/pmu/gm200-: avoid touching PMU outside of DEVINIT/PREOS/ACR
Neil Armstrong <[email protected]>
drm/bridge: dw-hdmi: handle ELD when DRM_BRIDGE_ATTACH_NO_CONNECTOR
Zekun Shen <[email protected]>
ar5523: Fix null-ptr-deref with unexpected WDCMSG_TARGET_START reply
Andrii Nakryiko <[email protected]>
selftests/bpf: Fix bpf_object leak in skb_ctx selftest
Qiang Yu <[email protected]>
drm/lima: fix warning when CONFIG_DEBUG_SG=y & CONFIG_DMA_API_DEBUG=y
Andrii Nakryiko <[email protected]>
libbpf: Validate that .BTF and .BTF.ext sections contain data
Alexander Aring <[email protected]>
fs: dlm: filter user dlm messages for kernel locks
Wei Yongjun <[email protected]>
Bluetooth: Fix debugfs entry leak in hci_register_dev()
Sicelo A. Mhlongo <[email protected]>
ARM: dts: omap3-n900: Fix lp5523 for multi color
Baruch Siach <[email protected]>
of: base: Fix phandle argument length mismatch error message
Conor Dooley <[email protected]>
clk: bm1880: remove kfrees on static allocations
Shengjiu Wang <[email protected]>
ASoC: fsl_asrc: refine the check of available clock divider
Kamal Heib <[email protected]>
RDMA/cxgb4: Set queue pair state when being queried
Alyssa Ross <[email protected]>
ASoC: fsl_mqs: fix MODULE_ALIAS
Ammar Faizi <[email protected]>
powerpc/xive: Add missing null check after calling kmalloc
Randy Dunlap <[email protected]>
mips: bcm63xx: add support for clk_set_parent()
Randy Dunlap <[email protected]>
mips: lantiq: add support for clk_set_parent()
Sameer Pujar <[email protected]>
arm64: tegra: Remove non existent Tegra194 reset
Sameer Pujar <[email protected]>
arm64: tegra: Fix Tegra194 HDA {clock,reset}-names ordering
Fabrice Gasnier <[email protected]>
counter: stm32-lptimer-cnt: remove iio counter abi
Wei Yongjun <[email protected]>
misc: lattice-ecp3-config: Fix task hung when firmware load failed
Jiasheng Jiang <[email protected]>
ASoC: samsung: idma: Check of ioremap return value
Jiasheng Jiang <[email protected]>
ASoC: mediatek: Check for error clk pointer
Ryuta NAKANISHI <[email protected]>
phy: uniphier-usb3ss: fix unintended writing zeros to PHY register
Alan Stern <[email protected]>
scsi: block: pm: Always set request queue runtime active in blk_post_runtime_resume()
Xiongfeng Wang <[email protected]>
iommu/iova: Fix race between FQ timeout and teardown
Cezary Rojewski <[email protected]>
ASoC: Intel: catpt: Test dmaengine_submit() result before moving on
Maxim Levitsky <[email protected]>
iommu/amd: Restore GA log/tail pointer on host resume
Suravee Suthikulpanit <[email protected]>
iommu/amd: Remove iommu_init_ga()
Arnd Bergmann <[email protected]>
dmaengine: pxa/mmp: stop referencing config->slave_id
Lukas Bulwahn <[email protected]>
mips: fix Kconfig reference to PHYS_ADDR_T_64BIT
Lukas Bulwahn <[email protected]>
mips: add SYS_HAS_CPU_MIPS64_R5 config for MIPS Release 5 support
Dillon Min <[email protected]>
clk: stm32: Fix ltdc's clock turn off by clk_disable_unused() after system enter shell
Frank Rowand <[email protected]>
of: unittest: 64 bit dma address test requires arch support
Jim Quinlan <[email protected]>
of: unittest: fix warning on PowerPC frame size warning
Jiasheng Jiang <[email protected]>
ASoC: rt5663: Handle device_property_read_u32_array error codes
Avihai Horon <[email protected]>
RDMA/cma: Let cma_resolve_ib_dev() continue search even after empty entry
Avihai Horon <[email protected]>
RDMA/core: Let ib_find_gid() continue search even after empty entry
Christophe Leroy <[email protected]>
powerpc/powermac: Add additional missing lockdep_register_key()
Thomas Gleixner <[email protected]>
PCI/MSI: Fix pci_irq_vector()/pci_irq_get_affinity()
Kamal Heib <[email protected]>
RDMA/qedr: Fix reporting max_{send/recv}_wr attrs
Bart Van Assche <[email protected]>
scsi: ufs: Fix race conditions related to driver data
Hector Martin <[email protected]>
iommu/io-pgtable-arm: Fix table descriptor paddr formatting
Jiasheng Jiang <[email protected]>
uio: uio_dmem_genirq: Catch the Exception
Stafford Horne <[email protected]>
openrisc: Add clone3 ABI wrapper
Todd Kjos <[email protected]>
binder: fix handling of error during copy
Kees Cook <[email protected]>
char/mwave: Adjust io port register size
Takashi Iwai <[email protected]>
ALSA: usb-audio: Drop superfluous '0' in Presonus Studio 1810c's ID
Bixuan Cui <[email protected]>
ALSA: oss: fix compile error when OSS_DEBUG is enabled
Waiman Long <[email protected]>
clocksource: Avoid accidental unstable marking of clocksources
Paul E. McKenney <[email protected]>
clocksource: Reduce clocksource-skew threshold
Christophe Leroy <[email protected]>
powerpc/32s: Fix shift-out-of-bounds in KASAN init
Athira Rajeev <[email protected]>
powerpc/perf: Fix PMU callbacks to clear pending PMI before resetting an overflown PMC
Christophe Leroy <[email protected]>
powerpc/irq: Add helper to set regs->softe
Nicholas Piggin <[email protected]>
powerpc/perf: move perf irq/nmi handling details into traps.c
Athira Rajeev <[email protected]>
powerpc/perf: MMCR0 control for PMU registers under PMCC=00
Jordan Niethe <[email protected]>
powerpc/64s: Convert some cpu_setup() and cpu_restore() functions to C
Niklas Söderlund <[email protected]>
dt-bindings: thermal: Fix definition of cooling-maps contribution property
Lukas Bulwahn <[email protected]>
ASoC: uniphier: drop selecting non-existing SND_SOC_UNIPHIER_AIO_DMA
Peiwei Hu <[email protected]>
powerpc/prom_init: Fix improper check of prom_getprop()
Adam Ford <[email protected]>
clk: imx8mn: Fix imx8mn_clko1_sels
Igor Pylypiv <[email protected]>
scsi: pm80xx: Update WARN_ON check in pm8001_mpi_build_cmd()
Kamal Heib <[email protected]>
RDMA/hns: Validate the pkey index
Christophe JAILLET <[email protected]>
RDMA/bnxt_re: Scan the whole bitmap when checking if "disabling RCFW with pending cmd-bit"
Takashi Iwai <[email protected]>
ALSA: hda: Add missing rwsem around snd_ctl_remove() calls
Takashi Iwai <[email protected]>
ALSA: PCM: Add missing rwsem around snd_ctl_remove() calls
Takashi Iwai <[email protected]>
ALSA: jack: Add missing rwsem around snd_ctl_remove() calls
Jan Kara <[email protected]>
ext4: avoid trim error on fs with small groups
Pavel Skripkin <[email protected]>
net: mcs7830: handle usb read errors properly
Nathan Chancellor <[email protected]>
iwlwifi: mvm: Use div_s64 instead of do_div in iwl_mvm_ftm_rtt_smoothing()
Dominik Brodowski <[email protected]>
pcmcia: fix setting of kthread task states
Jiasheng Jiang <[email protected]>
can: xilinx_can: xcan_probe(): check for error irq
Marc Kleine-Budde <[email protected]>
can: softing: softing_startstop(): fix set but not used variable warning
Christophe Jaillet <[email protected]>
tpm_tis: Fix an error handling path in 'tpm_tis_core_init()'
Chen Jun <[email protected]>
tpm: add request_locality before write TPM_INT_ENABLE
Marc Kleine-Budde <[email protected]>
can: mcp251xfd: add missing newline to printed strings
Fabio Estevam <[email protected]>
regmap: Call regmap_debugfs_exit() prior to _init()
Dan Carpenter <[email protected]>
netrom: fix api breakage in nr_setsockopt()
Dan Carpenter <[email protected]>
ax25: uninitialized variable in ax25_setsockopt()
Miaoqian Lin <[email protected]>
spi: spi-meson-spifc: Add missing pm_runtime_disable() in meson_spifc_probe
Dan Carpenter <[email protected]>
Bluetooth: L2CAP: uninitialized variables in l2cap_sock_setsockopt()
Zizhuang Deng <[email protected]>
lib/mpi: Add the return value check of kcalloc()
Moshe Shemesh <[email protected]>
net/mlx5: Set command entry semaphore up once got index free
Aya Levin <[email protected]>
Revert "net/mlx5e: Block offload of outer header csum for UDP tunnels"
Maor Dickman <[email protected]>
net/mlx5e: Don't block routes with nexthop objects in SW
Aya Levin <[email protected]>
net/mlx5e: Fix page DMA map/unmap attributes
Michal Suchanek <[email protected]>
debugfs: lockdown: Allow reading debugfs files that are not world readable
José Expósito <[email protected]>
HID: hid-uclogic-params: Invalid parameter check in uclogic_params_frame_init_v1_buttonpad
José Expósito <[email protected]>
HID: hid-uclogic-params: Invalid parameter check in uclogic_params_huion_init
José Expósito <[email protected]>
HID: hid-uclogic-params: Invalid parameter check in uclogic_params_get_str_desc
José Expósito <[email protected]>
HID: hid-uclogic-params: Invalid parameter check in uclogic_params_init
Miaoqian Lin <[email protected]>
usb: dwc3: qcom: Fix NULL vs IS_ERR checking in dwc3_qcom_probe
Miaoqian Lin <[email protected]>
Bluetooth: hci_qca: Fix NULL vs IS_ERR_OR_NULL check in qca_serdev_probe
Jiasheng Jiang <[email protected]>
Bluetooth: hci_bcm: Check for error irq
Jiasheng Jiang <[email protected]>
fsl/fman: Check for null pointer after calling devm_ioremap
Jiasheng Jiang <[email protected]>
staging: greybus: audio: Check null pointer
Dan Carpenter <[email protected]>
rocker: fix a sleeping in atomic bug
Eric Dumazet <[email protected]>
ppp: ensure minimum packet size in ppp_write()
Florian Westphal <[email protected]>
netfilter: nft_set_pipapo: allocate pcpu scratch maps on clone
Kuniyuki Iwashima <[email protected]>
bpf: Fix SO_RCVBUF/SO_SNDBUF handling in _bpf_setsockopt().
Daniel Borkmann <[email protected]>
bpf: Don't promote bogus looking registers after null check.
Xin Xiong <[email protected]>
netfilter: ipt_CLUSTERIP: fix refcount leak in clusterip_tg_check()
Jiasheng Jiang <[email protected]>
power: reset: mt6397: Check for null res pointer
Zhou Qingyang <[email protected]>
pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in nonstatic_find_mem_region()
Zhou Qingyang <[email protected]>
pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in __nonstatic_find_io_region()
Hans de Goede <[email protected]>
ACPI: scan: Create platform device for BCM4752 and LNV4752 ACPI nodes
Zhang Zixun <[email protected]>
x86/mce/inject: Avoid out-of-bounds write when setting flags
Arseny Demidov <[email protected]>
hwmon: (mr75203) fix wrong power-up delay value
Nathan Chancellor <[email protected]>
x86/boot/compressed: Move CLANG_FLAGS to beginning of KBUILD_CFLAGS
Panicker Harish <[email protected]>
Bluetooth: hci_qca: Stop IBS timer during BT OFF
Clément Léger <[email protected]>
software node: fix wrong node passed to find nargs_prop
Marijn Suijten <[email protected]>
backlight: qcom-wled: Respect enabled-strings in set_brightness
Marijn Suijten <[email protected]>
backlight: qcom-wled: Use cpu_to_le16 macro to perform conversion
Marijn Suijten <[email protected]>
backlight: qcom-wled: Override default length with qcom,enabled-strings
Marijn Suijten <[email protected]>
backlight: qcom-wled: Fix off-by-one maximum with default num_strings
Marijn Suijten <[email protected]>
backlight: qcom-wled: Pass number of elements to read to read_u32_array
Marijn Suijten <[email protected]>
backlight: qcom-wled: Validate enabled string indices in DT
Paul Chaignon <[email protected]>
bpftool: Enable line buffering for stdout
Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix using wrong mode
Johannes Berg <[email protected]>
um: virtio_uml: Fix time-travel external time propagation
Johannes Berg <[email protected]>
um: fix ndelay/udelay defines
Bernard Zhao <[email protected]>
selinux: fix potential memleak in selinux_add_opt()
Sergey Shtylyov <[email protected]>
mmc: meson-mx-sdio: add IRQ check
Sergey Shtylyov <[email protected]>
mmc: meson-mx-sdhc: add IRQ check
Nathan Errera <[email protected]>
iwlwifi: mvm: test roc running status bits before removing the sta
Johannes Berg <[email protected]>
iwlwifi: mvm: fix 32-bit build in FTM
Marek Behún <[email protected]>
ARM: dts: armada-38x: Add generic compatible to UART nodes
Robert Marko <[email protected]>
arm64: dts: marvell: cn9130: enable CP0 GPIO controllers
Robert Marko <[email protected]>
arm64: dts: marvell: cn9130: add GPIO and SPI aliases
Wei Yongjun <[email protected]>
usb: ftdi-elan: fix memory leak on device disconnect
Andre Przywara <[email protected]>
ARM: 9159/1: decompressor: Avoid UNPREDICTABLE NOP encoding
Antony Antony <[email protected]>
xfrm: state and policy should fail if XFRMA_IF_ID 0
Antony Antony <[email protected]>
xfrm: interface with if_id 0 should return error
Jernej Skrabec <[email protected]>
media: hantro: Fix probe func error path
Robin Murphy <[email protected]>
drm/tegra: vic: Fix DMA API misuse
Stephen Boyd <[email protected]>
drm/bridge: ti-sn65dsi86: Set max register for regmap
Dmitry Baryshkov <[email protected]>
drm/msm/dpu: fix safe status debugfs file
Baruch Siach <[email protected]>
arm64: dts: qcom: ipq6018: Fix gpio-ranges property
Srinivas Kandagatla <[email protected]>
arm64: dts: qcom: c630: Fix soundcard setup
Zhou Qingyang <[email protected]>
ath11k: Fix a NULL pointer dereference in ath11k_mac_op_hw_scan()
Jiasheng Jiang <[email protected]>
media: coda/imx-vdoa: Handle dma_set_coherent_mask error codes
Wang Hai <[email protected]>
media: msi001: fix possible null-ptr-deref in msi001_probe()
Anton Vasilyev <[email protected]>
media: dw2102: Fix use after free
Christian Lamparter <[email protected]>
ARM: dts: gemini: NAS4220-B: fis-index-block with 128 KiB sectors
Rameshkumar Sundaram <[email protected]>
ath11k: Fix deleting uninitialized kernel timer during fragment cache flush
Herbert Xu <[email protected]>
crypto: stm32 - Revert broken pm_runtime_resume_and_get changes
Nicolas Toromanoff <[email protected]>
crypto: stm32/cryp - fix bugs and crash in tests
Nicolas Toromanoff <[email protected]>
crypto: stm32/cryp - fix lrw chaining mode
Nicolas Toromanoff <[email protected]>
crypto: stm32/cryp - fix double pm exit
Nicolas Toromanoff <[email protected]>
crypto: stm32/cryp - check early input data
Nicolas Toromanoff <[email protected]>
crypto: stm32/cryp - fix xts and race condition in crypto_engine requests
Nicolas Toromanoff <[email protected]>
crypto: stm32/cryp - fix CTR counter carry
Herbert Xu <[email protected]>
crypto: stm32 - Fix last sparse warning in stm32_cryp_check_ctr_counter
Jakub Kicinski <[email protected]>
selftests: harness: avoid false negatives if test has no ASSERTs
Anders Roxell <[email protected]>
selftests: clone3: clone3: add case CLONE3_ARGS_NO_TEST
Kees Cook <[email protected]>
x86/uaccess: Move variable into switch case statement
Eric Dumazet <[email protected]>
xfrm: fix a small bug in xfrm_sa_len()
Brian Norris <[email protected]>
mwifiex: Fix possible ABBA deadlock
Frederic Weisbecker <[email protected]>
rcu/exp: Mark current CPU as exp-QS in IPI loop second pass
Jackie Liu <[email protected]>
drm/msm/dp: displayPort driver need algorithm rational
Li Hua <[email protected]>
sched/rt: Try to restart rt period timer when rt runtime exceeded
Lv Yunlong <[email protected]>
wireless: iwlwifi: Fix a double free in iwl_txq_dyn_alloc_dma
Robert Schlabbach <[email protected]>
media: si2157: Fix "warm" tuner state detection
Zhou Qingyang <[email protected]>
media: saa7146: mxb: Fix a NULL pointer dereference in mxb_attach()
Zhou Qingyang <[email protected]>
media: dib8000: Fix a memleak in dib8000_init()
Reiji Watanabe <[email protected]>
arm64: clear_page() shouldn't use DC ZVA when DCZID_EL0.DZP == 1
Will Deacon <[email protected]>
arm64: lib: Annotate {clear, copy}_page() as position-independent
Kajol Jain <[email protected]>
bpf: Remove config check to enable bpf support for branch records
Hou Tao <[email protected]>
bpf: Disallow BPF_LOG_KERNEL log level for bpf(BPF_BTF_LOAD)
Alexei Starovoitov <[email protected]>
bpf: Adjust BTF log size limit.
Vincent Donnefort <[email protected]>
sched/fair: Fix per-CPU kthread and wakee stacking for asym CPU capacity
Vincent Donnefort <[email protected]>
sched/fair: Fix detection of per-CPU kthreads waking a task
Sean Wang <[email protected]>
Bluetooth: btmtksdio: fix resume failure
Yang Yingliang <[email protected]>
staging: rtl8192e: rtllib_module: fix error handle case in alloc_rtllib()
Yang Yingliang <[email protected]>
staging: rtl8192e: return error code from rtllib_softmac_init()
Tasos Sahanidis <[email protected]>
floppy: Fix hang in watchdog when disk is ejected
Lino Sanfilippo <[email protected]>
serial: amba-pl011: do not request memory region twice
Lizhi Hou <[email protected]>
tty: serial: uartlite: allow 64 bit address
Nishanth Menon <[email protected]>
arm64: dts: ti: k3-j7200: Correct the d-cache-sets info
Nishanth Menon <[email protected]>
arm64: dts: ti: k3-j721e: Fix the L2 cache sets
Nishanth Menon <[email protected]>
arm64: dts: ti: k3-j7200: Fix the L2 cache sets
Zhou Qingyang <[email protected]>
drm/radeon/radeon_kms: Fix a NULL pointer dereference in radeon_driver_open_kms()
Zhou Qingyang <[email protected]>
drm/amdgpu: Fix a NULL pointer dereference in amdgpu_connector_lcd_native_mode()
Paul Gerber <[email protected]>
thermal/drivers/imx8mm: Enable ADC when enabling monitor
Rafael J. Wysocki <[email protected]>
ACPI: EC: Rework flushing of EC work while suspended to idle
William Kucharski <[email protected]>
cgroup: Trace event cgroup id fields should be u64
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: msm8916: fix MMC controller aliases
Florian Westphal <[email protected]>
netfilter: bridge: add support for pppoe filtering
Oleksij Rempel <[email protected]>
thermal/drivers/imx: Implement runtime PM support
Christophe JAILLET <[email protected]>
media: venus: core: Fix a resource leak in the error handling path of 'venus_probe()'
Christophe JAILLET <[email protected]>
media: venus: core: Fix a potential NULL pointer dereference in an error handling path
Bryan O'Donoghue <[email protected]>
media: venus: core, venc, vdec: Fix probe dependency error
Stanimir Varbanov <[email protected]>
media: venus: pm_helpers: Control core power domain manually
Philipp Zabel <[email protected]>
media: coda: fix CODA960 JPEG encoder buffer overflow
Dafna Hirschfeld <[email protected]>
media: mtk-vcodec: call v4l2_m2m_ctx_release first when file is released
Yang Yingliang <[email protected]>
media: si470x-i2c: fix possible memory leak in si470x_i2c_probe()
Fabio Estevam <[email protected]>
media: imx-pxp: Initialize the spinlock prior to using it
Suresh Udipi <[email protected]>
media: rcar-csi2: Correct the selection of hsfreqrange
Claudiu Beznea <[email protected]>
mfd: atmel-flexcom: Use .resume_noirq
Claudiu Beznea <[email protected]>
mfd: atmel-flexcom: Remove #ifdef CONFIG_PM_SLEEP
Tudor Ambarus <[email protected]>
tty: serial: atmel: Call dma_async_issue_pending()
Tudor Ambarus <[email protected]>
tty: serial: atmel: Check return code of dmaengine_submit()
Peng Fan <[email protected]>
arm64: dts: ti: k3-j721e: correct cache-sets info
Anilkumar Kolli <[email protected]>
ath11k: Use host CE parameters for CE interrupts configuration
Giovanni Cabiddu <[email protected]>
crypto: qat - fix undetected PFVF timeout in ACK loop
Marco Chiappero <[email protected]>
crypto: qat - make pfvf send message direction agnostic
Marco Chiappero <[email protected]>
crypto: qat - remove unnecessary collision prevention step in PFVF
Bhaskar Chowdhury <[email protected]>
crypto: qat - fix spelling mistake: "messge" -> "message"
Dillon Min <[email protected]>
ARM: dts: stm32: fix dtbs_check warning on ili9341 dts binding on stm32f429 disco
George G. Davis <[email protected]>
mtd: hyperbus: rpc-if: fix bug in rpcif_hb_remove
Chengfeng Ye <[email protected]>
crypto: qce - fix uaf on qce_skcipher_register_one
Chengfeng Ye <[email protected]>
crypto: qce - fix uaf on qce_ahash_register_one
Wang Hai <[email protected]>
media: dmxdev: fix UAF when dvb_register_device() fails
Biju Das <[email protected]>
arm64: dts: renesas: cat875: Add rx/tx delays
Dan Carpenter <[email protected]>
drm/vboxvideo: fix a NULL vs IS_ERR() check
Alexander Aring <[email protected]>
fs: dlm: fix build with CONFIG_IPV6 disabled
Jens Wiklander <[email protected]>
tee: fix put order in teedev_close_context()
Karthikeyan Kathirvel <[email protected]>
ath11k: reset RSN/WPA present state for open BSS
Karthikeyan Kathirvel <[email protected]>
ath11k: clear the keys properly via DISABLE_KEY
Sven Eckelmann <[email protected]>
ath11k: Fix ETSI regd with weather radar overlap
Pavel Skripkin <[email protected]>
Bluetooth: stop proccessing malicious adv data
Lad Prabhakar <[email protected]>
memory: renesas-rpc-if: Return error in case devm_ioremap_resource() fails
Alexander Aring <[email protected]>
fs: dlm: don't call kernel_getpeername() in error_report()
Alexander Aring <[email protected]>
fs: dlm: use sk->sk_socket instead of con->sock
Christian Hewitt <[email protected]>
arm64: dts: meson-gxbb-wetek: fix missing GPIO binding
Christian Hewitt <[email protected]>
arm64: dts: meson-gxbb-wetek: fix HDMI in early boot
Alexander Stein <[email protected]>
arm64: dts: amlogic: Fix SPI NOR flash node name for ODROID N2/N2+
Alexander Stein <[email protected]>
arm64: dts: amlogic: meson-g12: Fix GPU operating point table node name
Jammy Huang <[email protected]>
media: aspeed: Update signal status immediately to ensure sane hw state
Dongliang Mu <[email protected]>
media: em28xx: fix memory leak in em28xx_init_dev
Jammy Huang <[email protected]>
media: aspeed: fix mode-detect always time out at 2nd run
Dan Carpenter <[email protected]>
media: atomisp: fix uninitialized bug in gmin_get_pmic_id_and_addr()
Mauro Carvalho Chehab <[email protected]>
media: atomisp: fix enum formats logic
Tsuchiya Yuto <[email protected]>
media: atomisp: add NULL check for asd obtained from atomisp_video_pipe
Aline Santana Cordeiro <[email protected]>
media: staging: media: atomisp: pci: Balance braces around conditional statements in file atomisp_cmd.c
Tsuchiya Yuto <[email protected]>
media: atomisp: fix ifdefs in sh_css.c
Tsuchiya Yuto <[email protected]>
media: atomisp: fix inverted error check for ia_css_mipi_is_source_port_valid()
Tsuchiya Yuto <[email protected]>
media: atomisp: do not use err var when checking port validity for ISP2400
Tsuchiya Yuto <[email protected]>
media: atomisp: fix inverted logic in buffers_needed()
Tsuchiya Yuto <[email protected]>
media: atomisp: fix punit_ddr_dvfs_enable() argument for mrfld_power up case
Tsuchiya Yuto <[email protected]>
media: atomisp: add missing media_device_cleanup() in atomisp_unregister_entities()
Dillon Min <[email protected]>
media: videobuf2: Fix the size printk format
Lad Prabhakar <[email protected]>
mtd: hyperbus: rpc-if: Check return value of rpcif_sw_init()
Rameshkumar Sundaram <[email protected]>
ath11k: Send PPDU_STATS_CFG with proper pdev mask to firmware
Benjamin Li <[email protected]>
wcn36xx: fix RX BD rate mapping for 5GHz legacy rates
Benjamin Li <[email protected]>
wcn36xx: populate band before determining rate on RX
Bryan O'Donoghue <[email protected]>
wcn36xx: Put DXE block into reset before freeing memory
Bryan O'Donoghue <[email protected]>
wcn36xx: Release DMA channel descriptor allocations
Bryan O'Donoghue <[email protected]>
wcn36xx: Fix DMA channel enable/disable cycle
Bryan O'Donoghue <[email protected]>
wcn36xx: Indicate beacon not connection loss on MISSED_BEACON_IND
Benjamin Li <[email protected]>
wcn36xx: ensure pairing of init_scan/finish_scan and start_scan/end_scan
Maxime Ripard <[email protected]>
drm/vc4: hdmi: Set a default HSM rate
Maxime Ripard <[email protected]>
clk: bcm-2835: Remove rounding up the dividers
Maxime Ripard <[email protected]>
clk: bcm-2835: Pick the closest clock rate
Wang Hai <[email protected]>
Bluetooth: cmtp: fix possible panic when cmtp_init_sockets() fails
Brian Norris <[email protected]>
drm/rockchip: dsi: Reconfigure hardware on resume()
Brian Norris <[email protected]>
drm/rockchip: dsi: Disable PLL clock on bind error
Brian Norris <[email protected]>
drm/rockchip: dsi: Hold pm-runtime across bind/unbind
Brian Norris <[email protected]>
drm/rockchip: dsi: Fix unbalanced clock on probe error
Brian Norris <[email protected]>
drm/panel: innolux-p079zca: Delete panel on attach() failure
Brian Norris <[email protected]>
drm/panel: kingdisplay-kd097d04: Delete panel on attach() failure
Wang Hai <[email protected]>
drm: fix null-ptr-deref in drm_dev_init_release()
Dan Carpenter <[email protected]>
drm/bridge: display-connector: fix an uninitialized pointer in probe()
Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix not initializing sk_peer_pid
xinhui pan <[email protected]>
drm/ttm: Put BO in its memory manager's lru list
Gang Li <[email protected]>
shmem: fix a race between shmem_unused_huge_shrink and shmem_evict_inode
Baoquan He <[email protected]>
mm/page_alloc.c: do not warn allocation failure on zone DMA if no managed pages
Baoquan He <[email protected]>
dma/pool: create dma atomic pool only if dma zone has managed pages
Baoquan He <[email protected]>
mm_zone: add function to check if managed dma zone exists
Yifeng Li <[email protected]>
PCI: Add function 1 DMA alias quirk for Marvell 88SE9125 SATA controller
Thomas Hellström <[email protected]>
dma_fence_array: Fix PENDING_ERROR leak in dma_fence_array_signaled()
Dmitry Osipenko <[email protected]>
gpu: host1x: Add back arm_iommu_detach_device()
Yunfei Wang <[email protected]>
iommu/io-pgtable-arm-v7s: Add error handle for page table allocation failure
Christophe Leroy <[email protected]>
lkdtm: Fix content of section containing lkdtm_rodata_do_nothing()
Jonathan Cameron <[email protected]>
iio: adc: ti-adc081c: Partial revert of removal of ACPI IDs
Johan Hovold <[email protected]>
can: softing_cs: softingcs_probe(): fix memleak on registration failure
Hans Verkuil <[email protected]>
media: cec-pin: fix interrupt en/disable handling
Johan Hovold <[email protected]>
media: stk1160: fix control-message timeouts
Johan Hovold <[email protected]>
media: pvrusb2: fix control-message timeouts
Johan Hovold <[email protected]>
media: redrat3: fix control-message timeouts
Michael Kuron <[email protected]>
media: dib0700: fix undefined behavior in tuner shutdown
Johan Hovold <[email protected]>
media: s2255: fix control-message timeouts
Johan Hovold <[email protected]>
media: cpia2: fix control-message timeouts
Johan Hovold <[email protected]>
media: em28xx: fix control-message timeouts
Johan Hovold <[email protected]>
media: mceusb: fix control-message timeouts
Johan Hovold <[email protected]>
media: flexcop-usb: fix control-message timeouts
Hans Verkuil <[email protected]>
media: v4l2-ioctl.c: readbuffers depends on V4L2_CAP_READWRITE
Mateusz Jończyk <[email protected]>
rtc: cmos: take rtc_lock while reading from CMOS
Willy Tarreau <[email protected]>
tools/nolibc: fix incorrect truncation of exit code
Willy Tarreau <[email protected]>
tools/nolibc: i386: fix initial stack alignment
Ammar Faizi <[email protected]>
tools/nolibc: x86-64: Fix startup code bug
Lucas De Marchi <[email protected]>
x86/gpu: Reserve stolen memory for first integrated Intel GPU
Paul Cercueil <[email protected]>
mtd: rawnand: davinci: Rewrite function description
Paul Cercueil <[email protected]>
mtd: rawnand: davinci: Avoid duplicated page read
Paul Cercueil <[email protected]>
mtd: rawnand: davinci: Don't calculate ECC when reading page
Andreas Oetken <[email protected]>
mtd: Fixed breaking list in __mtd_del_partition.
Stefan Riedmueller <[email protected]>
mtd: rawnand: gpmi: Remove explicit default gpmi clock setting for i.MX6
Christian Eggers <[email protected]>
mtd: rawnand: gpmi: Add ERR007117 protection for nfc_apply_timings
Krzysztof Kozlowski <[email protected]>
nfc: llcp: fix NULL error pointer dereference on sendmsg() after failed bind()
Chao Yu <[email protected]>
f2fs: fix to do sanity check in is_alive()
Jason Gerecke <[email protected]>
HID: wacom: Avoid using stale array indicies to read contact count
Jason Gerecke <[email protected]>
HID: wacom: Ignore the confidence flag when a touch is removed
Jason Gerecke <[email protected]>
HID: wacom: Reset expected and received contact counts at the same time
Jann Horn <[email protected]>
HID: uhid: Fix worker destroying device without any protection
Marcelo Tosatti <[email protected]>
KVM: VMX: switch blocked_vcpu_on_cpu_lock to raw spinlock
-------------
Diffstat:
.../ABI/testing/sysfs-bus-iio-lptimer-stm32 | 62 -- Documentation/admin-guide/hw-vuln/spectre.rst | 2 +- .../bindings/display/amlogic,meson-dw-hdmi.yaml | 5 + .../bindings/display/amlogic,meson-vpu.yaml | 6 + .../devicetree/bindings/thermal/thermal-zones.yaml | 9 +- .../devicetree/bindings/watchdog/samsung-wdt.yaml | 5 +- Documentation/driver-api/dmaengine/dmatest.rst | 7 +- Documentation/driver-api/firewire.rst | 4 +- .../acpi/dsd/data-node-references.rst | 10 +- Makefile | 4 +- arch/arm/Kconfig.debug | 14 +- arch/arm/boot/compressed/efi-header.S | 22 +- arch/arm/boot/compressed/head.S | 3 +- arch/arm/boot/dts/armada-38x.dtsi | 4 +- arch/arm/boot/dts/gemini-nas4220b.dts | 2 +- arch/arm/boot/dts/omap3-n900.dts | 50 +- arch/arm/boot/dts/stm32f429-disco.dts | 2 +- arch/arm/include/debug/imx-uart.h | 18 +- arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c | 5 +- arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 2 +- .../boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 3 + arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts | 14 +- arch/arm64/boot/dts/marvell/cn9130.dtsi | 15 + arch/arm64/boot/dts/nvidia/tegra186.dtsi | 2 +- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 9 +- arch/arm64/boot/dts/qcom/ipq6018.dtsi | 2 +- arch/arm64/boot/dts/qcom/msm8916.dtsi | 4 +- arch/arm64/boot/dts/qcom/msm8996.dtsi | 3 - .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 27 + arch/arm64/boot/dts/renesas/cat875.dtsi | 1 + arch/arm64/boot/dts/ti/k3-j7200-main.dtsi | 2 +- arch/arm64/boot/dts/ti/k3-j7200.dtsi | 6 +- arch/arm64/boot/dts/ti/k3-j721e.dtsi | 6 +- arch/arm64/include/asm/extable.h | 9 - arch/arm64/include/asm/memory.h | 5 +- arch/arm64/kernel/traps.c | 2 +- arch/arm64/lib/clear_page.S | 14 +- arch/arm64/lib/copy_page.S | 4 +- arch/arm64/mm/ptdump.c | 2 - arch/arm64/net/bpf_jit_comp.c | 7 +- arch/mips/Kconfig | 6 +- arch/mips/bcm63xx/clk.c | 6 + arch/mips/cavium-octeon/octeon-platform.c | 2 + arch/mips/cavium-octeon/octeon-usb.c | 1 + .../asm/mach-loongson64/kernel-entry-init.h | 4 +- arch/mips/include/asm/octeon/cvmx-bootinfo.h | 4 +- arch/mips/lantiq/clk.c | 6 + arch/openrisc/include/asm/syscalls.h | 2 + arch/openrisc/kernel/entry.S | 5 + arch/parisc/include/asm/special_insns.h | 44 +- arch/parisc/kernel/traps.c | 2 +- arch/powerpc/boot/dts/fsl/qoriq-fman3l-0.dtsi | 2 + arch/powerpc/include/asm/cpu_setup_power.h | 12 + arch/powerpc/include/asm/hw_irq.h | 51 +- arch/powerpc/include/asm/reg.h | 1 + arch/powerpc/kernel/btext.c | 4 +- arch/powerpc/kernel/cpu_setup_power.S | 252 ------ arch/powerpc/kernel/cpu_setup_power.c | 272 ++++++ arch/powerpc/kernel/cputable.c | 12 +- arch/powerpc/kernel/dt_cpu_ftrs.c | 1 + arch/powerpc/kernel/fadump.c | 8 + arch/powerpc/kernel/head_40x.S | 9 +- arch/powerpc/kernel/prom_init.c | 2 +- arch/powerpc/kernel/smp.c | 42 + arch/powerpc/kernel/traps.c | 31 +- arch/powerpc/kernel/watchdog.c | 41 +- arch/powerpc/kvm/book3s_hv.c | 8 +- arch/powerpc/kvm/book3s_hv_nested.c | 2 +- arch/powerpc/mm/book3s64/radix_pgtable.c | 4 +- arch/powerpc/mm/kasan/book3s_32.c | 3 +- arch/powerpc/mm/pgtable_64.c | 14 +- arch/powerpc/perf/core-book3s.c | 97 ++- arch/powerpc/perf/core-fsl-emb.c | 25 - arch/powerpc/perf/isa207-common.c | 8 + arch/powerpc/platforms/cell/iommu.c | 1 + arch/powerpc/platforms/cell/pervasive.c | 1 + arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 1 + arch/powerpc/platforms/powermac/low_i2c.c | 3 + arch/powerpc/platforms/powernv/opal-lpc.c | 1 + arch/powerpc/sysdev/xive/spapr.c | 3 + arch/s390/mm/pgalloc.c | 4 +- arch/um/drivers/virtio_uml.c | 4 + arch/um/include/asm/delay.h | 4 +- arch/um/include/shared/registers.h | 4 +- arch/um/os-Linux/registers.c | 4 +- arch/um/os-Linux/start_up.c | 2 +- arch/x86/boot/compressed/Makefile | 7 +- arch/x86/configs/i386_defconfig | 1 + arch/x86/configs/x86_64_defconfig | 1 + arch/x86/include/asm/realmode.h | 1 + arch/x86/include/asm/uaccess.h | 5 +- arch/x86/kernel/cpu/mce/core.c | 42 +- arch/x86/kernel/cpu/mce/inject.c | 2 +- arch/x86/kernel/early-quirks.c | 10 +- arch/x86/kernel/reboot.c | 12 +- arch/x86/kernel/tsc.c | 1 + arch/x86/kvm/vmx/posted_intr.c | 16 +- arch/x86/realmode/init.c | 26 + arch/x86/um/syscalls_64.c | 3 +- block/blk-flush.c | 4 +- block/blk-pm.c | 22 +- crypto/jitterentropy.c | 3 +- drivers/acpi/acpica/exfield.c | 7 +- drivers/acpi/acpica/exoparg1.c | 3 +- drivers/acpi/acpica/hwesleep.c | 4 +- drivers/acpi/acpica/hwsleep.c | 4 +- drivers/acpi/acpica/hwxfsleep.c | 2 - drivers/acpi/acpica/utdelete.c | 1 + drivers/acpi/battery.c | 22 + drivers/acpi/bus.c | 4 +- drivers/acpi/ec.c | 57 +- drivers/acpi/internal.h | 2 + drivers/acpi/scan.c | 13 +- drivers/acpi/x86/utils.c | 116 ++- drivers/android/binder.c | 4 +- drivers/base/core.c | 3 +- drivers/base/power/runtime.c | 41 +- drivers/base/property.c | 4 +- drivers/base/regmap/regmap.c | 1 + drivers/base/swnode.c | 2 +- drivers/block/floppy.c | 6 +- drivers/bluetooth/btmtksdio.c | 2 + drivers/bluetooth/hci_bcm.c | 7 +- drivers/bluetooth/hci_qca.c | 5 +- drivers/bluetooth/hci_vhci.c | 2 + drivers/char/mwave/3780i.h | 2 +- drivers/char/random.c | 19 +- drivers/char/tpm/tpm_tis_core.c | 14 +- drivers/clk/bcm/clk-bcm2835.c | 13 +- drivers/clk/clk-bm1880.c | 20 +- drivers/clk/clk-si5341.c | 2 +- drivers/clk/clk-stm32f4.c | 4 - drivers/clk/clk.c | 18 + drivers/clk/imx/clk-imx8mn.c | 6 +- drivers/clk/meson/gxbb.c | 44 +- drivers/counter/Kconfig | 2 +- drivers/counter/stm32-lptimer-cnt.c | 297 +------ drivers/cpufreq/cpufreq.c | 4 +- drivers/crypto/caam/caamalg_qi2.c | 2 +- drivers/crypto/omap-aes.c | 2 +- drivers/crypto/qat/qat_common/adf_pf2vf_msg.c | 45 +- drivers/crypto/qat/qat_common/adf_vf2pf_msg.c | 4 +- drivers/crypto/qce/sha.c | 2 +- drivers/crypto/qce/skcipher.c | 2 +- drivers/crypto/stm32/stm32-crc32.c | 4 +- drivers/crypto/stm32/stm32-cryp.c | 938 ++++++++------------- drivers/crypto/stm32/stm32-hash.c | 6 +- drivers/dma-buf/dma-fence-array.c | 6 +- drivers/dma/at_xdmac.c | 57 +- drivers/dma/mmp_pdma.c | 6 - drivers/dma/pxa_dma.c | 7 - drivers/dma/stm32-mdma.c | 2 +- drivers/dma/uniphier-xdmac.c | 5 +- drivers/edac/synopsys_edac.c | 3 +- drivers/firmware/google/Kconfig | 6 +- drivers/gpio/gpio-aspeed.c | 52 +- drivers/gpio/gpiolib-acpi.c | 15 +- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 6 + drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 1 - drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 13 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 + drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 6 + drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 14 +- drivers/gpu/drm/bridge/display-connector.c | 2 +- .../drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 40 +- .../gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c | 10 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi-audio.h | 4 +- .../gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 9 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 12 +- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 1 + drivers/gpu/drm/drm_drv.c | 9 +- drivers/gpu/drm/drm_panel_orientation_quirks.c | 6 + drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 6 + drivers/gpu/drm/etnaviv/etnaviv_gpu.h | 1 + drivers/gpu/drm/etnaviv/etnaviv_sched.c | 4 +- drivers/gpu/drm/lima/lima_device.c | 1 + drivers/gpu/drm/mediatek/mtk_mipi_tx.c | 2 + drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/disp.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c | 37 +- drivers/gpu/drm/panel/panel-innolux-p079zca.c | 10 +- drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c | 8 +- drivers/gpu/drm/radeon/radeon_kms.c | 42 +- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 20 +- drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 82 +- drivers/gpu/drm/tegra/vic.c | 7 +- drivers/gpu/drm/ttm/ttm_bo.c | 2 + drivers/gpu/drm/vboxvideo/vbox_main.c | 4 +- drivers/gpu/drm/vc4/vc4_hdmi.c | 24 +- drivers/gpu/host1x/dev.c | 15 + drivers/hid/hid-apple.c | 2 +- drivers/hid/hid-input.c | 6 + drivers/hid/hid-uclogic-params.c | 31 +- drivers/hid/hid-vivaldi.c | 34 +- drivers/hid/uhid.c | 29 +- drivers/hid/wacom_wac.c | 39 +- drivers/hsi/hsi_core.c | 1 + drivers/hwmon/mr75203.c | 2 +- drivers/i2c/busses/i2c-designware-pcidrv.c | 8 +- drivers/i2c/busses/i2c-i801.c | 15 +- drivers/i2c/busses/i2c-mpc.c | 23 +- drivers/iio/adc/ti-adc081c.c | 22 +- drivers/infiniband/core/cma.c | 12 +- drivers/infiniband/core/device.c | 3 +- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 6 +- drivers/infiniband/hw/bnxt_re/qplib_rcfw.h | 1 - drivers/infiniband/hw/cxgb4/qp.c | 1 + drivers/infiniband/hw/hns/hns_roce_main.c | 5 +- drivers/infiniband/hw/qedr/verbs.c | 2 + drivers/infiniband/sw/rxe/rxe_opcode.c | 2 +- drivers/iommu/amd/init.c | 48 +- drivers/iommu/io-pgtable-arm-v7s.c | 6 +- drivers/iommu/io-pgtable-arm.c | 9 +- drivers/iommu/iova.c | 3 +- drivers/irqchip/irq-gic-v3.c | 16 + drivers/md/dm.c | 4 +- drivers/md/persistent-data/dm-btree.c | 8 +- drivers/md/persistent-data/dm-space-map-common.c | 5 + drivers/media/Kconfig | 8 +- drivers/media/cec/core/cec-pin.c | 31 +- drivers/media/common/saa7146/saa7146_fops.c | 2 +- .../media/common/videobuf2/videobuf2-dma-contig.c | 8 +- drivers/media/dvb-core/dmxdev.c | 18 +- drivers/media/dvb-frontends/dib8000.c | 4 +- drivers/media/pci/b2c2/flexcop-pci.c | 3 + drivers/media/pci/saa7146/hexium_gemini.c | 7 +- drivers/media/pci/saa7146/hexium_orion.c | 8 +- drivers/media/pci/saa7146/mxb.c | 8 +- drivers/media/platform/aspeed-video.c | 14 +- drivers/media/platform/coda/coda-common.c | 8 +- drivers/media/platform/coda/coda-jpeg.c | 21 +- drivers/media/platform/coda/imx-vdoa.c | 6 +- drivers/media/platform/imx-pxp.c | 4 +- .../media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 2 +- drivers/media/platform/qcom/venus/core.c | 39 +- drivers/media/platform/qcom/venus/core.h | 2 - drivers/media/platform/qcom/venus/pm_helpers.c | 94 +-- drivers/media/platform/qcom/venus/pm_helpers.h | 7 +- drivers/media/platform/rcar-vin/rcar-csi2.c | 18 +- drivers/media/platform/rcar-vin/rcar-v4l2.c | 15 +- drivers/media/radio/si470x/radio-si470x-i2c.c | 3 +- drivers/media/rc/igorplugusb.c | 4 +- drivers/media/rc/mceusb.c | 8 +- drivers/media/rc/redrat3.c | 22 +- drivers/media/tuners/msi001.c | 7 + drivers/media/tuners/si2157.c | 2 +- drivers/media/usb/b2c2/flexcop-usb.c | 10 +- drivers/media/usb/b2c2/flexcop-usb.h | 12 +- drivers/media/usb/cpia2/cpia2_usb.c | 4 +- drivers/media/usb/dvb-usb/dib0700_core.c | 2 - drivers/media/usb/dvb-usb/dw2102.c | 338 +++++--- drivers/media/usb/dvb-usb/m920x.c | 12 +- drivers/media/usb/em28xx/em28xx-cards.c | 18 +- drivers/media/usb/em28xx/em28xx-core.c | 4 +- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 8 +- drivers/media/usb/s2255/s2255drv.c | 4 +- drivers/media/usb/stk1160/stk1160-core.c | 4 +- drivers/media/usb/uvc/uvcvideo.h | 2 +- drivers/media/v4l2-core/v4l2-ioctl.c | 4 +- drivers/memory/renesas-rpc-if.c | 2 +- drivers/mfd/atmel-flexcom.c | 11 +- drivers/misc/lattice-ecp3-config.c | 12 +- drivers/misc/lkdtm/Makefile | 2 +- drivers/mmc/core/sdio.c | 4 +- drivers/mmc/host/meson-mx-sdhc-mmc.c | 5 + drivers/mmc/host/meson-mx-sdio.c | 5 + drivers/mtd/hyperbus/rpc-if.c | 8 +- drivers/mtd/mtdpart.c | 2 +- drivers/mtd/nand/bbt.c | 2 +- drivers/mtd/nand/raw/davinci_nand.c | 16 +- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 37 +- drivers/net/bonding/bond_main.c | 36 +- drivers/net/can/softing/softing_cs.c | 2 +- drivers/net/can/softing/softing_fw.c | 11 +- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 6 +- drivers/net/can/xilinx_can.c | 7 +- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 10 +- drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c | 3 +- drivers/net/ethernet/cortina/gemini.c | 9 +- drivers/net/ethernet/freescale/fman/mac.c | 21 +- drivers/net/ethernet/freescale/xgmac_mdio.c | 28 +- drivers/net/ethernet/i825xx/sni_82596.c | 3 +- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 36 +- .../net/ethernet/mellanox/mlx5/core/en/xsk/pool.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 10 +- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 7 +- drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c | 6 +- drivers/net/ethernet/mellanox/mlxsw/cmd.h | 12 + drivers/net/ethernet/mellanox/mlxsw/pci.c | 7 +- drivers/net/ethernet/mscc/ocelot_flower.c | 15 +- drivers/net/ethernet/rocker/rocker_ofdpa.c | 3 +- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 135 +-- drivers/net/phy/marvell.c | 6 + drivers/net/phy/mdio_bus.c | 2 +- drivers/net/phy/phy-core.c | 2 +- drivers/net/phy/sfp.c | 25 +- drivers/net/ppp/ppp_generic.c | 7 +- drivers/net/usb/mcs7830.c | 12 +- drivers/net/wireless/ath/ar5523/ar5523.c | 4 + drivers/net/wireless/ath/ath10k/core.c | 19 +- drivers/net/wireless/ath/ath10k/htt_tx.c | 3 + drivers/net/wireless/ath/ath10k/hw.h | 3 + drivers/net/wireless/ath/ath10k/txrx.c | 2 - drivers/net/wireless/ath/ath11k/ahb.c | 28 +- drivers/net/wireless/ath/ath11k/core.h | 2 +- drivers/net/wireless/ath/ath11k/dp.h | 3 +- drivers/net/wireless/ath/ath11k/dp_tx.c | 2 +- drivers/net/wireless/ath/ath11k/hal.c | 22 + drivers/net/wireless/ath/ath11k/hal.h | 2 + drivers/net/wireless/ath/ath11k/hw.c | 2 - drivers/net/wireless/ath/ath11k/mac.c | 52 +- drivers/net/wireless/ath/ath11k/pci.c | 12 +- drivers/net/wireless/ath/ath11k/reg.c | 103 +-- drivers/net/wireless/ath/ath11k/wmi.c | 5 +- drivers/net/wireless/ath/ath9k/hif_usb.c | 7 + drivers/net/wireless/ath/wcn36xx/dxe.c | 49 +- drivers/net/wireless/ath/wcn36xx/main.c | 34 +- drivers/net/wireless/ath/wcn36xx/smd.c | 8 +- drivers/net/wireless/ath/wcn36xx/txrx.c | 41 +- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 + drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 17 +- .../net/wireless/intel/iwlwifi/mvm/ftm-initiator.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 17 + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 27 + drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 2 +- .../net/wireless/intel/iwlwifi/mvm/time-event.c | 27 +- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 7 +- drivers/net/wireless/intel/iwlwifi/queue/tx.c | 1 + drivers/net/wireless/marvell/mwifiex/sta_event.c | 8 +- drivers/net/wireless/marvell/mwifiex/usb.c | 3 +- drivers/net/wireless/realtek/rtw88/main.c | 2 +- drivers/net/wireless/realtek/rtw88/rtw8821c.h | 2 +- drivers/net/wireless/realtek/rtw88/rtw8822b.c | 2 +- drivers/net/wireless/realtek/rtw88/rtw8822c.c | 2 +- drivers/net/wireless/rsi/rsi_91x_main.c | 4 + drivers/net/wireless/rsi/rsi_91x_usb.c | 9 +- drivers/net/wireless/rsi/rsi_usb.h | 2 + drivers/nvmem/core.c | 2 + drivers/of/base.c | 11 +- drivers/of/unittest.c | 21 +- drivers/parisc/pdc_stable.c | 4 +- drivers/pci/controller/pci-aardvark.c | 4 +- drivers/pci/controller/pci-mvebu.c | 8 + drivers/pci/controller/pci-xgene.c | 2 +- drivers/pci/hotplug/pciehp.h | 3 + drivers/pci/hotplug/pciehp_core.c | 2 +- drivers/pci/hotplug/pciehp_hpc.c | 28 +- drivers/pci/msi.c | 26 +- drivers/pci/pci-bridge-emul.c | 70 +- drivers/pci/quirks.c | 3 + drivers/pcmcia/cs.c | 8 +- drivers/pcmcia/rsrc_nonstatic.c | 6 + drivers/phy/socionext/phy-uniphier-usb3ss.c | 10 +- drivers/power/reset/mt6323-poweroff.c | 3 + drivers/regulator/qcom_smd-regulator.c | 100 ++- drivers/rpmsg/rpmsg_core.c | 20 +- drivers/rtc/rtc-cmos.c | 3 + drivers/rtc/rtc-pxa.c | 4 + drivers/scsi/lpfc/lpfc.h | 2 +- drivers/scsi/lpfc/lpfc_attr.c | 62 +- drivers/scsi/lpfc/lpfc_hbadisc.c | 8 +- drivers/scsi/lpfc/lpfc_sli.c | 6 - drivers/scsi/pm8001/pm8001_hwi.c | 4 +- drivers/scsi/scsi_debugfs.c | 1 + drivers/scsi/scsi_pm.c | 2 +- drivers/scsi/sr.c | 2 +- drivers/scsi/sr_vendor.c | 4 +- drivers/scsi/ufs/tc-dwc-g210-pci.c | 1 - drivers/scsi/ufs/ufshcd-pci.c | 2 - drivers/scsi/ufs/ufshcd-pltfrm.c | 2 - drivers/scsi/ufs/ufshcd.c | 7 + drivers/soc/mediatek/mtk-scpsys.c | 15 +- drivers/soc/qcom/cpr.c | 2 +- drivers/soc/ti/pruss.c | 2 +- drivers/spi/spi-meson-spifc.c | 1 + drivers/spi/spi-uniphier.c | 11 +- drivers/staging/greybus/audio_topology.c | 15 + drivers/staging/media/atomisp/i2c/ov2680.h | 24 - drivers/staging/media/atomisp/pci/atomisp_cmd.c | 92 +- drivers/staging/media/atomisp/pci/atomisp_fops.c | 11 + .../media/atomisp/pci/atomisp_gmin_platform.c | 2 +- drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 185 +++- drivers/staging/media/atomisp/pci/atomisp_subdev.c | 15 +- drivers/staging/media/atomisp/pci/atomisp_subdev.h | 3 + drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 13 +- drivers/staging/media/atomisp/pci/atomisp_v4l2.h | 3 +- drivers/staging/media/atomisp/pci/sh_css.c | 27 +- drivers/staging/media/atomisp/pci/sh_css_mipi.c | 41 +- drivers/staging/media/atomisp/pci/sh_css_params.c | 8 +- drivers/staging/media/hantro/hantro_drv.c | 3 +- drivers/staging/rtl8192e/rtllib.h | 2 +- drivers/staging/rtl8192e/rtllib_module.c | 16 +- drivers/staging/rtl8192e/rtllib_softmac.c | 6 +- drivers/tee/tee_core.c | 4 +- drivers/thermal/imx8mm_thermal.c | 3 + drivers/thermal/imx_thermal.c | 145 ++-- drivers/thunderbolt/acpi.c | 13 + drivers/tty/serial/amba-pl010.c | 3 - drivers/tty/serial/amba-pl011.c | 27 +- drivers/tty/serial/atmel_serial.c | 14 + drivers/tty/serial/imx.c | 7 +- drivers/tty/serial/serial_core.c | 7 +- drivers/tty/serial/uartlite.c | 2 +- drivers/uio/uio_dmem_genirq.c | 6 +- drivers/usb/core/hub.c | 5 +- drivers/usb/dwc3/dwc3-qcom.c | 7 +- drivers/usb/gadget/function/f_fs.c | 4 +- drivers/usb/host/uhci-platform.c | 3 +- drivers/usb/misc/ftdi-elan.c | 1 + drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 - drivers/video/backlight/qcom-wled.c | 122 +-- drivers/virtio/virtio_ring.c | 4 +- drivers/w1/slaves/w1_ds28e04.c | 26 +- drivers/xen/gntdev.c | 6 +- fs/btrfs/backref.c | 21 +- fs/btrfs/ctree.c | 19 +- fs/btrfs/inode.c | 11 + fs/btrfs/qgroup.c | 19 + fs/debugfs/file.c | 2 +- fs/dlm/lock.c | 9 + fs/dlm/lowcomms.c | 45 +- fs/ext4/ext4.h | 1 + fs/ext4/ext4_jbd2.c | 2 + fs/ext4/extents.c | 2 - fs/ext4/fast_commit.c | 18 +- fs/ext4/inode.c | 14 +- fs/ext4/ioctl.c | 2 - fs/ext4/mballoc.c | 48 +- fs/ext4/migrate.c | 23 +- fs/ext4/super.c | 27 +- fs/f2fs/compress.c | 50 +- fs/f2fs/f2fs.h | 11 + fs/f2fs/gc.c | 3 + fs/f2fs/segment.h | 3 +- fs/f2fs/super.c | 44 + fs/f2fs/sysfs.c | 4 +- fs/fuse/file.c | 2 +- fs/jffs2/file.c | 40 +- fs/ubifs/super.c | 1 - fs/udf/ialloc.c | 2 + include/acpi/acpi_bus.h | 5 +- include/acpi/actypes.h | 10 +- include/linux/blk-pm.h | 2 +- include/linux/bpf_verifier.h | 7 + include/linux/clocksource.h | 3 + include/linux/hid.h | 2 + include/linux/mmzone.h | 9 + include/linux/pm_runtime.h | 3 + include/net/inet_frag.h | 11 +- include/net/ipv6_frag.h | 3 +- include/net/sch_generic.h | 5 + include/net/xfrm.h | 5 + include/trace/events/cgroup.h | 12 +- include/uapi/linux/xfrm.h | 1 + kernel/audit.c | 18 +- kernel/bpf/btf.c | 3 +- kernel/bpf/verifier.c | 18 +- kernel/dma/pool.c | 4 +- kernel/rcu/tree_exp.h | 1 + kernel/sched/cputime.c | 4 +- kernel/sched/fair.c | 4 +- kernel/sched/rt.c | 23 +- kernel/time/clocksource.c | 96 ++- kernel/time/jiffies.c | 15 +- kernel/trace/bpf_trace.c | 6 +- kernel/trace/trace_kprobe.c | 5 +- kernel/tsacct.c | 7 +- lib/mpi/mpi-mod.c | 2 + lib/test_hmm.c | 24 + lib/test_meminit.c | 1 + mm/hmm.c | 5 +- mm/page_alloc.c | 19 +- mm/shmem.c | 37 +- net/ax25/af_ax25.c | 10 +- net/batman-adv/netlink.c | 30 +- net/bluetooth/cmtp/core.c | 4 +- net/bluetooth/hci_core.c | 1 + net/bluetooth/hci_event.c | 8 +- net/bluetooth/hci_request.c | 2 +- net/bluetooth/l2cap_sock.c | 45 +- net/bridge/br_netfilter_hooks.c | 7 +- net/core/dev.c | 6 + net/core/devlink.c | 2 - net/core/filter.c | 8 +- net/core/net-sysfs.c | 3 + net/core/net_namespace.c | 4 +- net/ipv4/fib_semantics.c | 47 +- net/ipv4/inet_fragment.c | 8 +- net/ipv4/ip_fragment.c | 3 +- net/ipv4/ip_gre.c | 5 +- net/ipv4/netfilter/ipt_CLUSTERIP.c | 5 +- net/ipv6/ip6_gre.c | 5 +- net/mac80211/rx.c | 2 +- net/netfilter/nft_set_pipapo.c | 8 + net/netrom/af_netrom.c | 12 +- net/nfc/llcp_sock.c | 5 + net/sched/sch_generic.c | 1 + net/smc/smc_core.c | 17 +- net/unix/garbage.c | 14 +- net/unix/scm.c | 6 +- net/xfrm/xfrm_compat.c | 6 +- net/xfrm/xfrm_interface.c | 14 +- net/xfrm/xfrm_policy.c | 24 +- net/xfrm/xfrm_state.c | 23 +- net/xfrm/xfrm_user.c | 41 +- scripts/dtc/dtx_diff | 8 +- scripts/sphinx-pre-install | 3 + security/selinux/hooks.c | 12 +- sound/core/jack.c | 3 + sound/core/oss/pcm_oss.c | 2 +- sound/core/pcm.c | 6 +- sound/core/seq/seq_queue.c | 14 +- sound/pci/hda/hda_codec.c | 3 + sound/soc/codecs/rt5663.c | 12 +- sound/soc/fsl/fsl_asrc.c | 69 +- sound/soc/fsl/fsl_mqs.c | 2 +- sound/soc/intel/catpt/dsp.c | 14 +- sound/soc/mediatek/mt8173/mt8173-max98090.c | 3 + sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 2 + sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | 2 + sound/soc/mediatek/mt8173/mt8173-rt5650.c | 2 + sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c | 6 +- .../mt8183/mt8183-mt6358-ts3a227-max98357.c | 7 +- sound/soc/samsung/idma.c | 2 + sound/soc/uniphier/Kconfig | 2 - sound/usb/format.c | 2 +- sound/usb/mixer_quirks.c | 2 +- sound/usb/quirks.c | 2 +- tools/bpf/bpftool/Documentation/Makefile | 1 - tools/bpf/bpftool/Makefile | 1 - tools/bpf/bpftool/main.c | 2 + tools/include/nolibc/nolibc.h | 33 +- tools/lib/bpf/libbpf.c | 4 + tools/perf/util/debug.c | 2 +- tools/perf/util/evsel.c | 25 +- tools/perf/util/probe-event.c | 3 + tools/testing/selftests/bpf/prog_tests/skb_ctx.c | 2 + tools/testing/selftests/clone3/clone3.c | 6 + .../selftests/ftrace/test.d/kprobe/profile.tc | 2 +- tools/testing/selftests/kselftest_harness.h | 2 +- .../selftests/powerpc/security/spectre_v2.c | 2 +- tools/testing/selftests/vm/hmm-tests.c | 42 + 546 files changed, 5569 insertions(+), 3345 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 6/563 f2fs: fix to do sanity check in is_alive()
From: Chao Yu <[email protected]>
commit 77900c45ee5cd5da63bd4d818a41dbdf367e81cd upstream.
In fuzzed image, SSA table may indicate that a data block belongs to invalid node, which node ID is out-of-range (0, 1, 2 or max_nid), in order to avoid migrating inconsistent data in such corrupted image, let's do sanity check anyway before data block migration.
--- fs/f2fs/gc.c | 3 +++ 1 file changed, 3 insertions(+)
fs/f2fs/gc.c +3 -0
@@ -998,6 +998,9 @@ static bool is_alive(struct f2fs_sb_infoset_sbi_flag (sbi,SBI_NEED_FSCK ); } +if (f2fs_check_nid_range (sbi, dni->ino)) +return false; + *nofs =ofs_of_node (node_page); source_blkaddr =data_blkaddr (NULL , node_page, ofs_in_node);f2fs_put_page (node_page,1 );
Greg Kroah-Hartman
maintainerPATCH 43/563 drm/bridge: display-connector: fix an uninitialized pointer in probe()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 189723fbe9aca18d6f7d638c59a40288030932b5 ]
The "label" pointer is used for debug output. The code assumes that it is either NULL or valid, but it is never set to NULL. It is either valid or uninitialized.
--- drivers/gpu/drm/bridge/display-connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/display-connector.c +1 -1
@@ -104,7 +104,7 @@ static int display_connector_probe(struct platform_device *pdev) {struct display_connector *conn;unsigned int type; -const char *label; +const char *label =NULL ;int ret; conn =devm_kzalloc (&pdev->dev,sizeof (*conn),GFP_KERNEL );
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 45/563 drm/panel: kingdisplay-kd097d04: Delete panel on attach() failure
In reply to Greg Kroah-HartmanFrom: Brian Norris <[email protected]>
[ Upstream commit 5f31dbeae8a88f31c3eb4eb526ab4807c40da241 ]
If we fail to attach (e.g., because 1 of 2 dual-DSI controllers aren't ready), we leave a dangling drm_panel reference to freed memory. Clean that up on failure.
--- drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c +7 -1
@@ -406,7 +406,13 @@ static int kingdisplay_panel_probe(struct mipi_dsi_device *dsi)if (err <0 )return err; -return mipi_dsi_attach (dsi); + err =mipi_dsi_attach (dsi); +if (err <0 ) { +kingdisplay_panel_del (kingdisplay); +return err; + } + +return 0 ; }static int kingdisplay_panel_remove (struct mipi_dsi_device *dsi)
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 47/563 drm/rockchip: dsi: Fix unbalanced clock on probe error
In reply to Greg Kroah-HartmanFrom: Brian Norris <[email protected]>
[ Upstream commit 251888398753924059f3bb247a44153a2853137f ]
Our probe() function never enabled this clock, so we shouldn't disable it if we fail to probe the bridge.
Noted by inspection.
--- drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +1 -5
@@ -1126,14 +1126,10 @@ static int dw_mipi_dsi_rockchip_probe(struct platform_device *pdev)if (ret != -EPROBE_DEFER )DRM_DEV_ERROR (dev,"Failed to probe dw_mipi_dsi: %d\n" , ret); - goto err_clkdisable; +return ret; }return 0 ; - -err_clkdisable: -clk_disable_unprepare (dsi->pllref_clk); -return ret; }static int dw_mipi_dsi_rockchip_remove (struct platform_device *pdev)
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 2/563 HID: uhid: Fix worker destroying device without any protection
In reply to Greg Kroah-HartmanFrom: Jann Horn <[email protected]>
commit 4ea5763fb79ed89b3bdad455ebf3f33416a81624 upstream.
uhid has to run hid_add_device() from workqueue context while allowing parallel use of the userspace API (which is protected with ->devlock). But hid_add_device() can fail. Currently, that is handled by immediately destroying the associated HID device, without using ->devlock - but if there are concurrent requests from userspace, that's wrong and leads to NULL dereferences and/or memory corruption (via use-after-free).
Fix it by leaving the HID device as-is in the worker. We can clean it up later, either in the UHID_DESTROY command handler or in the ->release() handler.
--- drivers/hid/uhid.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-)
drivers/hid/uhid.c +25 -4
@@ -28,11 +28,22 @@struct uhid_device {struct mutex devlock; + +/* This flag tracks whether the HID device is usable for commands from +* userspace. The flag is already set before hid_add_device(), which +* runs in workqueue context, to allow hid_add_device() to communicate +* with userspace. +* However, if hid_add_device() fails, the flag is cleared without +* holding devlock. +* We guarantee that if @running changes from true to false while you're +* holding @devlock, it's still fine to access @hid. +*/ bool running;__u8 *rd_data;uint rd_size; +/* When this is NULL, userspace may use UHID_CREATE/UHID_CREATE2. */ struct hid_device *hid;struct uhid_event input_buf;
@@ -63,9 +74,18 @@ static void uhid_device_add_worker(strucif (ret) {hid_err (uhid->hid,"Cannot register HID device: error %d\n" , ret); -hid_destroy_device (uhid->hid); - uhid->hid =NULL ; +/* We used to call hid_destroy_device() here, but that's really +* messy to get right because we have to coordinate with +* concurrent writes from userspace that might be in the middle +* of using uhid->hid. +* Just leave uhid->hid as-is for now, and clean it up when +* userspace tries to close or reinitialize the uhid instance. +* +* However, we do have to clear the ->running flag and do a +* wakeup to make sure userspace knows that the device is gone. +*/ uhid->running = false; +wake_up_interruptible (&uhid->report_wait); } }
@@ -474,7 +494,7 @@ static int uhid_dev_create2(struct uhid_void *rd_data;int ret; -if (uhid->running) +if (uhid->hid)return -EALREADY ; rd_size = ev->u.create2.rd_size;
@@ -556,7 +576,7 @@ static int uhid_dev_create(struct uhid_dstatic int uhid_dev_destroy (struct uhid_device *uhid) { -if (!uhid->running) +if (!uhid->hid)return -EINVAL ; uhid->running = false;
@@ -565,6 +585,7 @@ static int uhid_dev_destroy(struct uhid_cancel_work_sync (&uhid->worker);hid_destroy_device (uhid->hid); + uhid->hid =NULL ;kfree (uhid->rd_data);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 53/563 clk: bcm-2835: Remove rounding up the dividers
In reply to Greg Kroah-HartmanFrom: Maxime Ripard <[email protected]>
[ Upstream commit 8ca011ef4af48a7af7b15afd8a4a44039dd04cea ]
The driver, once it found a divider, tries to round it up by increasing the least significant bit of the fractional part by one when the round_up argument is set and there's a remainder.
However, since it increases the divider it will actually reduce the clock rate below what we were asking for, leading to issues with clk_set_min_rate() that will complain that our rounded clock rate is below the minimum of the rate.
Since the dividers are fairly precise already, let's remove that part so that we can have clk_set_min_rate() working.
This is effectively a revert of 9c95b32ca093 ("clk: bcm2835: add a round up ability to the clock divisor").
--- drivers/clk/bcm/clk-bcm2835.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/clk/bcm/clk-bcm2835.c +3 -8
@@ -933,8 +933,7 @@ static int bcm2835_clock_is_on(struct clk_hw *hw)static u32 bcm2835_clock_choose_div (struct clk_hw *hw,unsigned long rate, -unsigned long parent_rate, -bool round_up) +unsigned long parent_rate) {struct bcm2835_clock *clock =bcm2835_clock_from_hw (hw);const struct bcm2835_clock_data *data = clock->data;
@@ -946,10 +945,6 @@ static u32 bcm2835_clock_choose_div(struct clk_hw *hw, rem =do_div (temp, rate); div = temp; - -/* Round up and mask off the unused bits */ -if (round_up && ((div & unused_frac_mask) !=0 || rem !=0 )) - div += unused_frac_mask +1 ; div &= ~unused_frac_mask;/* different clamping limits apply for a mash clock */
@@ -1080,7 +1075,7 @@ static int bcm2835_clock_set_rate(struct clk_hw *hw,struct bcm2835_clock *clock =bcm2835_clock_from_hw (hw);struct bcm2835_cprman *cprman = clock->cprman;const struct bcm2835_clock_data *data = clock->data; -u32 div =bcm2835_clock_choose_div (hw, rate, parent_rate, false); +u32 div =bcm2835_clock_choose_div (hw, rate, parent_rate);u32 ctl;spin_lock (&cprman->regs_lock);
@@ -1131,7 +1126,7 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw,if (!(BIT (parent_idx) & data->set_rate_parent)) { *prate =clk_hw_get_rate (parent); - *div =bcm2835_clock_choose_div (hw, rate, *prate, true); + *div =bcm2835_clock_choose_div (hw, rate, *prate); *avgrate =bcm2835_clock_rate_from_divisor (clock, *prate, *div);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 54/563 drm/vc4: hdmi: Set a default HSM rate
In reply to Greg Kroah-HartmanFrom: Maxime Ripard <[email protected]>
[ Upstream commit 3e85b81591609bb794bb00cd619b20965b5b38cd ]
When the firmware doesn't setup the HSM rate (such as when booting without an HDMI cable plugged in), its rate is 0 and thus any register access results in a CPU stall, even though HSM is enabled.
Let's enforce a minimum rate at boot to avoid this issue.
--- drivers/gpu/drm/vc4/vc4_hdmi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/gpu/drm/vc4/vc4_hdmi.c +14 -0
@@ -79,6 +79,7 @@# define VC4_HD_M_SW_RST BIT(2)# define VC4_HD_M_ENABLE BIT(0) +#define HSM_MIN_CLOCK_FREQ 120000000#define CEC_CLOCK_FREQ 40000#define VC4_HSM_MID_CLOCK 149985000
@@ -1806,6 +1807,19 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi->disable_wifi_frequencies =of_property_read_bool (dev->of_node,"wifi-2.4ghz-coexistence" ); +/* +* If we boot without any cable connected to the HDMI connector, +* the firmware will skip the HSM initialization and leave it +* with a rate of 0, resulting in a bus lockup when we're +* accessing the registers even if it's enabled. +* +* Let's put a sensible default at runtime_resume so that we +* don't end up in this situation. +*/ + ret =clk_set_min_rate (vc4_hdmi->hsm_clock,HSM_MIN_CLOCK_FREQ ); +if (ret) + goto err_put_ddc; +if (vc4_hdmi->variant->reset) vc4_hdmi->variant->reset (vc4_hdmi);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 17/563 tools/nolibc: fix incorrect truncation of exit code
In reply to Greg Kroah-HartmanFrom: Willy Tarreau <[email protected]>
commit de0244ae40ae91145faaf164a4252347607c3711 upstream.
Ammar Faizi reported that our exit code handling is wrong. We truncate it to the lowest 8 bits but the syscall itself is expected to take a regular 32-bit signed integer, not an unsigned char. It's the kernel that later truncates it to the lowest 8 bits. The difference is visible in strace, where the program below used to show exit(255) instead of exit(-1):
int main(void)
{
return -1;
}This patch applies the fix to all archs. x86_64, i386, arm64, armv7 and mips were all tested and confirmed to work fine now. Risc-v was not tested but the change is trivial and exactly the same as for other archs.
--- tools/include/nolibc/nolibc.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
tools/include/nolibc/nolibc.h +5 -8
@@ -437,7 +437,7 @@ asm(".section .text\n""xor %ebp, %ebp\n" // zero the stack frame "and $-16, %rsp\n" // x86 ABI : esp must be 16-byte aligned before call "call main\n" // main() returns the status code, we'll exit with it. -"movzb %al, %rdi\n" // retrieve exit code from 8 lower bits +"mov %eax, %edi\n" // retrieve exit code (32 bit) "mov $60, %rax\n" // NR_exit == 60 "syscall\n" // really exit "hlt\n" // ensure it does not return
@@ -625,9 +625,9 @@ asm(".section .text\n""push %ebx\n" // support both regparm and plain stack modes "push %eax\n" "call main\n" // main() returns the status code in %eax -"movzbl %al, %ebx\n" // retrieve exit code from lower 8 bits -"movl $1, %eax\n" // NR_exit == 1 -"int $0x80\n" // exit now +"mov %eax, %ebx\n" // retrieve exit code (32-bit int) +"movl $1, %eax\n" // NR_exit == 1 +"int $0x80\n" // exit now "hlt\n" // ensure it does not "");
@@ -811,7 +811,6 @@ asm(".section .text\n""and %r3, %r1, $-8\n" // AAPCS : sp must be 8-byte aligned in the "mov %sp, %r3\n" // callee, an bl doesn't push (lr=pc) "bl main\n" // main() returns the status code, we'll exit with it. -"and %r0, %r0, $0xff\n" // limit exit code to 8 bits "movs r7, $1\n" // NR_exit == 1 "svc $0x00\n" "");
@@ -1008,7 +1007,6 @@ asm(".section .text\n""add x2, x2, x1\n" // + argv "and sp, x1, -16\n" // sp must be 16-byte aligned in the callee "bl main\n" // main() returns the status code, we'll exit with it. -"and x0, x0, 0xff\n" // limit exit code to 8 bits "mov x8, 93\n" // NR_exit == 93 "svc #0\n" "");
@@ -1213,7 +1211,7 @@ asm(".section .text\n""addiu $sp,$sp,-16\n" // the callee expects to save a0..a3 there! "jal main\n" // main() returns the status code, we'll exit with it. "nop\n" // delayed slot -"and $a0, $v0, 0xff\n" // limit exit code to 8 bits +"move $a0, $v0\n" // retrieve 32-bit exit code from v0 "li $v0, 4001\n" // NR_exit == 4001 "syscall\n" ".end __start\n"
@@ -1411,7 +1409,6 @@ asm(".section .text\n""add a2,a2,a1\n" // + argv "andi sp,a1,-16\n" // sp must be 16-byte aligned "call main\n" // main() returns the status code, we'll exit with it. -"andi a0, a0, 0xff\n" // limit exit code to 8 bits "li a7, 93\n" // NR_exit == 93 "ecall\n" "");
Greg Kroah-Hartman
maintainerPATCH 19/563 media: v4l2-ioctl.c: readbuffers depends on V4L2_CAP_READWRITE
In reply to Greg Kroah-HartmanFrom: Hans Verkuil <[email protected]>
commit cd9d9377ed235b294a492a094e1666178a5e78fd upstream.
If V4L2_CAP_READWRITE is not set, then readbuffers must be set to 0, otherwise v4l2-compliance will complain.
A note on the Fixes tag below: this patch does not really fix that commit, but it can be applied from that commit onwards. For older code there is no guarantee that device_caps is set, so even though this patch would apply, it will not work reliably.
--- drivers/media/v4l2-core/v4l2-ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/v4l2-core/v4l2-ioctl.c +3 -1
@@ -2127,6 +2127,7 @@ static int v4l_prepare_buf(const structstatic int v4l_g_parm (const struct v4l2_ioctl_ops *ops,struct file *file,void *fh,void *arg) { +struct video_device *vfd =video_devdata (file);struct v4l2_streamparm *p = arg;v4l2_std_id std;int ret =check_fmt (file, p->type);
@@ -2138,7 +2139,8 @@ static int v4l_g_parm(const struct v4l2_if (p->type !=V4L2_BUF_TYPE_VIDEO_CAPTURE && p->type !=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE )return -EINVAL ; - p->parm.capture.readbuffers =2 ; +if (vfd->device_caps &V4L2_CAP_READWRITE ) + p->parm.capture.readbuffers =2 ; ret = ops->vidioc_g_std (file, fh, &std);if (ret ==0 )v4l2_video_std_frame_period (std, &p->parm.capture.timeperframe);
Greg Kroah-Hartman
maintainerPATCH 60/563 wcn36xx: populate band before determining rate on RX
In reply to Greg Kroah-HartmanFrom: Benjamin Li <[email protected]>
[ Upstream commit c9c5608fafe4dae975c9644c7d14c51ad3b0ed73 ]
status.band is used in determination of status.rate -- for 5GHz on legacy rates there is a linear shift between the BD descriptor's rate field and the wcn36xx driver's rate table (wcn_5ghz_rates).
We have a special clause to populate status.band for hardware scan offload frames. However, this block occurs after status.rate is already populated. Correctly handle this dependency by moving the band block before the rate block.
This patch addresses kernel warnings & missing scan results for 5GHz APs that send their beacons/probe responses at the higher four legacy rates (24-54 Mbps), when using hardware scan offload:
------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at net/mac80211/rx.c:4532 ieee80211_rx_napi+0x744/0x8d8 Modules linked in: wcn36xx [...] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 4.19.107-g73909fa #1 Hardware name: Square, Inc. T2 (all variants) (DT) Call trace: dump_backtrace+0x0/0x148 show_stack+0x14/0x1c dump_stack+0xb8/0xf0 __warn+0x2ac/0x2d8 warn_slowpath_null+0x44/0x54 ieee80211_rx_napi+0x744/0x8d8 ieee80211_tasklet_handler+0xa4/0xe0 tasklet_action_common+0xe0/0x118 tasklet_action+0x20/0x28 __do_softirq+0x108/0x1ec irq_exit+0xd4/0xd8 __handle_domain_irq+0x84/0xbc gic_handle_irq+0x4c/0xb8 el1_irq+0xe8/0x190 lpm_cpuidle_enter+0x220/0x260 cpuidle_enter_state+0x114/0x1c0 cpuidle_enter+0x34/0x48 do_idle+0x150/0x268 cpu_startup_entry+0x20/0x24 rest_init+0xd4/0xe0 start_kernel+0x398/0x430 ---[ end trace ae28cb759352b403 ]---
--- drivers/net/wireless/ath/wcn36xx/txrx.c | 37 +++++++++++++------------ 1 file changed, 19 insertions(+), 18 deletions(-)
drivers/net/wireless/ath/wcn36xx/txrx.c +19 -18
@@ -259,8 +259,6 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb) fc =__le16_to_cpu (hdr->frame_control); sn =IEEE80211_SEQ_TO_SN (__le16_to_cpu (hdr->seq_ctrl)); - status.freq =WCN36XX_CENTER_FREQ (wcn); - status.band =WCN36XX_BAND (wcn); status.mactime =10 ; status.signal = -get_rssi0 (bd); status.antenna =1 ;
@@ -272,6 +270,25 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb)wcn36xx_dbg (WCN36XX_DBG_RX ,"status.flags=%x\n" , status.flag); +if (bd->scan_learn) { +/* If packet originate from hardware scanning, extract the +* band/channel from bd descriptor. +*/ +u8 hwch = (bd->reserved0 <<4 ) + bd->rx_ch; + +if (bd->rf_band !=1 && hwch <=sizeof (ab_rx_ch_map) && hwch >=1 ) { + status.band =NL80211_BAND_5GHZ ; + status.freq =ieee80211_channel_to_frequency (ab_rx_ch_map[hwch -1 ], + status.band); + }else { + status.band =NL80211_BAND_2GHZ ; + status.freq =ieee80211_channel_to_frequency (hwch, status.band); + } + }else { + status.band =WCN36XX_BAND (wcn); + status.freq =WCN36XX_CENTER_FREQ (wcn); + } +if (bd->rate_id <ARRAY_SIZE (wcn36xx_rate_table)) { rate = &wcn36xx_rate_table[bd->rate_id]; status.encoding = rate->encoding;
@@ -298,22 +315,6 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb) ieee80211_is_probe_resp(hdr->frame_control)) status.boottime_ns = ktime_get_boottime_ns(); -if (bd->scan_learn) { -/* If packet originates from hardware scanning, extract the -* band/channel from bd descriptor. -*/ -u8 hwch = (bd->reserved0 <<4 ) + bd->rx_ch; - -if (bd->rf_band !=1 && hwch <=sizeof (ab_rx_ch_map) && hwch >=1 ) { - status.band =NL80211_BAND_5GHZ ; - status.freq =ieee80211_channel_to_frequency (ab_rx_ch_map[hwch -1 ], - status.band); - }else { - status.band =NL80211_BAND_2GHZ ; - status.freq =ieee80211_channel_to_frequency (hwch, status.band); - } - } -memcpy (IEEE80211_SKB_RXCB (skb), &status,sizeof (status));if (ieee80211_is_beacon (hdr->frame_control)) {
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 14/563 x86/gpu: Reserve stolen memory for first integrated Intel GPU
In reply to Greg Kroah-HartmanFrom: Lucas De Marchi <[email protected]>
commit 9c494ca4d3a535f9ca11ad6af1813983c1c6cbdd upstream.
"Stolen memory" is memory set aside for use by an Intel integrated GPU. The intel_graphics_quirks() early quirk reserves this memory when it is called for a GPU that appears in the intel_early_ids[] table of integrated GPUs.
Previously intel_graphics_quirks() was marked as QFLAG_APPLY_ONCE, so it was called only for the first Intel GPU found. If a discrete GPU happened to be enumerated first, intel_graphics_quirks() was called for it but not for any integrated GPU found later. Therefore, stolen memory for such an integrated GPU was never reserved.
For example, this problem occurs in this Alderlake-P (integrated) + DG2 (discrete) topology where the DG2 is found first, but stolen memory is associated with the integrated GPU:
- 00:01.0 Bridge
`- 03:00.0 DG2 discrete GPU
- 00:02.0 Integrated GPU (with stolen memory)
Remove the QFLAG_APPLY_ONCE flag and call intel_graphics_quirks() for every Intel GPU. Reserve stolen memory for the first GPU that appears in intel_early_ids[].
[bhelgaas: commit log, add code comment, squash in
https://lore.kernel.org/r/20220118190558.2ququ4vdfjuahicm@ldmartin-desk2]
--- arch/x86/kernel/early-quirks.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
arch/x86/kernel/early-quirks.c +9 -1
@@ -515,6 +515,7 @@ static const struct intel_early_ops gen1 .stolen_size = gen9_stolen_size, }; +/* Intel integrated GPUs for which we need to reserve "stolen memory" */ static const struct pci_device_id intel_early_ids[]__initconst = {INTEL_I830_IDS (&i830_early_ops),INTEL_I845G_IDS (&i845_early_ops),
@@ -588,6 +589,13 @@ static void __init intel_graphics_quirksu16 device;int i; +/* +* Reserve "stolen memory" for an integrated GPU. If we've already +* found one, there's nothing to do for other (discrete) GPUs. +*/ +if (resource_size (&intel_graphics_stolen_res)) +return ; + device =read_pci_config_16 (num, slot, func,PCI_DEVICE_ID );for (i =0 ; i <ARRAY_SIZE (intel_early_ids); i++) {
@@ -700,7 +708,7 @@ static struct chipset early_qrk[] __init {PCI_VENDOR_ID_INTEL ,0x3406 ,PCI_CLASS_BRIDGE_HOST , PCI_BASE_CLASS_BRIDGE, 0, intel_remapping_check }, { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA, PCI_ANY_ID, - QFLAG_APPLY_ONCE, intel_graphics_quirks }, + 0, intel_graphics_quirks },/* * HPET on the current version of the Baytrail platform has accuracy * problems: it will halt in deep idle state - so we disable it.
Greg Kroah-Hartman
maintainerPATCH 36/563 PCI: Add function 1 DMA alias quirk for Marvell 88SE9125 SATA controller
In reply to Greg Kroah-HartmanFrom: Yifeng Li <[email protected]>
commit e445375882883f69018aa669b67cbb37ec873406 upstream.
Like other SATA controller chips in the Marvell 88SE91xx series, the Marvell 88SE9125 has the same DMA requester ID hardware bug that prevents it from working under IOMMU. Add it to the list of devices that need the quirk.
Without this patch, device initialization fails with DMA errors:
ata8: softreset failed (1st FIS failed)
DMAR: DRHD: handling fault status reg 2
DMAR: [DMA Write NO_PASID] Request device [03:00.1] fault addr 0xfffc0000 [fault reason 0x02] Present bit in context entry is clear
DMAR: DRHD: handling fault status reg 2
DMAR: [DMA Read NO_PASID] Request device [03:00.1] fault addr 0xfffc0000 [fault reason 0x02] Present bit in context entry is clear
After applying the patch, the controller can be successfully initialized:
ata8: SATA link up 1.5 Gbps (SStatus 113 SControl 330)
ata8.00: ATAPI: PIONEER BD-RW BDR-207M, 1.21, max UDMA/100
ata8.00: configured for UDMA/100
scsi 7:0:0:0: CD-ROM PIONEER BD-RW BDR-207M 1.21 PQ: 0 ANSI: 5
--- drivers/pci/quirks.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/pci/quirks.c +3 -0
@@ -4077,6 +4077,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_M quirk_dma_func1_alias);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_MARVELL_EXT ,0x9123 , quirk_dma_func1_alias); +/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c136 */ +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_MARVELL_EXT ,0x9125 , + quirk_dma_func1_alias);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_MARVELL_EXT ,0x9128 , quirk_dma_func1_alias);/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c14 */
Greg Kroah-Hartman
maintainerPATCH 67/563 media: atomisp: fix inverted logic in buffers_needed()
In reply to Greg Kroah-HartmanFrom: Tsuchiya Yuto <[email protected]>
[ Upstream commit e1921cd14640f0f4d1fad5eb8e448c58a536415d ]
When config.mode is IA_CSS_INPUT_MODE_BUFFERED_SENSOR, it rather needs buffers. Fix it by inverting the return value.
--- drivers/staging/media/atomisp/pci/sh_css_mipi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/media/atomisp/pci/sh_css_mipi.c +4 -4
@@ -389,17 +389,17 @@ static bool buffers_needed(struct ia_css_pipe *pipe) {if (!IS_ISP2401 ) {if (pipe->stream->config.mode ==IA_CSS_INPUT_MODE_BUFFERED_SENSOR ) -return false; -else return true; +else +return false; }if (pipe->stream->config.mode ==IA_CSS_INPUT_MODE_BUFFERED_SENSOR || pipe->stream->config.mode ==IA_CSS_INPUT_MODE_TPG || pipe->stream->config.mode ==IA_CSS_INPUT_MODE_PRBS ) -return false; +return true; -return true; +return false; }int
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 39/563 mm/page_alloc.c: do not warn allocation failure on zone DMA if no managed pages
In reply to Greg Kroah-HartmanFrom: Baoquan He <[email protected]>
commit c4dc63f0032c77464fbd4e7a6afc22fa6913c4a7 upstream.
In kdump kernel of x86_64, page allocation failure is observed:
kworker/u2:2: page allocation failure: order:0, mode:0xcc1(GFP_KERNEL|GFP_DMA), nodemask=(null),cpuset=/,mems_allowed=0
CPU: 0 PID: 55 Comm: kworker/u2:2 Not tainted 5.16.0-rc4+ #5 Hardware name: AMD Dinar/Dinar, BIOS RDN1505B 06/05/2013 Workqueue: events_unbound async_run_entry_fn Call Trace: <TASK> dump_stack_lvl+0x48/0x5e warn_alloc.cold+0x72/0xd6 __alloc_pages_slowpath.constprop.0+0xc69/0xcd0 __alloc_pages+0x1df/0x210 new_slab+0x389/0x4d0 ___slab_alloc+0x58f/0x770 __slab_alloc.constprop.0+0x4a/0x80 kmem_cache_alloc_trace+0x24b/0x2c0 sr_probe+0x1db/0x620 ...... device_add+0x405/0x920 ...... __scsi_add_device+0xe5/0x100 ata_scsi_scan_host+0x97/0x1d0 async_run_entry_fn+0x30/0x130 process_one_work+0x1e8/0x3c0 worker_thread+0x50/0x3b0 ? rescuer_thread+0x350/0x350 kthread+0x16b/0x190 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x22/0x30 </TASK> Mem-Info: ......
The above failure happened when calling kmalloc() to allocate buffer with GFP_DMA. It requests to allocate slab page from DMA zone while no managed pages at all in there.
sr_probe()
--> get_capabilities()
--> buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
Because in the current kernel, dma-kmalloc will be created as long as CONFIG_ZONE_DMA is enabled. However, kdump kernel of x86_64 doesn't have managed pages on DMA zone since commit 6f599d84231f ("x86/kdump: Always reserve the low 1M when the crashkernel option is specified"). The failure can be always reproduced.
For now, let's mute the warning of allocation failure if requesting pages from DMA zone while no managed pages.
[[email protected]: fix warning]
--- mm/page_alloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
mm/page_alloc.c +3 -1
@@ -3964,7 +3964,9 @@ void warn_alloc(gfp_t gfp_mask, nodemaskva_list args; static DEFINE_RATELIMIT_STATE(nopage_rs, 10*HZ, 1); -if ((gfp_mask & __GFP_NOWARN) || !__ratelimit (&nopage_rs)) +if ((gfp_mask & __GFP_NOWARN) || + !__ratelimit (&nopage_rs) || + ((gfp_mask & __GFP_DMA) && !has_managed_dma ()))return ;va_start (args, fmt);
Greg Kroah-Hartman
maintainerPATCH 80/563 arm64: dts: meson-gxbb-wetek: fix HDMI in early boot
In reply to Greg Kroah-HartmanFrom: Christian Hewitt <[email protected]>
[ Upstream commit 8182a35868db5f053111d5d9d4da8fcb3f99259d ]
Mark the VDDIO_AO18 regulator always-on and set hdmi-supply for the hdmi_tx node to ensure HDMI is powered in the early stages of boot.
--- arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi +2 -0
@@ -64,6 +64,7 @@ regulator-name = "VDDIO_AO18"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-always-on; }; vcc_3v3: regulator-vcc_3v3 {
@@ -161,6 +162,7 @@ status = "okay"; pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; pinctrl-names = "default"; + hdmi-supply = <&vddio_ao18>; }; &hdmi_tx_tmds_port {
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 171/563 drm/tegra: vic: Fix DMA API misuse
In reply to Greg Kroah-HartmanFrom: Robin Murphy <[email protected]>
[ Upstream commit 5566174cb10a5167d59b0793871cab7990b149b8 ]
Upon failure, dma_alloc_coherent() returns NULL. If that does happen, passing some uninitialised stack contents to dma_mapping_error() - which belongs to a different API in the first place - has precious little chance of detecting it.
Also include the correct header, because the fragile transitive inclusion currently providing it is going to break soon.
--- drivers/gpu/drm/tegra/vic.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/tegra/vic.c +3 -4
@@ -5,6 +5,7 @@#include <linux/clk.h> #include <linux/delay.h> +#include <linux/dma-mapping.h> #include <linux/host1x.h> #include <linux/iommu.h> #include <linux/module.h>
@@ -265,10 +266,8 @@ static int vic_load_firmware(struct vic *vic)if (!client->group) { virt =dma_alloc_coherent (vic->dev, size, &iova,GFP_KERNEL ); - - err =dma_mapping_error (vic->dev, iova); -if (err <0 ) -return err; +if (!virt) +return -ENOMEM ; }else { virt =tegra_drm_alloc (tegra, size, &iova); }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 82/563 fs: dlm: use sk->sk_socket instead of con->sock
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
[ Upstream commit feb704bd17786c8ff52a49d7759b8ee4f3a5aaac ]
Instead of dereference "con->sock" we can get the socket structure over "sk->sk_socket" as well. This patch will switch to this behaviour.
--- fs/dlm/lowcomms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/dlm/lowcomms.c +1 -2
@@ -480,8 +480,7 @@ static void lowcomms_error_report(struct sock *sk) goto out; orig_report = listen_sock.sk_error_report; -if (con->sock ==NULL || -kernel_getpeername (con->sock, (struct sockaddr *)&saddr) <0 ) { +if (kernel_getpeername (sk->sk_socket, (struct sockaddr *)&saddr) <0 ) { printk_ratelimited(KERN_ERR "dlm: node %d: socket error " "sending to node %d, port %d, " "sk_err=%d/%d\n", dlm_our_nodeid(),
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 83/563 fs: dlm: dont call kernel_getpeername() in error_report()
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
[ Upstream commit 4c3d90570bcc2b338f70f61f01110268e281ca3c ]
In some cases kernel_getpeername() will held the socket lock which is already held when the socket layer calls error_report() callback. Since commit 9dfc685e0262 ("inet: remove races in inet{6}_getname()") this problem becomes more likely because the socket lock will be held always. You will see something like:
bob9-u5 login: [ 562.316860] BUG: spinlock recursion on CPU#7, swapper/7/0
[ 562.318562] lock: 0xffff8f2284720088, .magic: dead4ead, .owner: swapper/7/0, .owner_cpu: 7 [ 562.319522] CPU: 7 PID: 0 Comm: swapper/7 Not tainted 5.15.0+ #135 [ 562.320346] Hardware name: Red Hat KVM/RHEL-AV, BIOS 1.13.0-2.module+el8.3.0+7353+9de0a3cc 04/01/2014 [ 562.321277] Call Trace: [ 562.321529] <IRQ> [ 562.321734] dump_stack_lvl+0x33/0x42 [ 562.322282] do_raw_spin_lock+0x8b/0xc0 [ 562.322674] lock_sock_nested+0x1e/0x50 [ 562.323057] inet_getname+0x39/0x110 [ 562.323425] ? sock_def_readable+0x80/0x80 [ 562.323838] lowcomms_error_report+0x63/0x260 [dlm] [ 562.324338] ? wait_for_completion_interruptible_timeout+0xd2/0x120 [ 562.324949] ? lock_timer_base+0x67/0x80 [ 562.325330] ? do_raw_spin_unlock+0x49/0xc0 [ 562.325735] ? _raw_spin_unlock_irqrestore+0x1e/0x40 [ 562.326218] ? del_timer+0x54/0x80 [ 562.326549] sk_error_report+0x12/0x70 [ 562.326919] tcp_validate_incoming+0x3c8/0x530 [ 562.327347] ? kvm_clock_read+0x14/0x30 [ 562.327718] ? ktime_get+0x3b/0xa0 [ 562.328055] tcp_rcv_established+0x121/0x660 [ 562.328466] tcp_v4_do_rcv+0x132/0x260 [ 562.328835] tcp_v4_rcv+0xcea/0xe20 [ 562.329173] ip_protocol_deliver_rcu+0x35/0x1f0 [ 562.329615] ip_local_deliver_finish+0x54/0x60 [ 562.330050] ip_local_deliver+0xf7/0x110 [ 562.330431] ? inet_rtm_getroute+0x211/0x840 [ 562.330848] ? ip_protocol_deliver_rcu+0x1f0/0x1f0 [ 562.331310] ip_rcv+0xe1/0xf0 [ 562.331603] ? ip_local_deliver+0x110/0x110 [ 562.332011] __netif_receive_skb_core+0x46a/0x1040 [ 562.332476] ? inet_gro_receive+0x263/0x2e0 [ 562.332885] __netif_receive_skb_list_core+0x13b/0x2c0 [ 562.333383] netif_receive_skb_list_internal+0x1c8/0x2f0 [ 562.333896] ? update_load_avg+0x7e/0x5e0 [ 562.334285] gro_normal_list.part.149+0x19/0x40 [ 562.334722] napi_complete_done+0x67/0x160 [ 562.335134] virtnet_poll+0x2ad/0x408 [virtio_net] [ 562.335644] __napi_poll+0x28/0x140 [ 562.336012] net_rx_action+0x23d/0x300 [ 562.336414] __do_softirq+0xf2/0x2ea [ 562.336803] irq_exit_rcu+0xc1/0xf0 [ 562.337173] common_interrupt+0xb9/0xd0
It is and was always forbidden to call kernel_getpeername() in context of error_report(). To get rid of the problem we access the destination address for the peer over the socket structure. While on it we fix to print out the destination port of the inet socket.
--- fs/dlm/lowcomms.c | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-)
fs/dlm/lowcomms.c +20 -22
@@ -471,8 +471,8 @@ int dlm_lowcomms_connect_node(int nodeid)static void lowcomms_error_report (struct sock *sk) {struct connection *con; -struct sockaddr_storage saddr;void (*orig_report)(struct sock *) =NULL ; +struct inet_sock *inet;read_lock_bh (&sk->sk_callback_lock); con =sock2con (sk);
@@ -480,33 +480,31 @@ static void lowcomms_error_report(struct sock *sk) goto out; orig_report = listen_sock.sk_error_report; -if (kernel_getpeername (sk->sk_socket, (struct sockaddr *)&saddr) <0 ) { -printk_ratelimited (KERN_ERR "dlm: node %d: socket error " -"sending to node %d, port %d, " -"sk_err=%d/%d\n" ,dlm_our_nodeid (), - con->nodeid, dlm_config.ci_tcp_port, - sk->sk_err, sk->sk_err_soft); - }else if (saddr.ss_family ==AF_INET ) { -struct sockaddr_in *sin4 = (struct sockaddr_in *)&saddr; + inet =inet_sk (sk); +switch (sk->sk_family) { +case AF_INET :printk_ratelimited (KERN_ERR "dlm: node %d: socket error " -"sending to node %d at %pI4, port %d, " +"sending to node %d at %pI4, dport %d, " "sk_err=%d/%d\n" ,dlm_our_nodeid (), - con->nodeid, &sin4->sin_addr.s_addr, - dlm_config.ci_tcp_port, sk->sk_err, + con->nodeid, &inet->inet_daddr, +ntohs (inet->inet_dport), sk->sk_err, sk->sk_err_soft); - }else { -struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&saddr; - +break ; +case AF_INET6 :printk_ratelimited (KERN_ERR "dlm: node %d: socket error " -"sending to node %d at %u.%u.%u.%u, " -"port %d, sk_err=%d/%d\n" ,dlm_our_nodeid (), - con->nodeid, sin6->sin6_addr.s6_addr32[0 ], - sin6->sin6_addr.s6_addr32[1 ], - sin6->sin6_addr.s6_addr32[2 ], - sin6->sin6_addr.s6_addr32[3 ], - dlm_config.ci_tcp_port, sk->sk_err, +"sending to node %d at %pI6c, " +"dport %d, sk_err=%d/%d\n" ,dlm_our_nodeid (), + con->nodeid, &sk->sk_v6_daddr, +ntohs (inet->inet_dport), sk->sk_err, sk->sk_err_soft); +break ; +default : +printk_ratelimited (KERN_ERR "dlm: node %d: socket error " +"invalid socket family %d set, " +"sk_err=%d/%d\n" ,dlm_our_nodeid (), + sk->sk_family, sk->sk_err, sk->sk_err_soft); + goto out; } out:read_unlock_bh (&sk->sk_callback_lock);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 85/563 Bluetooth: stop proccessing malicious adv data
In reply to Greg Kroah-HartmanFrom: Pavel Skripkin <[email protected]>
[ Upstream commit 3a56ef719f0b9682afb8a86d64b2399e36faa4e6 ]
Syzbot reported slab-out-of-bounds read in hci_le_adv_report_evt(). The problem was in missing validaion check.
We should check if data is not malicious and we can read next data block. If we won't check ptr validness, code can read a way beyond skb->end and it can cause problems, of course.
--- net/bluetooth/hci_event.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
net/bluetooth/hci_event.c +7 -1
@@ -5661,7 +5661,8 @@ static void hci_le_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb)struct hci_ev_le_advertising_info *ev = ptr;s8 rssi; -if (ev->length <=HCI_MAX_AD_LENGTH ) { +if (ev->length <=HCI_MAX_AD_LENGTH && + ev->data + ev->length <=skb_tail_pointer (skb)) { rssi = ev->data[ev->length]; process_adv_report(hdev, ev->evt_type, &ev->bdaddr, ev->bdaddr_type, NULL, 0, rssi,
@@ -5671,6 +5672,11 @@ static void hci_le_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb) } ptr +=sizeof (*ev) + ev->length +1 ; + +if (ptr > (void *)skb_tail_pointer (skb) -sizeof (*ev)) { +bt_dev_err (hdev,"Malicious advertising data. Stopping processing" ); +break ; + } }hci_dev_unlock (hdev);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 70/563 media: atomisp: fix ifdefs in sh_css.c
In reply to Greg Kroah-HartmanFrom: Tsuchiya Yuto <[email protected]>
[ Upstream commit 5a1b2725558f8a3b4cbf0504f53cffae8e163034 ]
## if (pipe->stream->config.mode == IA_CSS_INPUT_MODE_TPG) { case
The intel-aero atomisp has #if defined(IS_ISP_2400_SYSTEM) [1]. It is to be defined in the following two places [2]:
- css/hive_isp_css_common/system_global.h
- css/css_2401_csi2p_system/system_global.h
and the former file is to be included on ISP2400 devices, too. So, it is to be defined for both ISP2400 and ISP2401 devices.
Because the upstreamed atomisp driver now supports only ISP2400 and ISP2401, just remove the ISP version test again. This matches the other upstream commits like 3c0538fbad9f ("media: atomisp: get rid of most checks for ISP2401 version").
While here, moved the comment for define GP_ISEL_TPG_MODE to the appropriate place.
[1] https://github.com/intel-aero/linux-kernel/blob/a1b673258feb915268377275130c5c5df0eafc82/drivers/media/pci/atomisp/css/sh_css.c#L552-L558
[2] https://github.com/intel-aero/linux-kernel/search?q=IS_ISP_2400_SYSTEM
## isys_stream_descr->polling_mode case
This does not exist on the intel-aero atomisp. This is because it is based on css version irci_stable_candrpv_0415_20150521_0458.
On the other hand, the upstreamed atomisp is based on the following css version depending on the ISP version using ifdefs:
- ISP2400: irci_stable_candrpv_0415_20150521_0458
- ISP2401: irci_master_20150911_0724
The isys_stream_descr->polling_mode usage was added on updating css version to irci_master_20150701_0213 [3].
So, it is not a ISP version specific thing, but css version specific thing. Because the upstreamed atomisp driver uses irci_master_20150911_0724 for ISP2401, re-add the ISP version check for now.
I say "for now" because ISP2401 should eventually use the same css version with ISP2400 (i.e., irci_stable_candrpv_0415_20150521_0458)
[3] https://raw.githubusercontent.com/intel/ProductionKernelQuilts/cht-m1stable-2016_ww31/uefi/cht-m1stable/patches/cam-0439-atomisp2-css2401-and-2401_legacy-irci_master_2015070.patch
("atomisp2: css2401 and 2401_legacy-irci_master_20150701_0213")
Link to Intel's Android kernel patch.
## coord = &me->config.internal_frame_origin_bqs_on_sctbl; case
it was added on commit 4f744a573db3 ("media: atomisp: make sh_css_sp_init_pipeline() ISP version independent") for ISP2401. Because the upstreamed atomisp for the ISP2401 part is based on irci_master_20150911_0724, hence the difference.
Because the upstreamed atomisp driver uses irci_master_20150911_0724 for ISP2401, revert the test back to if (IS_ISP2401).
--- drivers/staging/media/atomisp/pci/sh_css.c | 27 +++++++++------------- 1 file changed, 11 insertions(+), 16 deletions(-)
drivers/staging/media/atomisp/pci/sh_css.c +11 -16
@@ -527,6 +527,7 @@ ia_css_stream_input_format_bits_per_pixel(struct ia_css_stream *stream)return bpp; } +/* TODO: move define to proper file in tools */ #define GP_ISEL_TPG_MODE 0x90058#if !defined(ISP2401 )
@@ -579,12 +580,8 @@ sh_css_config_input_network(struct ia_css_stream *stream) { vblank_cycles = vblank_lines * (width + hblank_cycles);sh_css_sp_configure_sync_gen (width, height, hblank_cycles, vblank_cycles); -if (!IS_ISP2401 ) { -if (pipe->stream->config.mode ==IA_CSS_INPUT_MODE_TPG ) { -/* TODO: move define to proper file in tools */ -ia_css_device_store_uint32 (GP_ISEL_TPG_MODE ,0 ); - } - } +if (pipe->stream->config.mode ==IA_CSS_INPUT_MODE_TPG ) +ia_css_device_store_uint32 (GP_ISEL_TPG_MODE ,0 ); }ia_css_debug_dtrace (IA_CSS_DEBUG_TRACE_PRIVATE ,"sh_css_config_input_network() leave:\n" );
@@ -1019,16 +1016,14 @@ static bool sh_css_translate_stream_cfg_to_isys_stream_descr(* ia_css_isys_stream_capture_indication() instead of * ia_css_pipeline_sp_wait_for_isys_stream_N() as isp processing of * capture takes longer than getting an ISYS frame -* -* Only 2401 relevant ?? */ -#if 0 // FIXME: NOT USED on Yocto Aero - isys_stream_descr->polling_mode - = early_polling ?INPUT_SYSTEM_POLL_ON_CAPTURE_REQUEST - :INPUT_SYSTEM_POLL_ON_WAIT_FOR_FRAME ; -ia_css_debug_dtrace (IA_CSS_DEBUG_TRACE_PRIVATE , -"sh_css_translate_stream_cfg_to_isys_stream_descr() leave:\n" ); -#endif +if (IS_ISP2401 ) { + isys_stream_descr->polling_mode + = early_polling ?INPUT_SYSTEM_POLL_ON_CAPTURE_REQUEST + :INPUT_SYSTEM_POLL_ON_WAIT_FOR_FRAME ; +ia_css_debug_dtrace (IA_CSS_DEBUG_TRACE_PRIVATE , +"sh_css_translate_stream_cfg_to_isys_stream_descr() leave:\n" ); + }return rc; }
@@ -1451,7 +1446,7 @@ static void start_pipe(assert (me);/* all callers are in this file and call with non null argument */ -if (!IS_ISP2401 ) { +if (IS_ISP2401 ) { coord = &me->config.internal_frame_origin_bqs_on_sctbl; params = me->stream->isp_params_configs; }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 89/563 tee: fix put order in teedev_close_context()
In reply to Greg Kroah-HartmanFrom: Jens Wiklander <[email protected]>
[ Upstream commit f18397ab3ae23e8e43bba9986e66af6d4497f2ad ]
Prior to this patch was teedev_close_context() calling tee_device_put() before teedev_ctx_put() leading to teedev_ctx_release() accessing ctx->teedev just after the reference counter was decreased on the teedev. Fix this by calling teedev_ctx_put() before tee_device_put().
--- drivers/tee/tee_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/tee/tee_core.c +3 -1
@@ -98,8 +98,10 @@ void teedev_ctx_put(struct tee_context *ctx)static void teedev_close_context (struct tee_context *ctx) { -tee_device_put (ctx->teedev); +struct tee_device *teedev = ctx->teedev; +teedev_ctx_put (ctx); +tee_device_put (teedev); }static int tee_open (struct inode *inode,struct file *filp)
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 24/563 media: s2255: fix control-message timeouts
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit f71d272ad4e354097020a4e6b1dc6e4b59feb50f upstream.
USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ.
Use the common control-message timeout define for the five-second timeouts.
--- drivers/media/usb/s2255/s2255drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/usb/s2255/s2255drv.c +2 -2
@@ -1884,7 +1884,7 @@ static long s2255_vendor_req(struct s225USB_TYPE_VENDOR |USB_RECIP_DEVICE |USB_DIR_IN , Value, Index, buf, - TransferBufferLength, HZ * 5); + TransferBufferLength, USB_CTRL_SET_TIMEOUT);if (r >=0 )memcpy (TransferBuffer, buf, TransferBufferLength);
@@ -1893,7 +1893,7 @@ static long s2255_vendor_req(struct s225 r =usb_control_msg (dev->udev,usb_sndctrlpipe (dev->udev,0 ), Request,USB_TYPE_VENDOR |USB_RECIP_DEVICE , Value, Index, buf, - TransferBufferLength,HZ *5 ); + TransferBufferLength,USB_CTRL_SET_TIMEOUT ); }kfree (buf);return r;
Greg Kroah-Hartman
maintainerPATCH 25/563 media: dib0700: fix undefined behavior in tuner shutdown
In reply to Greg Kroah-HartmanFrom: Michael Kuron <[email protected]>
commit f7b77ebe6d2f49c7747b2d619586d1aa33f9ea91 upstream.
This fixes a problem where closing the tuner would leave it in a state where it would not tune to any channel when reopened. This problem was discovered as part of https://github.com/hselasky/webcamd/issues/16.
Since adap->id is 0 or 1, this bit-shift overflows, which is undefined behavior. The driver still worked in practice as the overflow would in most environments result in 0, which rendered the line a no-op. When running the driver as part of webcamd however, the overflow could lead to 0xff due to optimizations by the compiler, which would, in the end, improperly shut down the tuner.
The bug is a regression introduced in the commit referenced below. The present patch causes identical behavior to before that commit for adap->id equal to 0 or 1. The driver does not contain support for dib0700 devices with more adapters, assuming such even exist.
Tests have been performed with the Xbox One Digital TV Tuner on amd64. Not all dib0700 devices are expected to be affected by the regression; this code path is only taken by those with incorrect endpoint numbers.
--- drivers/media/usb/dvb-usb/dib0700_core.c | 2 -- 1 file changed, 2 deletions(-)
drivers/media/usb/dvb-usb/dib0700_core.c +0 -2
@@ -618,8 +618,6 @@ int dib0700_streaming_ctrl(struct dvb_usdeb_info ("the endpoint number (%i) is not correct, use the adapter id instead" , adap->fe_adap[0 ].stream.props.endpoint);if (onoff) st->channel_state |=1 << (adap->id); -else - st->channel_state |=1 << ~(adap->id); }else {if (onoff) st->channel_state |=1 << (adap->fe_adap[0 ].stream.props.endpoint-2 );
Greg Kroah-Hartman
maintainerPATCH 46/563 drm/panel: innolux-p079zca: Delete panel on attach() failure
In reply to Greg Kroah-HartmanFrom: Brian Norris <[email protected]>
[ Upstream commit 32a267e9c057e1636e7afdd20599aa5741a73079 ]
If we fail to attach (e.g., because 1 of 2 dual-DSI controllers aren't ready), we leave a dangling drm_panel reference to freed memory. Clean that up on failure.
This problem exists since the driver's introduction, but is especially relevant after refactored for dual-DSI variants.
--- drivers/gpu/drm/panel/panel-innolux-p079zca.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-innolux-p079zca.c +9 -1
@@ -484,6 +484,7 @@ static void innolux_panel_del(struct innolux_panel *innolux)static int innolux_panel_probe (struct mipi_dsi_device *dsi) {const struct panel_desc *desc; +struct innolux_panel *innolux;int err; desc =of_device_get_match_data (&dsi->dev);
@@ -495,7 +496,14 @@ static int innolux_panel_probe(struct mipi_dsi_device *dsi)if (err <0 )return err; -return mipi_dsi_attach (dsi); + err =mipi_dsi_attach (dsi); +if (err <0 ) { + innolux =mipi_dsi_get_drvdata (dsi); +innolux_panel_del (innolux); +return err; + } + +return 0 ; }static int innolux_panel_remove (struct mipi_dsi_device *dsi)
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 51/563 Bluetooth: cmtp: fix possible panic when cmtp_init_sockets() fails
In reply to Greg Kroah-HartmanFrom: Wang Hai <[email protected]>
[ Upstream commit 2a7ca7459d905febf519163bd9e3eed894de6bb7 ]
I got a kernel BUG report when doing fault injection test:
------------[ cut here ]------------ kernel BUG at lib/list_debug.c:45! ... RIP: 0010:__list_del_entry_valid.cold+0x12/0x4d ... Call Trace: proto_unregister+0x83/0x220 cmtp_cleanup_sockets+0x37/0x40 [cmtp] cmtp_exit+0xe/0x1f [cmtp] do_syscall_64+0x35/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae
If cmtp_init_sockets() in cmtp_init() fails, cmtp_init() still returns success. This will cause a kernel bug when accessing uncreated ctmp related data when the module exits.
--- net/bluetooth/cmtp/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
net/bluetooth/cmtp/core.c +1 -3
@@ -501,9 +501,7 @@ static int __init cmtp_init(void) {BT_INFO ("CMTP (CAPI Emulation) ver %s" ,VERSION ); -cmtp_init_sockets (); - -return 0 ; +return cmtp_init_sockets (); } static void __exit cmtp_exit(void)
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 58/563 wcn36xx: Release DMA channel descriptor allocations
In reply to Greg Kroah-HartmanFrom: Bryan O'Donoghue <[email protected]>
[ Upstream commit 3652096e5263ad67604b0323f71d133485f410e5 ]
When unloading the driver we are not releasing the DMA descriptors which we previously allocated.
--- drivers/net/wireless/ath/wcn36xx/dxe.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/wireless/ath/wcn36xx/dxe.c +5 -0
@@ -1014,4 +1014,9 @@ void wcn36xx_dxe_deinit(struct wcn36xx *wcn)wcn36xx_dxe_ch_free_skbs (wcn, &wcn->dxe_rx_l_ch);wcn36xx_dxe_ch_free_skbs (wcn, &wcn->dxe_rx_h_ch); + +wcn36xx_dxe_deinit_descs (wcn->dev, &wcn->dxe_tx_l_ch); +wcn36xx_dxe_deinit_descs (wcn->dev, &wcn->dxe_tx_h_ch); +wcn36xx_dxe_deinit_descs (wcn->dev, &wcn->dxe_rx_l_ch); +wcn36xx_dxe_deinit_descs (wcn->dev, &wcn->dxe_rx_h_ch); }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 12/563 mtd: rawnand: davinci: Avoid duplicated page read
In reply to Greg Kroah-HartmanFrom: Paul Cercueil <[email protected]>
commit 9c9d709965385de5a99f84b14bd5860e1541729e upstream.
The function nand_davinci_read_page_hwecc_oob_first() first reads the OOB data, extracts the ECC information, programs the ECC hardware before reading the actual data in a loop.
Right after the OOB data was read, it called nand_read_page_op() to reset the read cursor to the beginning of the page. This caused the first page to be read twice: in that call, and later in the loop.
Address that issue by changing the call to nand_read_page_op() to nand_change_read_column_op(), which will only reset the read cursor.
--- drivers/mtd/nand/raw/davinci_nand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/nand/raw/davinci_nand.c +2 -1
@@ -401,7 +401,8 @@ static int nand_davinci_read_page_hwecc_if (ret)return ret; - ret =nand_read_page_op (chip, page,0 ,NULL ,0 ); +/* Move read cursor to start of page */ + ret =nand_change_read_column_op (chip,0 ,NULL ,0 , false);if (ret)return ret;
Greg Kroah-Hartman
maintainerPATCH 63/563 mtd: hyperbus: rpc-if: Check return value of rpcif_sw_init()
In reply to Greg Kroah-HartmanFrom: Lad Prabhakar <[email protected]>
[ Upstream commit 981387ed06b96908223a607f5fba6efa42728fc2 ]
rpcif_sw_init() can fail so make sure we check the return value of it and on error exit rpcif_hb_probe() callback with error code.
--- drivers/mtd/hyperbus/rpc-if.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/hyperbus/rpc-if.c +3 -1
@@ -124,7 +124,9 @@ static int rpcif_hb_probe(struct platform_device *pdev)if (!hyperbus)return -ENOMEM ; -rpcif_sw_init (&hyperbus->rpc, pdev->dev.parent); + error =rpcif_sw_init (&hyperbus->rpc, pdev->dev.parent); +if (error) +return error;platform_set_drvdata (pdev, hyperbus);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 64/563 media: videobuf2: Fix the size printk format
In reply to Greg Kroah-HartmanFrom: Dillon Min <[email protected]>
[ Upstream commit c9ee220d76775e42f35d634479c978d9350077d3 ]
Since the type of parameter size is unsigned long, it should printk by %lu, instead of %ld, fix it.
--- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/common/videobuf2/videobuf2-dma-contig.c +4 -4
@@ -150,7 +150,7 @@ static void *vb2_dc_alloc(struct device *dev, unsigned long attrs, buf->cookie =dma_alloc_attrs (dev, size, &buf->dma_addr,GFP_KERNEL | gfp_flags, buf->attrs);if (!buf->cookie) { -dev_err (dev,"dma_alloc_coherent of size %ld failed\n" , size); +dev_err (dev,"dma_alloc_coherent of size %lu failed\n" , size);kfree (buf);return ERR_PTR (-ENOMEM ); }
@@ -196,9 +196,9 @@ static int vb2_dc_mmap(void *buf_priv, struct vm_area_struct *vma) vma->vm_ops->open (vma); -pr_debug ("%s: mapped dma addr 0x%08lx at 0x%08lx, size %ld\n" , - __func__, (unsigned long )buf->dma_addr, vma->vm_start, - buf->size); +pr_debug ("%s: mapped dma addr 0x%08lx at 0x%08lx, size %lu\n" , + __func__, (unsigned long )buf->dma_addr, vma->vm_start, + buf->size);return 0 ; }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 41/563 drm/ttm: Put BO in its memory managers lru list
In reply to Greg Kroah-HartmanFrom: xinhui pan <[email protected]>
commit 781050b0a3164934857c300bb0bc291e38c26b6f upstream.
After we move BO to a new memory region, we should put it to the new memory manager's lru list regardless we unlock the resv or not.
--- drivers/gpu/drm/ttm/ttm_bo.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/ttm/ttm_bo.c +2 -0
@@ -789,6 +789,8 @@ int ttm_mem_evict_first(struct ttm_bo_de ret =ttm_bo_evict (bo, ctx);if (locked)ttm_bo_unreserve (bo); +else +ttm_bo_move_to_lru_tail_unlocked (bo);ttm_bo_put (bo);return ret;
Greg Kroah-Hartman
maintainerPATCH 42/563 Bluetooth: L2CAP: Fix not initializing sk_peer_pid
In reply to Greg Kroah-HartmanFrom: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit f5ff291098f70a70b344df1e388596755c3c8315 ]
In order to group sockets being connected using L2CAP_MODE_EXT_FLOWCTL the pid is used but sk_peer_pid was not being initialized as it is currently only done for af_unix.
--- net/bluetooth/l2cap_sock.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
net/bluetooth/l2cap_sock.c +19 -0
@@ -172,6 +172,21 @@ done:return err; } +static void l2cap_sock_init_pid (struct sock *sk) +{ +struct l2cap_chan *chan =l2cap_pi (sk)->chan; + +/* Only L2CAP_MODE_EXT_FLOWCTL ever need to access the PID in order to +* group the channels being requested. +*/ +if (chan->mode !=L2CAP_MODE_EXT_FLOWCTL ) +return ; + +spin_lock (&sk->sk_peer_lock); + sk->sk_peer_pid =get_pid (task_tgid (current)); +spin_unlock (&sk->sk_peer_lock); +} +static int l2cap_sock_connect (struct socket *sock,struct sockaddr *addr,int alen,int flags) {
@@ -243,6 +258,8 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr,if (chan->psm &&bdaddr_type_is_le (chan->src_type) && !chan->mode) chan->mode =L2CAP_MODE_LE_FLOWCTL ; +l2cap_sock_init_pid (sk); + err =l2cap_chan_connect (chan, la.l2_psm,__le16_to_cpu (la.l2_cid), &la.l2_bdaddr, la.l2_bdaddr_type);if (err)
@@ -298,6 +315,8 @@ static int l2cap_sock_listen(struct socket *sock, int backlog) goto done; } +l2cap_sock_init_pid (sk); + sk->sk_max_ack_backlog = backlog; sk->sk_ack_backlog =0 ;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 92/563 arm64: dts: renesas: cat875: Add rx/tx delays
In reply to Greg Kroah-HartmanFrom: Biju Das <[email protected]>
[ Upstream commit e1a9faddffe7e555304dc2e3284c84fbee0679ee ]
The CAT875 sub board from Silicon Linux uses a Realtek PHY.
The phy driver commit bbc4d71d63549bcd003 ("net: phy: realtek: fix rtl8211e rx/tx delay config") introduced NFS mount failures. Now it needs both rx/tx delays for the NFS mount to work.
This patch fixes the NFS mount failure issue by adding "rgmii-id" mode to the avb device node.
--- arch/arm64/boot/dts/renesas/cat875.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/renesas/cat875.dtsi +1 -0
@@ -18,6 +18,7 @@ pinctrl-names = "default"; renesas,no-ether-link; phy-handle = <&phy0>; + phy-mode = "rgmii-id"; status = "okay"; phy0: ethernet-phy@0 {
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 101/563 crypto: qat - fix undetected PFVF timeout in ACK loop
In reply to Greg Kroah-HartmanFrom: Giovanni Cabiddu <[email protected]>
[ Upstream commit 5002200b4fedd7e90e4fbc2e5c42a4b3351df814 ]
If the remote function did not ACK the reception of a message, the function __adf_iov_putmsg() could detect it as a collision.
This was due to the fact that the collision and the timeout checks after the ACK loop were in the wrong order. The timeout must be checked at the end of the loop, so fix by swapping the order of the two checks.
--- drivers/crypto/qat/qat_common/adf_pf2vf_msg.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/crypto/qat/qat_common/adf_pf2vf_msg.c +6 -6
@@ -132,6 +132,12 @@ static int __adf_iov_putmsg(struct adf_accel_dev *accel_dev, u32 msg, u8 vf_nr) val =ADF_CSR_RD (pmisc_bar_addr, pf2vf_offset); }while ((val & int_bit) && (count++ <ADF_IOV_MSG_ACK_MAX_RETRY )); +if (val & int_bit) { +dev_dbg (&GET_DEV (accel_dev),"ACK not received from remote\n" ); + val &= ~int_bit; + ret = -EIO ; + } +if (val != msg) {dev_dbg (&GET_DEV (accel_dev),"Collision - PFVF CSR overwritten by remote function\n" );
@@ -139,12 +145,6 @@ static int __adf_iov_putmsg(struct adf_accel_dev *accel_dev, u32 msg, u8 vf_nr) goto out; } -if (val & int_bit) { -dev_dbg (&GET_DEV (accel_dev),"ACK not received from remote\n" ); - val &= ~int_bit; - ret = -EIO ; - } -/* Finished with the PFVF CSR; relinquish it and leave msg in CSR */ ADF_CSR_WR (pmisc_bar_addr, pf2vf_offset, val & ~local_in_use_mask); out:
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 102/563 ath11k: Use host CE parameters for CE interrupts configuration
In reply to Greg Kroah-HartmanFrom: Anilkumar Kolli <[email protected]>
[ Upstream commit b689f091aafd1a874b2f88137934276ab0fca480 ]
CE interrupt configuration uses host ce parameters to assign/free interrupts. Use host ce parameters to enable/disable interrupts. This patch fixes below BUG,
BUG: KASAN: global-out-of-bounds in 0xffffffbffdfb035c at addr ffffffbffde6eeac Read of size 4 by task kworker/u8:2/132 Address belongs to variable ath11k_core_qmi_firmware_ready+0x1b0/0x5bc [ath11k]
OOB is due to ath11k_ahb_ce_irqs_enable() iterates ce_count(which is 12) times and accessing 12th element in target_ce_config
(which has only 11 elements) from ath11k_ahb_ce_irq_enable().
With this change host ce configs are used to enable/disable interrupts.
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00471-QCAHKSWPL_SILICONZ-1
--- drivers/net/wireless/ath/ath11k/ahb.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/net/wireless/ath/ath11k/ahb.c +8 -8
@@ -206,13 +206,13 @@ static void ath11k_ahb_clearbit32(struct ath11k_base *ab, u8 bit, u32 offset)static void ath11k_ahb_ce_irq_enable (struct ath11k_base *ab,u16 ce_id) { -const struct ce_pipe_config *ce_config; +const struct ce_attr *ce_attr; - ce_config = &ab->hw_params.target_ce_config[ce_id]; -if (__le32_to_cpu (ce_config->pipedir) &PIPEDIR_OUT ) + ce_attr = &ab->hw_params.host_ce_config[ce_id]; +if (ce_attr->src_nentries)ath11k_ahb_setbit32 (ab, ce_id,CE_HOST_IE_ADDRESS ); -if (__le32_to_cpu (ce_config->pipedir) &PIPEDIR_IN ) { +if (ce_attr->dest_nentries) {ath11k_ahb_setbit32 (ab, ce_id,CE_HOST_IE_2_ADDRESS );ath11k_ahb_setbit32 (ab, ce_id +CE_HOST_IE_3_SHIFT ,CE_HOST_IE_3_ADDRESS );
@@ -221,13 +221,13 @@ static void ath11k_ahb_ce_irq_enable(struct ath11k_base *ab, u16 ce_id)static void ath11k_ahb_ce_irq_disable (struct ath11k_base *ab,u16 ce_id) { -const struct ce_pipe_config *ce_config; +const struct ce_attr *ce_attr; - ce_config = &ab->hw_params.target_ce_config[ce_id]; -if (__le32_to_cpu (ce_config->pipedir) &PIPEDIR_OUT ) + ce_attr = &ab->hw_params.host_ce_config[ce_id]; +if (ce_attr->src_nentries)ath11k_ahb_clearbit32 (ab, ce_id,CE_HOST_IE_ADDRESS ); -if (__le32_to_cpu (ce_config->pipedir) &PIPEDIR_IN ) { +if (ce_attr->dest_nentries) {ath11k_ahb_clearbit32 (ab, ce_id,CE_HOST_IE_2_ADDRESS );ath11k_ahb_clearbit32 (ab, ce_id +CE_HOST_IE_3_SHIFT ,CE_HOST_IE_3_ADDRESS );
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 76/563 media: em28xx: fix memory leak in em28xx_init_dev
In reply to Greg Kroah-HartmanFrom: Dongliang Mu <[email protected]>
[ Upstream commit 22be5a10d0b24eec9e45decd15d7e6112b25f080 ]
In the em28xx_init_rev, if em28xx_audio_setup fails, this function fails to deallocate the media_dev allocated in the em28xx_media_device_init.
Fix this by adding em28xx_unregister_media_device to free media_dev.
BTW, this patch is tested in my local syzkaller instance, and it can prevent the memory leak from occurring again.
--- drivers/media/usb/em28xx/em28xx-cards.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/media/usb/em28xx/em28xx-cards.c +12 -6
@@ -3575,8 +3575,10 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,if (dev->is_audio_only) { retval =em28xx_audio_setup (dev); -if (retval) -return -ENODEV ; +if (retval) { + retval = -ENODEV ; + goto err_deinit_media; + }em28xx_init_extension (dev);return 0 ;
@@ -3595,7 +3597,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,dev_err (&dev->intf->dev,"%s: em28xx_i2c_register bus 0 - error [%d]!\n" , __func__, retval); -return retval; + goto err_deinit_media; }/* register i2c bus 1 */
@@ -3611,9 +3613,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,"%s: em28xx_i2c_register bus 1 - error [%d]!\n" , __func__, retval); -em28xx_i2c_unregister (dev,0 ); - -return retval; + goto err_unreg_i2c; } }
@@ -3621,6 +3621,12 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,em28xx_card_setup (dev);return 0 ; + +err_unreg_i2c: +em28xx_i2c_unregister (dev,0 ); +err_deinit_media: +em28xx_unregister_media_device (dev); +return retval; }static int em28xx_duplicate_dev (struct em28xx *dev)
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 77/563 media: aspeed: Update signal status immediately to ensure sane hw state
In reply to Greg Kroah-HartmanFrom: Jammy Huang <[email protected]>
[ Upstream commit af6d1bde395cac174ee71adcd3fa43f6435c7206 ]
If res-chg, VE_INTERRUPT_MODE_DETECT_WD irq will be raised. But v4l2_input_status won't be updated to no-signal immediately until aspeed_video_get_resolution() in aspeed_video_resolution_work().
During the period of time, aspeed_video_start_frame() could be called because it doesn't know signal becomes unstable now. If it goes with aspeed_video_init_regs() of aspeed_video_irq_res_change() simultaneously, it will mess up hw state.
To fix this problem, v4l2_input_status is updated to no-signal immediately for VE_INTERRUPT_MODE_DETECT_WD irq.
--- drivers/media/platform/aspeed-video.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/platform/aspeed-video.c +3 -3
@@ -556,6 +556,8 @@ static void aspeed_video_irq_res_change(struct aspeed_video *video, ulong delay)set_bit (VIDEO_RES_CHANGE , &video->flags);clear_bit (VIDEO_FRAME_INPRG , &video->flags); + video->v4l2_input_status =V4L2_IN_ST_NO_SIGNAL ; +aspeed_video_off (video);aspeed_video_bufs_done (video,VB2_BUF_STATE_ERROR );
@@ -1337,7 +1339,6 @@ static void aspeed_video_resolution_work(struct work_struct *work)struct delayed_work *dwork =to_delayed_work (work); struct aspeed_video *video = container_of(dwork, struct aspeed_video, res_work); -u32 input_status = video->v4l2_input_status;aspeed_video_on (video);
@@ -1350,8 +1351,7 @@ static void aspeed_video_resolution_work(struct work_struct *work)aspeed_video_get_resolution (video);if (video->detected_timings.width != video->active_timings.width || - video->detected_timings.height != video->active_timings.height || - input_status != video->v4l2_input_status) { + video->detected_timings.height != video->active_timings.height) {static const struct v4l2_event ev = { .type =V4L2_EVENT_SOURCE_CHANGE , .u.src_change.changes =V4L2_EVENT_SRC_CH_RESOLUTION ,
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 74/563 media: atomisp: fix uninitialized bug in gmin_get_pmic_id_and_addr()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit cb4d67a998e97365afdf34965b069601da1dae60 ]
The "power" pointer is not initialized on the else path and that would lead to an Oops.
--- drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +1 -1
@@ -481,7 +481,7 @@ fail:static u8 gmin_get_pmic_id_and_addr (struct device *dev) { -struct i2c_client *power; +struct i2c_client *power =NULL ;static u8 pmic_i2c_addr;if (pmic_id)
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 113/563 media: venus: pm_helpers: Control core power domain manually
In reply to Greg Kroah-HartmanFrom: Stanimir Varbanov <[email protected]>
[ Upstream commit a76f43a490542ecb8c57176730b6eb665d716139 ]
Presently we use device_link to control core power domain. But this leads to issues because the genpd doesn't guarantee synchronous on/off for supplier devices. Switch to manually control by pmruntime calls.
--- drivers/media/platform/qcom/venus/core.h | 2 -- .../media/platform/qcom/venus/pm_helpers.c | 36 ++++++++++--------- 2 files changed, 19 insertions(+), 19 deletions(-)
drivers/media/platform/qcom/venus/core.h +0 -2
@@ -123,7 +123,6 @@ struct venus_caps {* @clks: an array of struct clk pointers * @vcodec0_clks: an array of vcodec0 struct clk pointers * @vcodec1_clks: an array of vcodec1 struct clk pointers -* @pd_dl_venus: pmdomain device-link for venus domain * @pmdomains: an array of pmdomains struct device pointers * @vdev_dec: a reference to video device structure for decoder instances * @vdev_enc: a reference to video device structure for encoder instances
@@ -161,7 +160,6 @@ struct venus_core {struct icc_path *cpucfg_path;struct opp_table *opp_table;bool has_opp_table; -struct device_link *pd_dl_venus;struct device *pmdomains[VIDC_PMDOMAINS_NUM_MAX ];struct device_link *opp_dl_venus;struct device *opp_pmdomain;
drivers/media/platform/qcom/venus/pm_helpers.c +19 -17
@@ -773,13 +773,6 @@ static int vcodec_domains_get(struct device *dev) core->pmdomains[i] = pd; } - core->pd_dl_venus =device_link_add (dev, core->pmdomains[0 ], -DL_FLAG_PM_RUNTIME | -DL_FLAG_STATELESS | -DL_FLAG_RPM_ACTIVE ); -if (!core->pd_dl_venus) -return -ENODEV ; - skip_pmdomains:if (!core->has_opp_table)return 0 ;
@@ -806,14 +799,12 @@ skip_pmdomains: opp_dl_add_err:dev_pm_opp_detach_genpd (core->opp_table); opp_attach_err: -if (core->pd_dl_venus) { -device_link_del (core->pd_dl_venus); -for (i =0 ; i < res->vcodec_pmdomains_num; i++) { -if (IS_ERR_OR_NULL (core->pmdomains[i])) -continue ; -dev_pm_domain_detach (core->pmdomains[i], true); - } +for (i =0 ; i < res->vcodec_pmdomains_num; i++) { +if (IS_ERR_OR_NULL (core->pmdomains[i])) +continue ; +dev_pm_domain_detach (core->pmdomains[i], true); } +return ret; }
@@ -826,9 +817,6 @@ static void vcodec_domains_put(struct device *dev)if (!res->vcodec_pmdomains_num) goto skip_pmdomains; -if (core->pd_dl_venus) -device_link_del (core->pd_dl_venus); -for (i =0 ; i < res->vcodec_pmdomains_num; i++) {if (IS_ERR_OR_NULL (core->pmdomains[i]))continue ;
@@ -916,16 +904,30 @@ static void core_put_v4(struct device *dev)static int core_power_v4 (struct device *dev,int on) {struct venus_core *core =dev_get_drvdata (dev); +struct device *pmctrl = core->pmdomains[0 ];int ret =0 ;if (on ==POWER_ON ) { +if (pmctrl) { + ret =pm_runtime_get_sync (pmctrl); +if (ret <0 ) { +pm_runtime_put_noidle (pmctrl); +return ret; + } + } + ret =core_clks_enable (core); +if (ret <0 && pmctrl) +pm_runtime_put_sync (pmctrl); }else {/* Drop the performance state vote */ if (core->opp_pmdomain)dev_pm_opp_set_rate (dev,0 );core_clks_disable (core); + +if (pmctrl) +pm_runtime_put_sync (pmctrl); }return ret;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 114/563 media: venus: core, venc, vdec: Fix probe dependency error
In reply to Greg Kroah-HartmanFrom: Bryan O'Donoghue <[email protected]>
[ Upstream commit 08b1cf474b7f72750adebe0f0a35f8e9a3eb75f6 ]
Commit aaaa93eda64b ("media] media: venus: venc: add video encoder files") is the last in a series of three commits to add core.c vdec.c and venc.c adding core, encoder and decoder.
The encoder and decoder check for core drvdata as set and return -EPROBE_DEFER if it has not been set, however both the encoder and decoder rely on core.v4l2_dev as valid.
core.v4l2_dev will not be valid until v4l2_device_register() has completed in core.c's probe().
Normally this is never seen however, Dmitry reported the following backtrace when compiling drivers and firmware directly into a kernel image.
[ 5.259968] Hardware name: Qualcomm Technologies, Inc. Robotics RB5 (DT) [ 5.269850] sd 0:0:0:3: [sdd] Optimal transfer size 524288 bytes [ 5.275505] Workqueue: events deferred_probe_work_func [ 5.275513] pstate: 60400005 (nZCv daif +PAN -UAO -TCO BTYPE=--) [ 5.441211] usb 2-1: new SuperSpeedPlus Gen 2 USB device number 2 using xhci-hcd [ 5.442486] pc : refcount_warn_saturate+0x140/0x148 [ 5.493756] hub 2-1:1.0: USB hub found [ 5.496266] lr : refcount_warn_saturate+0x140/0x148 [ 5.500982] hub 2-1:1.0: 4 ports detected [ 5.503440] sp : ffff80001067b730 [ 5.503442] x29: ffff80001067b730 [ 5.592660] usb 1-1: new high-speed USB device number 2 using xhci-hcd [ 5.598478] x28: ffff6c6bc1c379b8 [ 5.598480] x27: ffffa5c673852960 x26: ffffa5c673852000 [ 5.598484] x25: ffff6c6bc1c37800 x24: 0000000000000001 [ 5.810652] x23: 0000000000000000 x22: ffffa5c673bc7118 [ 5.813777] hub 1-1:1.0: USB hub found [ 5.816108] x21: ffffa5c674440000 x20: 0000000000000001 [ 5.820846] hub 1-1:1.0: 4 ports detected [ 5.825415] x19: ffffa5c6744f4000 x18: ffffffffffffffff [ 5.825418] x17: 0000000000000000 x16: 0000000000000000 [ 5.825421] x15: 00000a4810c193ba x14: 0000000000000000 [ 5.825424] x13: 00000000000002b8 x12: 000000000000f20a [ 5.825427] x11: 000000000000f20a x10: 0000000000000038 [ 5.845447] usb 2-1.1: new SuperSpeed Gen 1 USB device number 3 using xhci-hcd [ 5.845904] [ 5.845905] x9 : 0000000000000000 x8 : ffff6c6d36fae780 [ 5.871208] x7 : ffff6c6d36faf240 x6 : 0000000000000000 [ 5.876664] x5 : 0000000000000004 x4 : 0000000000000085 [ 5.882121] x3 : 0000000000000119 x2 : ffffa5c6741ef478 [ 5.887578] x1 : 3acbb3926faf5f00 x0 : 0000000000000000 [ 5.893036] Call trace: [ 5.895551] refcount_warn_saturate+0x140/0x148 [ 5.900202] __video_register_device+0x64c/0xd10 [ 5.904944] venc_probe+0xc4/0x148 [ 5.908444] platform_probe+0x68/0xe0 [ 5.912210] really_probe+0x118/0x3e0 [ 5.915977] driver_probe_device+0x5c/0xc0 [ 5.920187] __device_attach_driver+0x98/0xb8 [ 5.924661] bus_for_each_drv+0x68/0xd0 [ 5.928604] __device_attach+0xec/0x148 [ 5.932547] device_initial_probe+0x14/0x20 [ 5.936845] bus_probe_device+0x9c/0xa8 [ 5.940788] device_add+0x3e8/0x7c8 [ 5.944376] of_device_add+0x4c/0x60 [ 5.948056] of_platform_device_create_pdata+0xbc/0x140 [ 5.953425] of_platform_bus_create+0x17c/0x3c0 [ 5.958078] of_platform_populate+0x80/0x110 [ 5.962463] venus_probe+0x2ec/0x4d8 [ 5.966143] platform_probe+0x68/0xe0 [ 5.969907] really_probe+0x118/0x3e0 [ 5.973674] driver_probe_device+0x5c/0xc0 [ 5.977882] __device_attach_driver+0x98/0xb8 [ 5.982356] bus_for_each_drv+0x68/0xd0 [ 5.986298] __device_attach+0xec/0x148 [ 5.990242] device_initial_probe+0x14/0x20 [ 5.994539] bus_probe_device+0x9c/0xa8 [ 5.998481] deferred_probe_work_func+0x74/0xb0 [ 6.003132] process_one_work+0x1e8/0x360 [ 6.007254] worker_thread+0x208/0x478 [ 6.011106] kthread+0x150/0x158 [ 6.014431] ret_from_fork+0x10/0x30 [ 6.018111] ---[ end trace f074246b1ecdb466 ]---
This patch fixes by
- Only setting drvdata after v4l2_device_register() completes
- Moving v4l2_device_register() so that suspend/reume in core::probe() stays as-is
- Changes pm_ops->core_function() to take struct venus_core not struct device
- Minimal rework of v4l2_device_*register in probe/remove
--- drivers/media/platform/qcom/venus/core.c | 30 +++++++++++-------- .../media/platform/qcom/venus/pm_helpers.c | 30 ++++++++----------- .../media/platform/qcom/venus/pm_helpers.h | 7 +++-- 3 files changed, 34 insertions(+), 33 deletions(-)
drivers/media/platform/qcom/venus/core.c +17 -13
@@ -222,7 +222,6 @@ static int venus_probe(struct platform_device *pdev)return -ENOMEM ; core->dev = dev; -platform_set_drvdata (pdev, core); r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); core->base =devm_ioremap_resource (dev, r);
@@ -252,7 +251,7 @@ static int venus_probe(struct platform_device *pdev)return -ENODEV ;if (core->pm_ops->core_get) { - ret = core->pm_ops->core_get (dev); + ret = core->pm_ops->core_get (core);if (ret)return ret; }
@@ -277,6 +276,12 @@ static int venus_probe(struct platform_device *pdev)if (ret) goto err_core_put; + ret =v4l2_device_register (dev, &core->v4l2_dev); +if (ret) + goto err_core_deinit; + +platform_set_drvdata (pdev, core); +pm_runtime_enable (dev); ret =pm_runtime_get_sync (dev);
@@ -311,10 +316,6 @@ static int venus_probe(struct platform_device *pdev)if (ret) goto err_venus_shutdown; - ret =v4l2_device_register (dev, &core->v4l2_dev); -if (ret) - goto err_core_deinit; - ret =pm_runtime_put_sync (dev);if (ret) {pm_runtime_get_noresume (dev);
@@ -327,8 +328,6 @@ static int venus_probe(struct platform_device *pdev) err_dev_unregister:v4l2_device_unregister (&core->v4l2_dev); -err_core_deinit: -hfi_core_deinit (core, false); err_venus_shutdown:venus_shutdown (core); err_runtime_disable:
@@ -336,9 +335,11 @@ err_runtime_disable:pm_runtime_set_suspended (dev);pm_runtime_disable (dev);hfi_destroy (core); +err_core_deinit: +hfi_core_deinit (core, false); err_core_put:if (core->pm_ops->core_put) - core->pm_ops->core_put (dev); + core->pm_ops->core_put (core);return ret; }
@@ -364,11 +365,14 @@ static int venus_remove(struct platform_device *pdev)pm_runtime_disable (dev);if (pm_ops->core_put) - pm_ops->core_put (dev); + pm_ops->core_put (core); + +v4l2_device_unregister (&core->v4l2_dev);hfi_destroy (core);v4l2_device_unregister (&core->v4l2_dev); +mutex_destroy (&core->pm_lock);mutex_destroy (&core->lock);venus_dbgfs_deinit (core);
@@ -387,7 +391,7 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev)return ret;if (pm_ops->core_power) { - ret = pm_ops->core_power (dev,POWER_OFF ); + ret = pm_ops->core_power (core,POWER_OFF );if (ret)return ret; }
@@ -405,7 +409,7 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev) err_video_path:icc_set_bw (core->cpucfg_path,kbps_to_icc (1000 ),0 ); err_cpucfg_path: - pm_ops->core_power (dev,POWER_ON ); + pm_ops->core_power (core,POWER_ON );return ret; }
@@ -425,7 +429,7 @@ static __maybe_unused int venus_runtime_resume(struct device *dev)return ret;if (pm_ops->core_power) { - ret = pm_ops->core_power (dev,POWER_ON ); + ret = pm_ops->core_power (core,POWER_ON );if (ret)return ret; }
drivers/media/platform/qcom/venus/pm_helpers.c +13 -17
@@ -276,16 +276,13 @@ set_freq:return 0 ; } -static int core_get_v1 (struct device *dev) +static int core_get_v1 (struct venus_core *core) { -struct venus_core *core =dev_get_drvdata (dev); -return core_clks_get (core); } -static int core_power_v1 (struct device *dev,int on) +static int core_power_v1 (struct venus_core *core,int on) { -struct venus_core *core =dev_get_drvdata (dev);int ret =0 ;if (on ==POWER_ON )
@@ -752,12 +749,12 @@ static int venc_power_v4(struct device *dev, int on)return ret; } -static int vcodec_domains_get (struct device *dev) +static int vcodec_domains_get (struct venus_core *core) {int ret;struct opp_table *opp_table;struct device **opp_virt_dev; -struct venus_core *core =dev_get_drvdata (dev); +struct device *dev = core->dev;const struct venus_resources *res = core->res;struct device *pd;unsigned int i;
@@ -808,9 +805,8 @@ opp_attach_err:return ret; } -static void vcodec_domains_put (struct device *dev) +static void vcodec_domains_put (struct venus_core *core) { -struct venus_core *core =dev_get_drvdata (dev);const struct venus_resources *res = core->res;unsigned int i;
@@ -833,9 +829,9 @@ skip_pmdomains:dev_pm_opp_detach_genpd (core->opp_table); } -static int core_get_v4 (struct device *dev) +static int core_get_v4 (struct venus_core *core) { -struct venus_core *core =dev_get_drvdata (dev); +struct device *dev = core->dev;const struct venus_resources *res = core->res;int ret;
@@ -874,7 +870,7 @@ static int core_get_v4(struct device *dev) } } - ret =vcodec_domains_get (dev); + ret =vcodec_domains_get (core);if (ret) {if (core->has_opp_table)dev_pm_opp_of_remove_table (dev);
@@ -885,14 +881,14 @@ static int core_get_v4(struct device *dev)return 0 ; } -static void core_put_v4 (struct device *dev) +static void core_put_v4 (struct venus_core *core) { -struct venus_core *core =dev_get_drvdata (dev); +struct device *dev = core->dev;if (legacy_binding)return ; -vcodec_domains_put (dev); +vcodec_domains_put (core);if (core->has_opp_table)dev_pm_opp_of_remove_table (dev);
@@ -901,9 +897,9 @@ static void core_put_v4(struct device *dev) } -static int core_power_v4 (struct device *dev,int on) +static int core_power_v4 (struct venus_core *core,int on) { -struct venus_core *core =dev_get_drvdata (dev); +struct device *dev = core->dev;struct device *pmctrl = core->pmdomains[0 ];int ret =0 ;
drivers/media/platform/qcom/venus/pm_helpers.h +4 -3
@@ -4,14 +4,15 @@#define __VENUS_PM_HELPERS_H__struct device ; +struct venus_core ;#define POWER_ON 1#define POWER_OFF 0struct venus_pm_ops { -int (*core_get)(struct device *dev); -void (*core_put)(struct device *dev); -int (*core_power)(struct device *dev,int on); +int (*core_get)(struct venus_core *core); +void (*core_put)(struct venus_core *core); +int (*core_power)(struct venus_core *core,int on);int (*vdec_get)(struct device *dev);void (*vdec_put)(struct device *dev);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 73/563 media: atomisp: fix enum formats logic
In reply to Greg Kroah-HartmanFrom: Mauro Carvalho Chehab <[email protected]>
[ Upstream commit fae46cb0531b45c789e39128f676f2bafa3a7b47 ]
Changeset 374d62e7aa50 ("media: v4l2-subdev: Verify v4l2_subdev_call() pad config argument") added an extra verification for a pads parameter for enum mbus
format code.
Such change broke atomisp, because now the V4L2 core refuses to enum MBUS formats if the state is empty.
So, add .which field in order to select the active formats, in order to make it work again.
While here, improve error messages.
--- .../staging/media/atomisp/pci/atomisp_ioctl.c | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-)
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +17 -6
@@ -773,7 +773,10 @@ static int atomisp_enum_fmt_cap(struct file *file, void *fh,struct video_device *vdev =video_devdata (file);struct atomisp_device *isp =video_get_drvdata (vdev);struct atomisp_sub_device *asd =atomisp_to_video_pipe (vdev)->asd; -struct v4l2_subdev_mbus_code_enum code = {0 }; +struct v4l2_subdev_mbus_code_enum code = { + .which =V4L2_SUBDEV_FORMAT_ACTIVE , + }; +struct v4l2_subdev *camera;unsigned int i, fi =0 ;int rval;
@@ -783,14 +786,20 @@ static int atomisp_enum_fmt_cap(struct file *file, void *fh,return -EINVAL ; } + camera = isp->inputs[asd->input_curr].camera; +if (!camera) { +dev_err (isp->dev,"%s(): camera is NULL, device is %s\n" , + __func__, vdev->name); +return -EINVAL ; + } +rt_mutex_lock (&isp->mutex); - rval =v4l2_subdev_call (isp->inputs[asd->input_curr].camera, pad, - enum_mbus_code,NULL , &code); + + rval =v4l2_subdev_call (camera, pad, enum_mbus_code,NULL , &code);if (rval == -ENOIOCTLCMD ) {dev_warn (isp->dev, -"enum_mbus_code pad op not supported. Please fix your sensor driver!\n" ); -// rval = v4l2_subdev_call(isp->inputs[asd->input_curr].camera, -// video, enum_mbus_fmt, 0, &code.code); +"enum_mbus_code pad op not supported by %s. Please fix your sensor driver!\n" , + camera->name); }rt_mutex_unlock (&isp->mutex);
@@ -820,6 +829,8 @@ static int atomisp_enum_fmt_cap(struct file *file, void *fh, f->pixelformat = format->pixelformat;return 0 ; } +dev_err (isp->dev,"%s(): format for code %x not found.\n" , + __func__, code.code);return -EINVAL ; }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 117/563 thermal/drivers/imx: Implement runtime PM support
In reply to Greg Kroah-HartmanFrom: Oleksij Rempel <[email protected]>
[ Upstream commit 4cf2ddf16e175ee18c5c29865c32da7d6269cf44 ]
Starting with commit d92ed2c9d3ff ("thermal: imx: Use driver's local data to decide whether to run a measurement") this driver stared using irq_enabled flag to make decision to power on/off the thermal core. This triggered a regression, where after reaching critical temperature, alarm IRQ handler set irq_enabled to false, disabled thermal core and was not able read temperature and disable cooling sequence.
In case the cooling device is "CPU/GPU freq", the system will run with reduce performance until next reboot.
To solve this issue, we need to move all parts implementing hand made runtime power management and let it handle actual runtime PM framework.
--- drivers/thermal/imx_thermal.c | 145 +++++++++++++++++++++------------- 1 file changed, 91 insertions(+), 54 deletions(-)
drivers/thermal/imx_thermal.c +91 -54
@@ -15,6 +15,7 @@#include <linux/regmap.h> #include <linux/thermal.h> #include <linux/nvmem-consumer.h> +#include <linux/pm_runtime.h> #define REG_SET 0x4#define REG_CLR 0x8
@@ -194,6 +195,7 @@ static struct thermal_soc_data thermal_imx7d_data = { };struct imx_thermal_data { +struct device *dev;struct cpufreq_policy *policy;struct thermal_zone_device *tz;struct thermal_cooling_device *cdev;
@@ -252,44 +254,15 @@ static int imx_get_temp(struct thermal_zone_device *tz, int *temp)const struct thermal_soc_data *soc_data = data->socdata;struct regmap *map = data->tempmon;unsigned int n_meas; -bool wait, run_measurement;u32 val; +int ret; - run_measurement = !data->irq_enabled; -if (!run_measurement) { -/* Check if a measurement is currently in progress */ -regmap_read (map, soc_data->temp_data, &val); - wait = !(val & soc_data->temp_valid_mask); - }else { -/* -* Every time we measure the temperature, we will power on the -* temperature sensor, enable measurements, take a reading, -* disable measurements, power off the temperature sensor. -*/ -regmap_write (map, soc_data->sensor_ctrl +REG_CLR , - soc_data->power_down_mask); -regmap_write (map, soc_data->sensor_ctrl +REG_SET , - soc_data->measure_temp_mask); - - wait = true; - } - -/* -* According to the temp sensor designers, it may require up to ~17us -* to complete a measurement. -*/ -if (wait) -usleep_range (20 ,50 ); + ret =pm_runtime_resume_and_get (data->dev); +if (ret <0 ) +return ret;regmap_read (map, soc_data->temp_data, &val); -if (run_measurement) { -regmap_write (map, soc_data->sensor_ctrl +REG_CLR , - soc_data->measure_temp_mask); -regmap_write (map, soc_data->sensor_ctrl +REG_SET , - soc_data->power_down_mask); - } -if ((val & soc_data->temp_valid_mask) ==0 ) {dev_dbg (&tz->device,"temp measurement never finished\n" );return -EAGAIN ;
@@ -328,6 +301,8 @@ static int imx_get_temp(struct thermal_zone_device *tz, int *temp)enable_irq (data->irq); } +pm_runtime_put (data->dev); +return 0 ; }
@@ -335,24 +310,16 @@ static int imx_change_mode(struct thermal_zone_device *tz, enum thermal_device_mode mode) {struct imx_thermal_data *data = tz->devdata; -struct regmap *map = data->tempmon; -const struct thermal_soc_data *soc_data = data->socdata;if (mode ==THERMAL_DEVICE_ENABLED ) { -regmap_write (map, soc_data->sensor_ctrl +REG_CLR , - soc_data->power_down_mask); -regmap_write (map, soc_data->sensor_ctrl +REG_SET , - soc_data->measure_temp_mask); +pm_runtime_get (data->dev);if (!data->irq_enabled) { data->irq_enabled = true;enable_irq (data->irq); } }else { -regmap_write (map, soc_data->sensor_ctrl +REG_CLR , - soc_data->measure_temp_mask); -regmap_write (map, soc_data->sensor_ctrl +REG_SET , - soc_data->power_down_mask); +pm_runtime_put (data->dev);if (data->irq_enabled) {disable_irq (data->irq);
@@ -393,6 +360,11 @@ static int imx_set_trip_temp(struct thermal_zone_device *tz, int trip, int temp) {struct imx_thermal_data *data = tz->devdata; +int ret; + + ret =pm_runtime_resume_and_get (data->dev); +if (ret <0 ) +return ret;/* do not allow changing critical threshold */ if (trip ==IMX_TRIP_CRITICAL )
@@ -406,6 +378,8 @@ static int imx_set_trip_temp(struct thermal_zone_device *tz, int trip,imx_set_alarm_temp (data, temp); +pm_runtime_put (data->dev); +return 0 ; }
@@ -681,6 +655,8 @@ static int imx_thermal_probe(struct platform_device *pdev)if (!data)return -ENOMEM ; + data->dev = &pdev->dev; + map =syscon_regmap_lookup_by_phandle (pdev->dev.of_node,"fsl,tempmon" );if (IS_ERR (map)) { ret =PTR_ERR (map);
@@ -800,6 +776,16 @@ static int imx_thermal_probe(struct platform_device *pdev) data->socdata->power_down_mask);regmap_write (map, data->socdata->sensor_ctrl +REG_SET , data->socdata->measure_temp_mask); +/* After power up, we need a delay before first access can be done. */ +usleep_range (20 ,50 ); + +/* the core was configured and enabled just before */ +pm_runtime_set_active (&pdev->dev); +pm_runtime_enable (data->dev); + + ret =pm_runtime_resume_and_get (data->dev); +if (ret <0 ) + goto disable_runtime_pm; data->irq_enabled = true; ret =thermal_zone_device_enable (data->tz);
@@ -814,10 +800,15 @@ static int imx_thermal_probe(struct platform_device *pdev) goto thermal_zone_unregister; } +pm_runtime_put (data->dev); +return 0 ; thermal_zone_unregister:thermal_zone_device_unregister (data->tz); +disable_runtime_pm: +pm_runtime_put_noidle (data->dev); +pm_runtime_disable (data->dev); clk_disable:clk_disable_unprepare (data->thermal_clk); legacy_cleanup:
@@ -829,13 +820,9 @@ legacy_cleanup:static int imx_thermal_remove (struct platform_device *pdev) {struct imx_thermal_data *data =platform_get_drvdata (pdev); -struct regmap *map = data->tempmon; -/* Disable measurements */ -regmap_write (map, data->socdata->sensor_ctrl +REG_SET , - data->socdata->power_down_mask); -if (!IS_ERR (data->thermal_clk)) -clk_disable_unprepare (data->thermal_clk); +pm_runtime_put_noidle (data->dev); +pm_runtime_disable (data->dev);thermal_zone_device_unregister (data->tz);imx_thermal_unregister_legacy_cooling (data);
@@ -858,29 +845,79 @@ static int __maybe_unused imx_thermal_suspend(struct device *dev) ret =thermal_zone_device_disable (data->tz);if (ret)return ret; + +return pm_runtime_force_suspend (data->dev); +} + +static int __maybe_unused imx_thermal_resume (struct device *dev) +{ +struct imx_thermal_data *data =dev_get_drvdata (dev); +int ret; + + ret =pm_runtime_force_resume (data->dev); +if (ret) +return ret; +/* Enabled thermal sensor after resume */ +return thermal_zone_device_enable (data->tz); +} + +static int __maybe_unused imx_thermal_runtime_suspend (struct device *dev) +{ +struct imx_thermal_data *data =dev_get_drvdata (dev); +const struct thermal_soc_data *socdata = data->socdata; +struct regmap *map = data->tempmon; +int ret; + + ret =regmap_write (map, socdata->sensor_ctrl +REG_CLR , + socdata->measure_temp_mask); +if (ret) +return ret; + + ret =regmap_write (map, socdata->sensor_ctrl +REG_SET , + socdata->power_down_mask); +if (ret) +return ret; +clk_disable_unprepare (data->thermal_clk);return 0 ; } -static int __maybe_unused imx_thermal_resume (struct device *dev) +static int __maybe_unused imx_thermal_runtime_resume (struct device *dev) {struct imx_thermal_data *data =dev_get_drvdata (dev); +const struct thermal_soc_data *socdata = data->socdata; +struct regmap *map = data->tempmon;int ret; ret =clk_prepare_enable (data->thermal_clk);if (ret)return ret; -/* Enabled thermal sensor after resume */ - ret =thermal_zone_device_enable (data->tz); + + ret =regmap_write (map, socdata->sensor_ctrl +REG_CLR , + socdata->power_down_mask); +if (ret) +return ret; + + ret =regmap_write (map, socdata->sensor_ctrl +REG_SET , + socdata->measure_temp_mask);if (ret)return ret; +/* +* According to the temp sensor designers, it may require up to ~17us +* to complete a measurement. +*/ +usleep_range (20 ,50 ); +return 0 ; } -static SIMPLE_DEV_PM_OPS(imx_thermal_pm_ops, - imx_thermal_suspend, imx_thermal_resume); +static const struct dev_pm_ops imx_thermal_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(imx_thermal_suspend, imx_thermal_resume) +SET_RUNTIME_PM_OPS (imx_thermal_runtime_suspend, + imx_thermal_runtime_resume,NULL ) +};static struct platform_driver imx_thermal = { .driver = {
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 122/563 thermal/drivers/imx8mm: Enable ADC when enabling monitor
In reply to Greg Kroah-HartmanFrom: Paul Gerber <[email protected]>
[ Upstream commit 3de89d8842a2b5d3dd22ebf97dd561ae0a330948 ]
The i.MX 8MP has a ADC_PD bit in the TMU_TER register that controls the operating mode of the ADC:
* 0 means normal operating mode
* 1 means power down mode
When enabling/disabling the TMU, the ADC operating mode must be set accordingly.
i.MX 8M Mini & Nano are lacking this bit.
--- drivers/thermal/imx8mm_thermal.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/thermal/imx8mm_thermal.c +3 -0
@@ -21,6 +21,7 @@#define TPS 0x4#define TRITSR 0x20/* TMU immediate temp */ +#define TER_ADC_PD BIT(30)#define TER_EN BIT(31)#define TRITSR_TEMP0_VAL_MASK 0xff#define TRITSR_TEMP1_VAL_MASK 0xff0000
@@ -113,6 +114,8 @@ static void imx8mm_tmu_enable(struct imx8mm_tmu *tmu, bool enable) val =readl_relaxed (tmu->base +TER ); val = enable ? (val |TER_EN ) : (val & ~TER_EN ); +if (tmu->socdata->version ==TMU_VER2 ) + val = enable ? (val & ~TER_ADC_PD ) : (val |TER_ADC_PD );writel_relaxed (val, tmu->base +TER ); }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 123/563 drm/amdgpu: Fix a NULL pointer dereference in amdgpu_connector_lcd_native_mode()
In reply to Greg Kroah-HartmanFrom: Zhou Qingyang <[email protected]>
[ Upstream commit b220110e4cd442156f36e1d9b4914bb9e87b0d00 ]
In amdgpu_connector_lcd_native_mode(), the return value of drm_mode_duplicate() is assigned to mode, and there is a dereference of it in amdgpu_connector_lcd_native_mode(), which will lead to a NULL pointer dereference on failure of drm_mode_duplicate().
Fix this bug add a check of mode.
This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs.
Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug.
Builds with CONFIG_DRM_AMDGPU=m show no new warnings, and our static analyzer no longer warns about this code.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +6 -0
@@ -387,6 +387,9 @@ amdgpu_connector_lcd_native_mode(struct drm_encoder *encoder) native_mode->vdisplay != 0 && native_mode->clock != 0) { mode =drm_mode_duplicate (dev, native_mode); +if (!mode) +return NULL ; + mode->type =DRM_MODE_TYPE_PREFERRED |DRM_MODE_TYPE_DRIVER ;drm_mode_set_name (mode);
@@ -401,6 +404,9 @@ amdgpu_connector_lcd_native_mode(struct drm_encoder *encoder)* simpler. */ mode =drm_cvt_mode (dev, native_mode->hdisplay, native_mode->vdisplay,60 , true, false, false); +if (!mode) +return NULL ; + mode->type =DRM_MODE_TYPE_PREFERRED |DRM_MODE_TYPE_DRIVER ;DRM_DEBUG_KMS ("Adding cvt approximation of native panel mode %s\n" , mode->name); }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 126/563 arm64: dts: ti: k3-j721e: Fix the L2 cache sets
In reply to Greg Kroah-HartmanFrom: Nishanth Menon <[email protected]>
[ Upstream commit e9ba3a5bc6fdc2c796c69fdaf5ed6c9957cf9f9d ]
A72's L2 cache[1] on J721e[2] is 1MB. A72's L2 is fixed line length of 64 bytes and 16-way set-associative cache structure.
1MB of L2 / 64 (line length) = 16384 ways
16384 ways / 16 = 1024 sets
Fix the l2 cache-sets.
[1] https://developer.arm.com/documentation/100095/0003/Level-2-Memory-System/About-the-L2-memory-system
[2] http://www.ti.com/lit/pdf/spruil1
--- arch/arm64/boot/dts/ti/k3-j721e.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-j721e.dtsi +1 -1
@@ -85,7 +85,7 @@ cache-level = <2>; cache-size = <0x100000>; cache-line-size = <64>; - cache-sets = <2048>; + cache-sets = <1024>; next-level-cache = <&msmc_l3>; };
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 129/563 serial: amba-pl011: do not request memory region twice
In reply to Greg Kroah-HartmanFrom: Lino Sanfilippo <[email protected]>
[ Upstream commit d1180405c7b5c7a1c6bde79d5fc24fe931430737 ]
With commit 3873e2d7f63a ("drivers: PL011: refactor pl011_probe()") the function devm_ioremap() called from pl011_setup_port() was replaced with devm_ioremap_resource(). Since this function not only remaps but also requests the ports io memory region it now collides with the .config_port() callback which requests the same region at uart port registration.
Since devm_ioremap_resource() already claims the memory successfully, the request in .config_port() fails.
Later at uart port deregistration the attempt to release the unclaimed memory also fails. The failure results in a “Trying to free nonexistent resource" warning.
Fix these issues by removing the callbacks that implement the redundant memory allocation/release. Also make sure that changing the drivers io memory base address via TIOCSSERIAL is not allowed any more.
--- drivers/tty/serial/amba-pl011.c | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-)
drivers/tty/serial/amba-pl011.c +3 -24
@@ -2083,32 +2083,13 @@ static const char *pl011_type(struct uart_port *port)return uap->port.type ==PORT_AMBA ? uap->type :NULL ; } -/* -* Release the memory region(s) being used by 'port' -*/ -static void pl011_release_port (struct uart_port *port) -{ -release_mem_region (port->mapbase,SZ_4K ); -} - -/* -* Request the memory region(s) being used by 'port' -*/ -static int pl011_request_port (struct uart_port *port) -{ -return request_mem_region (port->mapbase,SZ_4K ,"uart-pl011" ) - !=NULL ?0 : -EBUSY ; -} -/* * Configure/autoconfigure the port. */ static void pl011_config_port (struct uart_port *port,int flags) { -if (flags &UART_CONFIG_TYPE ) { +if (flags &UART_CONFIG_TYPE ) port->type =PORT_AMBA ; -pl011_request_port (port); - } }/*
@@ -2123,6 +2104,8 @@ static int pl011_verify_port(struct uart_port *port, struct serial_struct *ser) ret = -EINVAL ;if (ser->baud_base <9600 ) ret = -EINVAL ; +if (port->mapbase != (unsigned long ) ser->iomem_base) + ret = -EINVAL ;return ret; }
@@ -2140,8 +2123,6 @@ static const struct uart_ops amba_pl011_pops = { .flush_buffer = pl011_dma_flush_buffer, .set_termios = pl011_set_termios, .type = pl011_type, - .release_port = pl011_release_port, - .request_port = pl011_request_port, .config_port = pl011_config_port, .verify_port = pl011_verify_port,#ifdef CONFIG_CONSOLE_POLL
@@ -2171,8 +2152,6 @@ static const struct uart_ops sbsa_uart_pops = { .shutdown = sbsa_uart_shutdown, .set_termios = sbsa_uart_set_termios, .type = pl011_type, - .release_port = pl011_release_port, - .request_port = pl011_request_port, .config_port = pl011_config_port, .verify_port = pl011_verify_port,#ifdef CONFIG_CONSOLE_POLL
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 132/563 staging: rtl8192e: rtllib_module: fix error handle case in alloc_rtllib()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit e730cd57ac2dfe94bca0f14a3be8e1b21de41a9c ]
Some variables are leaked in the error handling in alloc_rtllib(), free the variables in the error path.
--- drivers/staging/rtl8192e/rtllib_module.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/staging/rtl8192e/rtllib_module.c +12 -4
@@ -88,7 +88,7 @@ struct net_device *alloc_rtllib(int sizeof_priv) err =rtllib_networks_allocate (ieee);if (err) {pr_err ("Unable to allocate beacon storage: %d\n" , err); - goto failed; + goto free_netdev; }rtllib_networks_initialize (ieee);
@@ -121,11 +121,13 @@ struct net_device *alloc_rtllib(int sizeof_priv) ieee->hwsec_active =0 ;memset (ieee->swcamtable,0 ,sizeof (struct sw_cam_table ) *32 ); -rtllib_softmac_init (ieee); + err =rtllib_softmac_init (ieee); +if (err) + goto free_crypt_info; ieee->pHTInfo =kzalloc (sizeof (struct rt_hi_throughput ),GFP_KERNEL );if (!ieee->pHTInfo) -return NULL ; + goto free_softmac;HTUpdateDefaultSetting (ieee);HTInitializeHTInfo (ieee);
@@ -141,8 +143,14 @@ struct net_device *alloc_rtllib(int sizeof_priv)return dev; - failed: +free_softmac: +rtllib_softmac_free (ieee); +free_crypt_info: +lib80211_crypt_info_free (&ieee->crypt_info); +rtllib_networks_free (ieee); +free_netdev:free_netdev (dev); +return NULL ; }EXPORT_SYMBOL (alloc_rtllib);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 108/563 media: rcar-csi2: Correct the selection of hsfreqrange
In reply to Greg Kroah-HartmanFrom: Suresh Udipi <[email protected]>
[ Upstream commit cee44d4fbacbbdfe62697ec94e76c6e4f726c5df ]
hsfreqrange should be chosen based on the calculated mbps which is closer to the default bit rate and within the range as per table[1]. But current calculation always selects first value which is greater than or equal to the calculated mbps which may lead to chosing a wrong range in some cases.
For example for 360 mbps for H3/M3N
Existing logic selects
Calculated value 360Mbps : Default 400Mbps Range [368.125 -433.125 mbps]
This hsfreqrange is out of range.
The logic is changed to get the default value which is closest to the calculated value [1]
Calculated value 360Mbps : Default 350Mbps Range [320.625 -380.625 mpbs]
[1] specs r19uh0105ej0200-r-car-3rd-generation.pdf [Table 25.9]
Please note that According to Renesas in Table 25.9 the range for 220 default value is corrected as below
|Range (Mbps) | Default Bit rate (Mbps) |
-----------------------------------------------
| 197.125-244.125 | 220 |
-----------------------------------------------
--- drivers/media/platform/rcar-vin/rcar-csi2.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/media/platform/rcar-vin/rcar-csi2.c +8 -1
@@ -436,16 +436,23 @@ static int rcsi2_wait_phy_start(struct rcar_csi2 *priv,static int rcsi2_set_phypll (struct rcar_csi2 *priv,unsigned int mbps) {const struct rcsi2_mbps_reg *hsfreq; +const struct rcsi2_mbps_reg *hsfreq_prev =NULL ; -for (hsfreq = priv->info->hsfreqrange; hsfreq->mbps !=0 ; hsfreq++) +for (hsfreq = priv->info->hsfreqrange; hsfreq->mbps !=0 ; hsfreq++) {if (hsfreq->mbps >= mbps)break ; + hsfreq_prev = hsfreq; + }if (!hsfreq->mbps) {dev_err (priv->dev,"Unsupported PHY speed (%u Mbps)" , mbps);return -ERANGE ; } +if (hsfreq_prev && + ((mbps - hsfreq_prev->mbps) <= (hsfreq->mbps - mbps))) + hsfreq = hsfreq_prev; +rcsi2_write (priv,PHYPLL_REG ,PHYPLL_HSFREQRANGE (hsfreq->reg));return 0 ;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 136/563 bpf: Adjust BTF log size limit.
In reply to Greg Kroah-HartmanFrom: Alexei Starovoitov <[email protected]>
[ Upstream commit c5a2d43e998a821701029f23e25b62f9188e93ff ]
Make BTF log size limit to be the same as the verifier log size limit. Otherwise tools that progressively increase log size and use the same log for BTF loading and program loading will be hitting hard to debug EINVAL.
--- kernel/bpf/btf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/btf.c +1 -1
@@ -4135,7 +4135,7 @@ static struct btf *btf_parse(void __user *btf_data, u32 btf_data_size, log->len_total = log_size;/* log attributes have to be sane */ -if (log->len_total <128 || log->len_total >UINT_MAX >>8 || +if (log->len_total <128 || log->len_total >UINT_MAX >>2 || !log->level || !log->ubuf) { err = -EINVAL ; goto errout;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 150/563 x86/uaccess: Move variable into switch case statement
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
[ Upstream commit 61646ca83d3889696f2772edaff122dd96a2935e ]
When building with automatic stack variable initialization, GCC 12 complains about variables defined outside of switch case statements. Move the variable into the case that uses it, which silences the warning:
./arch/x86/include/asm/uaccess.h:317:23: warning: statement will never be executed [-Wswitch-unreachable]
317 | unsigned char x_u8__; \
| ^~~~~~
--- arch/x86/include/asm/uaccess.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/x86/include/asm/uaccess.h +3 -2
@@ -314,11 +314,12 @@ do { \ do { \ __chk_user_ptr(ptr); \ switch (size) { \ - unsigned char x_u8__; \ - case 1: \ + case 1: { \ + unsigned char x_u8__; \ __get_user_asm(x_u8__, ptr, "b", "=q", label); \ (x) = x_u8__; \ break; \ + } \ case 2: \ __get_user_asm(x, ptr, "w", "=r", label); \ break; \
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 106/563 mfd: atmel-flexcom: Remove #ifdef CONFIG_PM_SLEEP
In reply to Greg Kroah-HartmanFrom: Claudiu Beznea <[email protected]>
[ Upstream commit 8c0fad75dcaa650e3f3145a2c35847bc6a65cb7f ]
Remove compilation flag and use __maybe_unused and pm_ptr instead.
--- drivers/mfd/atmel-flexcom.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mfd/atmel-flexcom.c +2 -4
@@ -87,8 +87,7 @@ static const struct of_device_id atmel_flexcom_of_match[] = { };MODULE_DEVICE_TABLE (of, atmel_flexcom_of_match); -#ifdef CONFIG_PM_SLEEP -static int atmel_flexcom_resume (struct device *dev) +static int __maybe_unused atmel_flexcom_resume (struct device *dev) {struct atmel_flexcom *ddata =dev_get_drvdata (dev);int err;
@@ -105,7 +104,6 @@ static int atmel_flexcom_resume(struct device *dev)return 0 ; } -#endif static SIMPLE_DEV_PM_OPS(atmel_flexcom_pm_ops, NULL, atmel_flexcom_resume);
@@ -114,7 +112,7 @@ static struct platform_driver atmel_flexcom_driver = { .probe = atmel_flexcom_probe, .driver = { .name = "atmel_flexcom", - .pm = &atmel_flexcom_pm_ops, + .pm = pm_ptr(&atmel_flexcom_pm_ops), .of_match_table = atmel_flexcom_of_match, }, };
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 131/563 staging: rtl8192e: return error code from rtllib_softmac_init()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 68bf78ff59a0891eb1239948e94ce10f73a9dd30 ]
If it fails to allocate 'dot11d_info', rtllib_softmac_init() should return error code. And remove unneccessary error message.
--- drivers/staging/rtl8192e/rtllib.h | 2 +- drivers/staging/rtl8192e/rtllib_softmac.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/staging/rtl8192e/rtllib.h +1 -1
@@ -1982,7 +1982,7 @@ void rtllib_softmac_xmit(struct rtllib_txb *txb, struct rtllib_device *ieee);void rtllib_stop_send_beacons (struct rtllib_device *ieee);void notify_wx_assoc_event (struct rtllib_device *ieee);void rtllib_start_ibss (struct rtllib_device *ieee); -void rtllib_softmac_init (struct rtllib_device *ieee); +int rtllib_softmac_init (struct rtllib_device *ieee);void rtllib_softmac_free (struct rtllib_device *ieee);void rtllib_disassociate (struct rtllib_device *ieee);void rtllib_stop_scan (struct rtllib_device *ieee);
drivers/staging/rtl8192e/rtllib_softmac.c +4 -2
@@ -2953,7 +2953,7 @@ void rtllib_start_protocol(struct rtllib_device *ieee) } } -void rtllib_softmac_init (struct rtllib_device *ieee) +int rtllib_softmac_init (struct rtllib_device *ieee) {int i;
@@ -2964,7 +2964,8 @@ void rtllib_softmac_init(struct rtllib_device *ieee) ieee->seq_ctrl[i] =0 ; ieee->dot11d_info =kzalloc (sizeof (struct rt_dot11d_info ),GFP_ATOMIC );if (!ieee->dot11d_info) -netdev_err (ieee->dev,"Can't alloc memory for DOT11D\n" ); +return -ENOMEM ; + ieee->LinkDetectInfo.SlotIndex =0 ; ieee->LinkDetectInfo.SlotNum =2 ; ieee->LinkDetectInfo.NumRecvBcnInPeriod =0 ;
@@ -3030,6 +3031,7 @@ void rtllib_softmac_init(struct rtllib_device *ieee)tasklet_setup (&ieee->ps_task, rtllib_sta_ps); +return 0 ; }void rtllib_softmac_free (struct rtllib_device *ieee)
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 109/563 media: imx-pxp: Initialize the spinlock prior to using it
In reply to Greg Kroah-HartmanFrom: Fabio Estevam <[email protected]>
[ Upstream commit ed2f97ad4b21072f849cf4ae6645d1f2b1d3f550 ]
After devm_request_threaded_irq() is called there is a chance that an interrupt may occur before the spinlock is initialized, which will trigger a kernel oops.
To prevent that, move the initialization of the spinlock prior to requesting the interrupts.
--- drivers/media/platform/imx-pxp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/imx-pxp.c +2 -2
@@ -1664,6 +1664,8 @@ static int pxp_probe(struct platform_device *pdev)if (irq <0 )return irq; +spin_lock_init (&dev->irqlock); + ret =devm_request_threaded_irq (&pdev->dev, irq,NULL , pxp_irq_handler,IRQF_ONESHOT ,dev_name (&pdev->dev), dev);if (ret <0 ) {
@@ -1681,8 +1683,6 @@ static int pxp_probe(struct platform_device *pdev) goto err_clk; } -spin_lock_init (&dev->irqlock); - ret =v4l2_device_register (&pdev->dev, &dev->v4l2_dev);if (ret) goto err_clk;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 103/563 arm64: dts: ti: k3-j721e: correct cache-sets info
In reply to Greg Kroah-HartmanFrom: Peng Fan <[email protected]>
[ Upstream commit 7a0df1f969c14939f60a7f9a6af72adcc314675f ]
A72 Cluster has 48KB Icache, 32KB Dcache and 1MB L2 Cache
- ICache is 3-way set-associative
- Dcache is 2-way set-associative
- Line size are 64bytes
So correct the cache-sets info.
--- arch/arm64/boot/dts/ti/k3-j721e.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-j721e.dtsi +2 -2
@@ -61,7 +61,7 @@ i-cache-sets = <256>; d-cache-size = <0x8000>; d-cache-line-size = <64>; - d-cache-sets = <128>; + d-cache-sets = <256>; next-level-cache = <&L2_0>; };
@@ -75,7 +75,7 @@ i-cache-sets = <256>; d-cache-size = <0x8000>; d-cache-line-size = <64>; - d-cache-sets = <128>; + d-cache-sets = <256>; next-level-cache = <&L2_0>; }; };
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 153/563 crypto: stm32 - Fix last sparse warning in stm32_cryp_check_ctr_counter
In reply to Greg Kroah-HartmanFrom: Herbert Xu <[email protected]>
[ Upstream commit 81064c96d88180ad6995d52419e94a78968308a2 ]
This patch changes the cast in stm32_cryp_check_ctr_counter from u32 to __be32 to match the prototype of stm32_cryp_hw_write_iv correctly.
--- drivers/crypto/stm32/stm32-cryp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/stm32/stm32-cryp.c +1 -1
@@ -1229,7 +1229,7 @@ static void stm32_cryp_check_ctr_counter(struct stm32_cryp *cryp) cr =stm32_cryp_read (cryp,CRYP_CR );stm32_cryp_write (cryp,CRYP_CR , cr & ~CR_CRYPEN ); -stm32_cryp_hw_write_iv (cryp, (u32 *)cryp->last_ctr); +stm32_cryp_hw_write_iv (cryp, (__be32 *)cryp->last_ctr);stm32_cryp_write (cryp,CRYP_CR , cr); }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 156/563 crypto: stm32/cryp - check early input data
In reply to Greg Kroah-HartmanFrom: Nicolas Toromanoff <[email protected]>
[ Upstream commit 39e6e699c7fb92bdb2617b596ca4a4ea35c5d2a7 ]
Some auto tests failed because driver wasn't returning the expected error with some input size/iv value/tag size.
Now:
Return 0 early for empty buffer. (We don't need to start the engine for an empty input buffer).
Accept any valid authsize for gcm(aes).
Return -EINVAL if iv for ccm(aes) is invalid.
Return -EINVAL if buffer size is a not a multiple of algorithm block size.
--- drivers/crypto/stm32/stm32-cryp.c | 114 +++++++++++++++++++++++++++++- 1 file changed, 113 insertions(+), 1 deletion(-)
drivers/crypto/stm32/stm32-cryp.c +113 -1
@@ -799,7 +799,20 @@ static int stm32_cryp_aes_aead_setkey(struct crypto_aead *tfm, const u8 *key,static int stm32_cryp_aes_gcm_setauthsize (struct crypto_aead *tfm,unsigned int authsize) { -return authsize ==AES_BLOCK_SIZE ?0 : -EINVAL ; +switch (authsize) { +case 4 : +case 8 : +case 12 : +case 13 : +case 14 : +case 15 : +case 16 : +break ; +default : +return -EINVAL ; + } + +return 0 ; } static int stm32_cryp_aes_ccm_setauthsize(struct crypto_aead *tfm,
@@ -823,31 +836,61 @@ static int stm32_cryp_aes_ccm_setauthsize(struct crypto_aead *tfm,static int stm32_cryp_aes_ecb_encrypt (struct skcipher_request *req) { +if (req->cryptlen %AES_BLOCK_SIZE ) +return -EINVAL ; + +if (req->cryptlen ==0 ) +return 0 ; +return stm32_cryp_crypt (req,FLG_AES |FLG_ECB |FLG_ENCRYPT ); }static int stm32_cryp_aes_ecb_decrypt (struct skcipher_request *req) { +if (req->cryptlen %AES_BLOCK_SIZE ) +return -EINVAL ; + +if (req->cryptlen ==0 ) +return 0 ; +return stm32_cryp_crypt (req,FLG_AES |FLG_ECB ); }static int stm32_cryp_aes_cbc_encrypt (struct skcipher_request *req) { +if (req->cryptlen %AES_BLOCK_SIZE ) +return -EINVAL ; + +if (req->cryptlen ==0 ) +return 0 ; +return stm32_cryp_crypt (req,FLG_AES |FLG_CBC |FLG_ENCRYPT ); }static int stm32_cryp_aes_cbc_decrypt (struct skcipher_request *req) { +if (req->cryptlen %AES_BLOCK_SIZE ) +return -EINVAL ; + +if (req->cryptlen ==0 ) +return 0 ; +return stm32_cryp_crypt (req,FLG_AES |FLG_CBC ); }static int stm32_cryp_aes_ctr_encrypt (struct skcipher_request *req) { +if (req->cryptlen ==0 ) +return 0 ; +return stm32_cryp_crypt (req,FLG_AES |FLG_CTR |FLG_ENCRYPT ); }static int stm32_cryp_aes_ctr_decrypt (struct skcipher_request *req) { +if (req->cryptlen ==0 ) +return 0 ; +return stm32_cryp_crypt (req,FLG_AES |FLG_CTR ); }
@@ -861,53 +904,122 @@ static int stm32_cryp_aes_gcm_decrypt(struct aead_request *req)return stm32_cryp_aead_crypt (req,FLG_AES |FLG_GCM ); } +static inline int crypto_ccm_check_iv (const u8 *iv) +{ +/* 2 <= L <= 8, so 1 <= L' <= 7. */ +if (iv[0 ] <1 || iv[0 ] >7 ) +return -EINVAL ; + +return 0 ; +} +static int stm32_cryp_aes_ccm_encrypt (struct aead_request *req) { +int err; + + err =crypto_ccm_check_iv (req->iv); +if (err) +return err; +return stm32_cryp_aead_crypt (req,FLG_AES |FLG_CCM |FLG_ENCRYPT ); }static int stm32_cryp_aes_ccm_decrypt (struct aead_request *req) { +int err; + + err =crypto_ccm_check_iv (req->iv); +if (err) +return err; +return stm32_cryp_aead_crypt (req,FLG_AES |FLG_CCM ); }static int stm32_cryp_des_ecb_encrypt (struct skcipher_request *req) { +if (req->cryptlen %DES_BLOCK_SIZE ) +return -EINVAL ; + +if (req->cryptlen ==0 ) +return 0 ; +return stm32_cryp_crypt (req,FLG_DES |FLG_ECB |FLG_ENCRYPT ); }static int stm32_cryp_des_ecb_decrypt (struct skcipher_request *req) { +if (req->cryptlen %DES_BLOCK_SIZE ) +return -EINVAL ; + +if (req->cryptlen ==0 ) +return 0 ; +return stm32_cryp_crypt (req,FLG_DES |FLG_ECB ); }static int stm32_cryp_des_cbc_encrypt (struct skcipher_request *req) { +if (req->cryptlen %DES_BLOCK_SIZE ) +return -EINVAL ; + +if (req->cryptlen ==0 ) +return 0 ; +return stm32_cryp_crypt (req,FLG_DES |FLG_CBC |FLG_ENCRYPT ); }static int stm32_cryp_des_cbc_decrypt (struct skcipher_request *req) { +if (req->cryptlen %DES_BLOCK_SIZE ) +return -EINVAL ; + +if (req->cryptlen ==0 ) +return 0 ; +return stm32_cryp_crypt (req,FLG_DES |FLG_CBC ); }static int stm32_cryp_tdes_ecb_encrypt (struct skcipher_request *req) { +if (req->cryptlen %DES_BLOCK_SIZE ) +return -EINVAL ; + +if (req->cryptlen ==0 ) +return 0 ; +return stm32_cryp_crypt (req,FLG_TDES |FLG_ECB |FLG_ENCRYPT ); }static int stm32_cryp_tdes_ecb_decrypt (struct skcipher_request *req) { +if (req->cryptlen %DES_BLOCK_SIZE ) +return -EINVAL ; + +if (req->cryptlen ==0 ) +return 0 ; +return stm32_cryp_crypt (req,FLG_TDES |FLG_ECB ); }static int stm32_cryp_tdes_cbc_encrypt (struct skcipher_request *req) { +if (req->cryptlen %DES_BLOCK_SIZE ) +return -EINVAL ; + +if (req->cryptlen ==0 ) +return 0 ; +return stm32_cryp_crypt (req,FLG_TDES |FLG_CBC |FLG_ENCRYPT ); }static int stm32_cryp_tdes_cbc_decrypt (struct skcipher_request *req) { +if (req->cryptlen %DES_BLOCK_SIZE ) +return -EINVAL ; + +if (req->cryptlen ==0 ) +return 0 ; +return stm32_cryp_crypt (req,FLG_TDES |FLG_CBC ); }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 166/563 ath11k: Fix a NULL pointer dereference in ath11k_mac_op_hw_scan()
In reply to Greg Kroah-HartmanFrom: Zhou Qingyang <[email protected]>
[ Upstream commit eccd25136386a04ebf46a64f3a34e8e0fab6d9e1 ]
In ath11k_mac_op_hw_scan(), the return value of kzalloc() is directly used in memcpy(), which may lead to a NULL pointer dereference on failure of kzalloc().
Fix this bug by adding a check of arg.extraie.ptr.
This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs.
Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug.
Builds with CONFIG_ATH11K=m show no new warnings, and our static analyzer no longer warns about this code.
--- drivers/net/wireless/ath/ath11k/mac.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +5 -2
@@ -2320,9 +2320,12 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw, arg.scan_id =ATH11K_SCAN_ID ;if (req->ie_len) { + arg.extraie.ptr =kmemdup (req->ie, req->ie_len,GFP_KERNEL ); +if (!arg.extraie.ptr) { + ret = -ENOMEM ; + goto exit; + } arg.extraie.len = req->ie_len; - arg.extraie.ptr =kzalloc (req->ie_len,GFP_KERNEL ); -memcpy (arg.extraie.ptr, req->ie, req->ie_len); }if (req->n_ssids) {
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 142/563 media: saa7146: mxb: Fix a NULL pointer dereference in mxb_attach()
In reply to Greg Kroah-HartmanFrom: Zhou Qingyang <[email protected]>
[ Upstream commit 0407c49ebe330333478440157c640fffd986f41b ]
In mxb_attach(dev, info), saa7146_vv_init() is called to allocate a new memory for dev->vv_data. saa7146_vv_release() will be called on failure of mxb_probe(dev). There is a dereference of dev->vv_data in saa7146_vv_release(), which could lead to a NULL pointer dereference on failure of saa7146_vv_init().
Fix this bug by adding a check of saa7146_vv_init().
This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs.
Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug.
Builds with CONFIG_VIDEO_MXB=m show no new warnings, and our static analyzer no longer warns about this code.
--- drivers/media/pci/saa7146/mxb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/media/pci/saa7146/mxb.c +7 -1
@@ -683,10 +683,16 @@ static struct saa7146_ext_vv vv_data;static int mxb_attach (struct saa7146_dev *dev,struct saa7146_pci_extension_data *info) {struct mxb *mxb; +int ret;DEB_EE ("dev:%p\n" , dev); -saa7146_vv_init (dev, &vv_data); + ret =saa7146_vv_init (dev, &vv_data); +if (ret) { +ERR ("Error in saa7146_vv_init()" ); +return ret; + } +if (mxb_probe (dev)) {saa7146_vv_release (dev);return -1 ;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 144/563 wireless: iwlwifi: Fix a double free in iwl_txq_dyn_alloc_dma
In reply to Greg Kroah-HartmanFrom: Lv Yunlong <[email protected]>
[ Upstream commit f973795a8d19cbf3d03807704eb7c6ff65788d5a ]
In iwl_txq_dyn_alloc_dma, txq->tfds is freed at first time by:
iwl_txq_alloc()->goto err_free_tfds->dma_free_coherent(). But it forgot to set txq->tfds to NULL.
Then the txq->tfds is freed again in iwl_txq_dyn_alloc_dma by:
goto error->iwl_txq_gen2_free_memory()->dma_free_coherent().
My patch sets txq->tfds to NULL after the first free to avoid the double free.
--- drivers/net/wireless/intel/iwlwifi/queue/tx.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/intel/iwlwifi/queue/tx.c +1 -0
@@ -1148,6 +1148,7 @@ int iwl_txq_alloc(struct iwl_trans *trans, struct iwl_txq *txq, int slots_num,return 0 ; err_free_tfds:dma_free_coherent (trans->dev, tfd_sz, txq->tfds, txq->dma_addr); + txq->tfds =NULL ; error:if (txq->entries && cmd_queue)for (i =0 ; i < slots_num; i++)
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 147/563 rcu/exp: Mark current CPU as exp-QS in IPI loop second pass
In reply to Greg Kroah-HartmanFrom: Frederic Weisbecker <[email protected]>
[ Upstream commit 81f6d49cce2d2fe507e3fddcc4a6db021d9c2e7b ]
Expedited RCU grace periods invoke sync_rcu_exp_select_node_cpus(), which takes two passes over the leaf rcu_node structure's CPUs. The first pass gathers up the current CPU and CPUs that are in dynticks idle mode. The workqueue will report a quiescent state on their behalf later. The second pass sends IPIs to the rest of the CPUs, but excludes the current CPU, incorrectly assuming it has been included in the first pass's list of CPUs.
Unfortunately the current CPU may have changed between the first and second pass, due to the fact that the various rcu_node structures' ->lock fields have been dropped, thus momentarily enabling preemption. This means that if the second pass's CPU was not on the first pass's list, it will be ignored completely. There will be no IPI sent to it, and there will be no reporting of quiescent states on its behalf. Unfortunately, the expedited grace period will nevertheless be waiting for that CPU to report a quiescent state, but with that CPU having no reason to believe that such a report is needed.
The result will be an expedited grace period stall.
Fix this by no longer excluding the current CPU from consideration during the second pass.
--- kernel/rcu/tree_exp.h | 1 + 1 file changed, 1 insertion(+)
kernel/rcu/tree_exp.h +1 -0
@@ -387,6 +387,7 @@ retry_ipi:continue ; }if (get_cpu () == cpu) { + mask_ofl_test |= mask;put_cpu ();continue ; }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 146/563 drm/msm/dp: displayPort driver need algorithm rational
In reply to Greg Kroah-HartmanFrom: Jackie Liu <[email protected]>
[ Upstream commit 53d22794711ad630f40d59dd726bd260d77d585f ]
Let's select RATIONAL with dp driver. avoid like:
[...]
x86_64-linux-gnu-ld: drivers/gpu/drm/msm/dp/dp_catalog.o: in function `dp_catalog_ctrl_config_msa':
dp_catalog.c:(.text+0x57e): undefined reference to `rational_best_approximation'
--- drivers/gpu/drm/msm/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/Kconfig +1 -0
@@ -60,6 +60,7 @@ config DRM_MSM_HDMI_HDCP config DRM_MSM_DP bool "Enable DisplayPort support in MSM DRM driver" depends on DRM_MSM + select RATIONAL default y help Compile in support for DP driver in MSM DRM driver. DP external
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 191/563 backlight: qcom-wled: Fix off-by-one maximum with default num_strings
In reply to Greg Kroah-HartmanFrom: Marijn Suijten <[email protected]>
[ Upstream commit 5ada78b26f935f8751852dffa24f6b545b1d2517 ]
When not specifying num-strings in the DT the default is used, but +1 is added to it which turns WLED3 into 4 and WLED4/5 into 5 strings instead of 3 and 4 respectively, causing out-of-bounds reads and register read/writes. This +1 exists for a deficiency in the DT parsing code, and is simply omitted entirely - solving this oob issue - by parsing the property separately much like qcom,enabled-strings.
This also enables more stringent checks on the maximum value when qcom,enabled-strings is provided in the DT, by parsing num-strings after enabled-strings to allow it to check against (and in a subsequent patch override) the length of enabled-strings: it is invalid to set num-strings higher than that.
The DT currently utilizes it to get around an incorrect fixed read of four elements from that array (has been addressed in a prior patch) by setting a lower num-strings where desired.
--- drivers/video/backlight/qcom-wled.c | 48 ++++++++++------------------- 1 file changed, 16 insertions(+), 32 deletions(-)
drivers/video/backlight/qcom-wled.c +16 -32
@@ -1256,21 +1256,6 @@ static const struct wled_var_cfg wled5_ovp_cfg = { .size = 16, }; -static u32 wled3_num_strings_values_fn (u32 idx) -{ -return idx +1 ; -} - -static const struct wled_var_cfg wled3_num_strings_cfg = { - .fn = wled3_num_strings_values_fn, - .size =3 , -}; - -static const struct wled_var_cfg wled4_num_strings_cfg = { - .fn = wled3_num_strings_values_fn, - .size =4 , -}; -static u32 wled3_switch_freq_values_fn (u32 idx) {return 19200 / (2 * (1 + idx));
@@ -1344,11 +1329,6 @@ static int wled_configure(struct wled *wled) .val_ptr = &cfg->switch_freq, .cfg = &wled3_switch_freq_cfg, }, - { - .name = "qcom,num-strings", - .val_ptr = &cfg->num_strings, - .cfg = &wled3_num_strings_cfg, - }, }; const struct wled_u32_opts wled4_opts[] = {
@@ -1372,11 +1352,6 @@ static int wled_configure(struct wled *wled) .val_ptr = &cfg->switch_freq, .cfg = &wled3_switch_freq_cfg, }, - { - .name = "qcom,num-strings", - .val_ptr = &cfg->num_strings, - .cfg = &wled4_num_strings_cfg, - }, }; const struct wled_u32_opts wled5_opts[] = {
@@ -1400,11 +1375,6 @@ static int wled_configure(struct wled *wled) .val_ptr = &cfg->switch_freq, .cfg = &wled3_switch_freq_cfg, }, - { - .name = "qcom,num-strings", - .val_ptr = &cfg->num_strings, - .cfg = &wled4_num_strings_cfg, - }, { .name = "qcom,modulator-sel", .val_ptr = &cfg->mod_sel,
@@ -1523,8 +1493,6 @@ static int wled_configure(struct wled *wled) *bool_opts[i].val_ptr = true; } - cfg->num_strings = cfg->num_strings +1 ; - string_len =of_property_count_elems_of_size (dev->of_node,"qcom,enabled-strings" ,sizeof (u32));
@@ -1555,6 +1523,22 @@ static int wled_configure(struct wled *wled) } } + rc =of_property_read_u32 (dev->of_node,"qcom,num-strings" , &val); +if (!rc) { +if (val <1 || val > wled->max_string_count) { +dev_err (dev,"qcom,num-strings must be between 1 and %d\n" , + wled->max_string_count); +return -EINVAL ; + } + +if (string_len >0 && val > string_len) { +dev_err (dev,"qcom,num-strings exceeds qcom,enabled-strings\n" ); +return -EINVAL ; + } + + cfg->num_strings = val; + } +return 0 ; }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 192/563 backlight: qcom-wled: Override default length with qcom,enabled-strings
In reply to Greg Kroah-HartmanFrom: Marijn Suijten <[email protected]>
[ Upstream commit 2b4b49602f9feca7b7a84eaa33ad9e666c8aa695 ]
The length of qcom,enabled-strings as property array is enough to determine the number of strings to be enabled, without needing to set qcom,num-strings to override the default number of strings when less than the default (which is also the maximum) is provided in DT.
This also introduces an extra warning when qcom,num-strings is set, denoting that it is not necessary to set both anymore. It is usually more concise to set just qcom,num-length when a zero-based, contiguous range of strings is needed (the majority of the cases), or to only set qcom,enabled-strings when a specific set of indices is desired.
--- drivers/video/backlight/qcom-wled.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/video/backlight/qcom-wled.c +9 -3
@@ -1521,6 +1521,8 @@ static int wled_configure(struct wled *wled)return -EINVAL ; } } + + cfg->num_strings = string_len; } rc =of_property_read_u32 (dev->of_node,"qcom,num-strings" , &val);
@@ -1531,9 +1533,13 @@ static int wled_configure(struct wled *wled)return -EINVAL ; } -if (string_len >0 && val > string_len) { -dev_err (dev,"qcom,num-strings exceeds qcom,enabled-strings\n" ); -return -EINVAL ; +if (string_len >0 ) { +dev_warn (dev,"Only one of qcom,num-strings or qcom,enabled-strings" +" should be set\n" ); +if (val > string_len) { +dev_err (dev,"qcom,num-strings exceeds qcom,enabled-strings\n" ); +return -EINVAL ; + } } cfg->num_strings = val;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 121/563 ACPI: EC: Rework flushing of EC work while suspended to idle
In reply to Greg Kroah-HartmanFrom: Rafael J. Wysocki <[email protected]>
[ Upstream commit 4a9af6cac050dce2e895ec3205c4615383ad9112 ]
The flushing of pending work in the EC driver uses drain_workqueue() to flush the event handling work that can requeue itself via advance_transaction(), but this is problematic, because that work may also be requeued from the query workqueue.
Namely, if an EC transaction is carried out during the execution of a query handler, it involves calling advance_transaction() which may queue up the event handling work again. This causes the kernel to complain about attempts to add a work item to the EC event workqueue while it is being drained and worst-case it may cause a valid event to be skipped.
To avoid this problem, introduce two new counters, events_in_progress and queries_in_progress, incremented when a work item is queued on the event workqueue or the query workqueue, respectively, and decremented at the end of the corresponding work function, and make acpi_ec_dispatch_gpe() the workqueues in a loop until the both of these counters are zero (or system wakeup is pending) instead of calling acpi_ec_flush_work().
At the same time, change __acpi_ec_flush_work() to call flush_workqueue() instead of drain_workqueue() to flush the event workqueue.
While at it, use the observation that the work item queued in acpi_ec_query() cannot be pending at that time, because it is used only once, to simplify the code in there.
Additionally, clean up a comment in acpi_ec_query() and adjust white space in acpi_ec_event_processor().
--- drivers/acpi/ec.c | 57 +++++++++++++++++++++++++++++++---------- drivers/acpi/internal.h | 2 ++ 2 files changed, 45 insertions(+), 14 deletions(-)
drivers/acpi/ec.c +43 -14
@@ -166,6 +166,7 @@ struct acpi_ec_query {struct transaction transaction;struct work_struct work;struct acpi_ec_query_handler *handler; +struct acpi_ec *ec; };static int acpi_ec_query (struct acpi_ec *ec,u8 *data);
@@ -469,6 +470,7 @@ static void acpi_ec_submit_query(struct acpi_ec *ec)ec_dbg_evt ("Command(%s) submitted/blocked" ,acpi_ec_cmd_string (ACPI_EC_COMMAND_QUERY )); ec->nr_pending_queries++; + ec->events_in_progress++;queue_work (ec_wq, &ec->work); } }
@@ -535,7 +537,7 @@ static void acpi_ec_enable_event(struct acpi_ec *ec)#ifdef CONFIG_PM_SLEEP static void __acpi_ec_flush_work (void ) { -drain_workqueue (ec_wq);/* flush ec->work */ +flush_workqueue (ec_wq);/* flush ec->work */ flush_workqueue (ec_query_wq);/* flush queries */ }
@@ -1116,7 +1118,7 @@ void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit) }EXPORT_SYMBOL_GPL (acpi_ec_remove_query_handler); -static struct acpi_ec_query *acpi_ec_create_query (u8 *pval) +static struct acpi_ec_query *acpi_ec_create_query (struct acpi_ec *ec,u8 *pval) {struct acpi_ec_query *q;struct transaction *t;
@@ -1124,11 +1126,13 @@ static struct acpi_ec_query *acpi_ec_create_query(u8 *pval) q =kzalloc (sizeof (struct acpi_ec_query ),GFP_KERNEL );if (!q)return NULL ; +INIT_WORK (&q->work, acpi_ec_event_processor); t = &q->transaction; t->command =ACPI_EC_COMMAND_QUERY ; t->rdata = pval; t->rlen =1 ; + q->ec = ec;return q; }
@@ -1145,13 +1149,21 @@ static void acpi_ec_event_processor(struct work_struct *work) { struct acpi_ec_query *q = container_of(work, struct acpi_ec_query, work);struct acpi_ec_query_handler *handler = q->handler; +struct acpi_ec *ec = q->ec;ec_dbg_evt ("Query(0x%02x) started" , handler->query_bit); +if (handler->func) handler->func (handler->data);else if (handler->handle)acpi_evaluate_object (handler->handle,NULL ,NULL ,NULL ); +ec_dbg_evt ("Query(0x%02x) stopped" , handler->query_bit); + +spin_lock_irq (&ec->lock); + ec->queries_in_progress--; +spin_unlock_irq (&ec->lock); +acpi_ec_delete_query (q); }
@@ -1161,7 +1173,7 @@ static int acpi_ec_query(struct acpi_ec *ec, u8 *data)int result;struct acpi_ec_query *q; - q =acpi_ec_create_query (&value); + q =acpi_ec_create_query (ec, &value);if (!q)return -ENOMEM ;
@@ -1183,19 +1195,20 @@ static int acpi_ec_query(struct acpi_ec *ec, u8 *data) }/* -* It is reported that _Qxx are evaluated in a parallel way on -* Windows: +* It is reported that _Qxx are evaluated in a parallel way on Windows: * https://bugzilla.kernel.org/show_bug.cgi?id=94411 * -* Put this log entry before schedule_work() in order to make -* it appearing before any other log entries occurred during the -* work queue execution. +* Put this log entry before queue_work() to make it appear in the log +* before any other messages emitted during workqueue handling. */ ec_dbg_evt ("Query(0x%02x) scheduled" , value); -if (!queue_work (ec_query_wq, &q->work)) { -ec_dbg_evt ("Query(0x%02x) overlapped" , value); - result = -EBUSY ; - } + +spin_lock_irq (&ec->lock); + + ec->queries_in_progress++; +queue_work (ec_query_wq, &q->work); + +spin_unlock_irq (&ec->lock); err_exit:if (result)
@@ -1253,6 +1266,10 @@ static void acpi_ec_event_handler(struct work_struct *work)ec_dbg_evt ("Event stopped" );acpi_ec_check_event (ec); + +spin_lock_irqsave (&ec->lock, flags); + ec->events_in_progress--; +spin_unlock_irqrestore (&ec->lock, flags); }static void acpi_ec_handle_interrupt (struct acpi_ec *ec)
@@ -2034,6 +2051,7 @@ void acpi_ec_set_gpe_wake_mask(u8 action)bool acpi_ec_dispatch_gpe (void ) { +bool work_in_progress;u32 ret;if (!first_ec)
@@ -2054,8 +2072,19 @@ bool acpi_ec_dispatch_gpe(void)if (ret ==ACPI_INTERRUPT_HANDLED )pm_pr_dbg ("ACPI EC GPE dispatched\n" ); -/* Flush the event and query workqueues. */ -acpi_ec_flush_work (); +/* Drain EC work. */ +do { +acpi_ec_flush_work (); + +pm_pr_dbg ("ACPI EC work flushed\n" ); + +spin_lock_irq (&first_ec->lock); + + work_in_progress = first_ec->events_in_progress + + first_ec->queries_in_progress >0 ; + +spin_unlock_irq (&first_ec->lock); + }while (work_in_progress && !pm_wakeup_pending ());return false; }
drivers/acpi/internal.h +2 -0
@@ -184,6 +184,8 @@ struct acpi_ec {struct work_struct work;unsigned long timestamp;unsigned long nr_pending_queries; +unsigned int events_in_progress; +unsigned int queries_in_progress;bool busy_polling;unsigned int polling_guard; };
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 173/563 xfrm: interface with if_id 0 should return error
In reply to Greg Kroah-HartmanFrom: Antony Antony <[email protected]>
[ Upstream commit 8dce43919566f06e865f7e8949f5c10d8c2493f5 ]
xfrm interface if_id = 0 would cause xfrm policy lookup errors since Commit 9f8550e4bd9d.
Now explicitly fail to create an xfrm interface when if_id = 0
With this commit:
ip link add ipsec0 type xfrm dev lo if_id 0
Error: if_id must be non zero.
v1->v2 change:
- add Fixes: tag
--- net/xfrm/xfrm_interface.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
net/xfrm/xfrm_interface.c +12 -2
@@ -643,11 +643,16 @@ static int xfrmi_newlink(struct net *src_net, struct net_device *dev, struct netlink_ext_ack *extack) {struct net *net =dev_net (dev); -struct xfrm_if_parms p; +struct xfrm_if_parms p = {};struct xfrm_if *xi;int err;xfrmi_netlink_parms (data, &p); +if (!p.if_id) { +NL_SET_ERR_MSG (extack,"if_id must be non zero" ); +return -EINVAL ; + } + xi =xfrmi_locate (net, &p);if (xi)return -EEXIST ;
@@ -672,7 +677,12 @@ static int xfrmi_changelink(struct net_device *dev, struct nlattr *tb[], {struct xfrm_if *xi =netdev_priv (dev);struct net *net = xi->net; -struct xfrm_if_parms p; +struct xfrm_if_parms p = {}; + +if (!p.if_id) { +NL_SET_ERR_MSG (extack,"if_id must be non zero" ); +return -EINVAL ; + }xfrmi_netlink_parms (data, &p); xi =xfrmi_locate (net, &p);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 220/563 net/mlx5e: Fix page DMA map/unmap attributes
In reply to Greg Kroah-HartmanFrom: Aya Levin <[email protected]>
[ Upstream commit 0b7cfa4082fbf550595bc0e40f05614bd83bf0cd ]
Driver initiates DMA sync, hence it may skip CPU sync. Add DMA_ATTR_SKIP_CPU_SYNC as input attribute both to dma_map_page and dma_unmap_page to avoid redundant sync with the CPU.
When forcing the device to work with SWIOTLB, the extra sync might cause data corruption. The driver unmaps the whole page while the hardware used just a part of the bounce buffer. So syncing overrides the entire page with bounce buffer that only partially contains real data.
--- drivers/net/ethernet/mellanox/mlx5/core/en/xsk/pool.c | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/pool.c +2 -2
@@ -11,13 +11,13 @@ static int mlx5e_xsk_map_pool(struct mlx5e_priv *priv, {struct device *dev =mlx5_core_dma_dev (priv->mdev); -return xsk_pool_dma_map (pool, dev,0 ); +return xsk_pool_dma_map (pool, dev,DMA_ATTR_SKIP_CPU_SYNC ); }static void mlx5e_xsk_unmap_pool (struct mlx5e_priv *priv,struct xsk_buff_pool *pool) { -return xsk_pool_dma_unmap (pool,0 ); +return xsk_pool_dma_unmap (pool,DMA_ATTR_SKIP_CPU_SYNC ); }static int mlx5e_xsk_get_pools (struct mlx5e_xsk *xsk)
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +4 -3
@@ -276,8 +276,8 @@ static inline int mlx5e_page_alloc_pool(struct mlx5e_rq *rq,if (unlikely (!dma_info->page))return -ENOMEM ; - dma_info->addr =dma_map_page (rq->pdev, dma_info->page,0 , -PAGE_SIZE , rq->buff.map_dir); + dma_info->addr =dma_map_page_attrs (rq->pdev, dma_info->page,0 ,PAGE_SIZE , + rq->buff.map_dir,DMA_ATTR_SKIP_CPU_SYNC );if (unlikely (dma_mapping_error (rq->pdev, dma_info->addr))) {page_pool_recycle_direct (rq->page_pool, dma_info->page); dma_info->page =NULL ;
@@ -298,7 +298,8 @@ static inline int mlx5e_page_alloc(struct mlx5e_rq *rq,void mlx5e_page_dma_unmap (struct mlx5e_rq *rq,struct mlx5e_dma_info *dma_info) { -dma_unmap_page (rq->pdev, dma_info->addr,PAGE_SIZE , rq->buff.map_dir); +dma_unmap_page_attrs (rq->pdev, dma_info->addr,PAGE_SIZE , rq->buff.map_dir, +DMA_ATTR_SKIP_CPU_SYNC ); } void mlx5e_page_release_dynamic(struct mlx5e_rq *rq,
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 221/563 net/mlx5e: Dont block routes with nexthop objects in SW
In reply to Greg Kroah-HartmanFrom: Maor Dickman <[email protected]>
[ Upstream commit 9e72a55a3c9d54b38a704bb7292d984574a81d9d ]
Routes with nexthop objects is currently not supported by multipath offload and any attempts to use it is blocked, however this also block adding SW routes with nexthop.
Resolve this by returning NOTIFY_DONE instead of an error which will allow such a route to be created in SW but not offloaded.
This fix also solve an issue which block adding such routes on different devices due to missing check if the route FIB device is one of multipath devices.
--- drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c +2 -4
@@ -265,10 +265,8 @@ static int mlx5_lag_fib_event(struct notifier_block *nb, fen_info = container_of(info, struct fib_entry_notifier_info, info); fi = fen_info->fi; -if (fi->nh) { -NL_SET_ERR_MSG_MOD (info->extack,"IPv4 route with nexthop objects is not supported" ); -return notifier_from_errno (-EINVAL ); - } +if (fi->nh) +return NOTIFY_DONE ; fib_dev =fib_info_nh (fen_info->fi,0 )->fib_nh_dev;if (fib_dev != ldev->pf[MLX5_LAG_P1 ].netdev && fib_dev != ldev->pf[MLX5_LAG_P2 ].netdev) {
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 222/563 Revert "net/mlx5e: Block offload of outer header csum for UDP tunnels"
In reply to Greg Kroah-HartmanFrom: Aya Levin <[email protected]>
[ Upstream commit 64050cdad0983ad8060e33c3f4b5aee2366bcebd ]
This reverts commit 6d6727dddc7f93fcc155cb8d0c49c29ae0e71122.
Although the NIC doesn't support offload of outer header CSUM, using gso_partial_features allows offloading the tunnel's segmentation. The driver relies on the stack CSUM calculation of the outer header. For this, NETIF_F_GSO_UDP_TUNNEL_CSUM must be a member of the device's features.
--- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +7 -3
@@ -5024,9 +5024,13 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev) }if (mlx5_vxlan_allowed (mdev->vxlan) ||mlx5_geneve_tx_allowed (mdev)) { - netdev->hw_features |=NETIF_F_GSO_UDP_TUNNEL ; - netdev->hw_enc_features |=NETIF_F_GSO_UDP_TUNNEL ; - netdev->vlan_features |=NETIF_F_GSO_UDP_TUNNEL ; + netdev->hw_features |=NETIF_F_GSO_UDP_TUNNEL | +NETIF_F_GSO_UDP_TUNNEL_CSUM ; + netdev->hw_enc_features |=NETIF_F_GSO_UDP_TUNNEL | +NETIF_F_GSO_UDP_TUNNEL_CSUM ; + netdev->gso_partial_features =NETIF_F_GSO_UDP_TUNNEL_CSUM ; + netdev->vlan_features |=NETIF_F_GSO_UDP_TUNNEL | +NETIF_F_GSO_UDP_TUNNEL_CSUM ; }if (mlx5e_tunnel_proto_supported (mdev,IPPROTO_GRE )) {
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 223/563 net/mlx5: Set command entry semaphore up once got index free
In reply to Greg Kroah-HartmanFrom: Moshe Shemesh <[email protected]>
[ Upstream commit 8e715cd613a1e872b9d918e912d90b399785761a ]
Avoid a race where command work handler may fail to allocate command entry index, by holding the command semaphore down till command entry index is being freed.
--- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +6 -9
@@ -147,8 +147,12 @@ static void cmd_ent_put(struct mlx5_cmd_work_ent *ent)if (!refcount_dec_and_test (&ent->refcnt))return ; -if (ent->idx >=0 ) -cmd_free_index (ent->cmd, ent->idx); +if (ent->idx >=0 ) { +struct mlx5_cmd *cmd = ent->cmd; + +cmd_free_index (cmd, ent->idx); +up (ent->page_queue ? &cmd->pages_sem : &cmd->sem); + }cmd_free_ent (ent); }
@@ -1582,8 +1586,6 @@ static void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u64 vec, bool force vector = vec &0xffffffff ;for (i =0 ; i < (1 << cmd->log_sz); i++) {if (test_bit (i, &vector)) { -struct semaphore *sem; - ent = cmd->ent_arr[i];/* if we already completed the command, ignore it */
@@ -1606,10 +1608,6 @@ static void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u64 vec, bool force dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR)cmd_ent_put (ent); -if (ent->page_queue) - sem = &cmd->pages_sem; -else - sem = &cmd->sem; ent->ts2 =ktime_get_ns ();memcpy (ent->out->first.data, ent->lay->out,sizeof (ent->lay->out));dump_command (dev, ent,0 );
@@ -1663,7 +1661,6 @@ static void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u64 vec, bool force*/ complete (&ent->done); } -up (sem); } } }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 226/563 spi: spi-meson-spifc: Add missing pm_runtime_disable() in meson_spifc_probe
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 69c1b87516e327a60b39f96b778fe683259408bf ]
If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable().
Add missing pm_runtime_disable() for meson_spifc_probe.
--- drivers/spi/spi-meson-spifc.c | 1 + 1 file changed, 1 insertion(+)
drivers/spi/spi-meson-spifc.c +1 -0
@@ -349,6 +349,7 @@ static int meson_spifc_probe(struct platform_device *pdev)return 0 ; out_clk:clk_disable_unprepare (spifc->clk); +pm_runtime_disable (spifc->dev); out_err:spi_master_put (master);return ret;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 232/563 tpm_tis: Fix an error handling path in tpm_tis_core_init()
In reply to Greg Kroah-HartmanFrom: Christophe Jaillet <[email protected]>
[ Upstream commit e96d52822f5ac0a25de78f95cd23421bcbc93584 ]
Commit 79ca6f74dae0 ("tpm: fix Atmel TPM crash caused by too frequent queries") has moved some code around without updating the error handling path.
This is now pointless to 'goto out_err' when neither 'clk_enable()' nor 'ioremap()' have been called yet.
Make a direct return instead to avoid undoing things that have not been done.
--- drivers/char/tpm/tpm_tis_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_tis_core.c +1 -1
@@ -952,7 +952,7 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, rc =tpm_tis_read32 (priv,TPM_DID_VID (0 ), &vendor);if (rc <0 ) - goto out_err; +return rc; priv->manufacturer_id = vendor;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 234/563 can: xilinx_can: xcan_probe(): check for error irq
In reply to Greg Kroah-HartmanFrom: Jiasheng Jiang <[email protected]>
[ Upstream commit c6564c13dae25cd7f8e1de5127b4da4500ee5844 ]
For the possible failure of the platform_get_irq(), the returned irq could be error number and will finally cause the failure of the request_irq().
Consider that platform_get_irq() can now in certain cases return -EPROBE_DEFER, and the consequences of letting request_irq() effectively convert that into -EINVAL, even at probe time rather than later on. So it might be better to check just now.
--- drivers/net/can/xilinx_can.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/can/xilinx_can.c +6 -1
@@ -1762,7 +1762,12 @@ static int xcan_probe(struct platform_device *pdev)spin_lock_init (&priv->tx_lock);/* Get IRQ for the device */ - ndev->irq =platform_get_irq (pdev,0 ); + ret =platform_get_irq (pdev,0 ); +if (ret <0 ) + goto err_free; + + ndev->irq = ret; + ndev->flags |=IFF_ECHO ;/* We support local echo */ platform_set_drvdata (pdev, ndev);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 236/563 iwlwifi: mvm: Use div_s64 instead of do_div in iwl_mvm_ftm_rtt_smoothing()
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 4ccdcc8ffd955490feec05380223db6a48961eb5 ]
When building ARCH=arm allmodconfig:
drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c: In function ‘iwl_mvm_ftm_rtt_smoothing’:./include/asm-generic/div64.h:222:35: error: comparison of distinct pointer types lacks a cast [-Werror]
222 | (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
| ^~drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c:1070:9: note: in expansion of macro ‘do_div’
1070 | do_div(rtt_avg, 100);
| ^~~~~~do_div() has to be used with an unsigned 64-bit integer dividend but rtt_avg is a signed 64-bit integer.
div_s64() expects a signed 64-bit integer dividend and signed 32-bit divisor, which fits this scenario, so use that function here to fix the warning.
--- drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +1 -2
@@ -967,8 +967,7 @@ static void iwl_mvm_ftm_rtt_smoothing(struct iwl_mvm *mvm, overshoot =IWL_MVM_FTM_INITIATOR_SMOOTH_OVERSHOOT ; alpha =IWL_MVM_FTM_INITIATOR_SMOOTH_ALPHA ; - rtt_avg = alpha * rtt + (100 - alpha) * resp->rtt_avg; -do_div (rtt_avg,100 ); + rtt_avg =div_s64 (alpha * rtt + (100 - alpha) * resp->rtt_avg,100 ); IWL_DEBUG_INFO(mvm, "%pM: prev rtt_avg=%lld, new rtt_avg=%lld, rtt=%lld\n",
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 237/563 net: mcs7830: handle usb read errors properly
In reply to Greg Kroah-HartmanFrom: Pavel Skripkin <[email protected]>
[ Upstream commit d668769eb9c52b150753f1653f7f5a0aeb8239d2 ]
Syzbot reported uninit value in mcs7830_bind(). The problem was in missing validation check for bytes read via usbnet_read_cmd().
usbnet_read_cmd() internally calls usb_control_msg(), that returns number of bytes read. Code should validate that requested number of bytes was actually read.
So, this patch adds missing size validation check inside mcs7830_get_reg() to prevent uninit value bugs
--- drivers/net/usb/mcs7830.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/net/usb/mcs7830.c +10 -2
@@ -108,8 +108,16 @@ static const char driver_name[] = "MOSCHIP usb-ethernet driver";static int mcs7830_get_reg (struct usbnet *dev,u16 index,u16 size,void *data) { -return usbnet_read_cmd (dev,MCS7830_RD_BREQ ,MCS7830_RD_BMREQ , -0x0000 , index, data, size); +int ret; + + ret =usbnet_read_cmd (dev,MCS7830_RD_BREQ ,MCS7830_RD_BMREQ , +0x0000 , index, data, size); +if (ret <0 ) +return ret; +else if (ret < size) +return -ENODATA ; + +return ret; }static int mcs7830_set_reg (struct usbnet *dev,u16 index,u16 size,const void *data)
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 243/563 RDMA/hns: Validate the pkey index
In reply to Greg Kroah-HartmanFrom: Kamal Heib <[email protected]>
[ Upstream commit 2a67fcfa0db6b4075515bd23497750849b88850f ]
Before query pkey, make sure that the queried index is valid.
--- drivers/infiniband/hw/hns/hns_roce_main.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/infiniband/hw/hns/hns_roce_main.c +3 -0
@@ -279,6 +279,9 @@ static enum rdma_link_layer hns_roce_get_link_layer(struct ib_device *device,static int hns_roce_query_pkey (struct ib_device *ib_dev,u8 port,u16 index,u16 *pkey) { +if (index >0 ) +return -EINVAL ; + *pkey =PKEY_ID ;return 0 ;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 215/563 HID: hid-uclogic-params: Invalid parameter check in uclogic_params_init
In reply to Greg Kroah-HartmanFrom: José Expósito <[email protected]>
[ Upstream commit f364c571a5c77e96de2d32062ff019d6b8d2e2bc ]
The function performs a check on its input parameters, however, the hdev parameter is used before the check.
Initialize the stack variables after checking the input parameters to avoid a possible NULL pointer dereference.
Addresses-Coverity-ID: 1443831 ("Null pointer dereference")
--- drivers/hid/hid-uclogic-params.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/hid/hid-uclogic-params.c +9 -4
@@ -832,10 +832,10 @@ int uclogic_params_init(struct uclogic_params *params, struct hid_device *hdev) {int rc; -struct usb_device *udev =hid_to_usb_dev (hdev); -__u8 bNumInterfaces = udev->config->desc.bNumInterfaces; -struct usb_interface *iface =to_usb_interface (hdev->dev.parent); -__u8 bInterfaceNumber = iface->cur_altsetting->desc.bInterfaceNumber; +struct usb_device *udev; +__u8 bNumInterfaces; +struct usb_interface *iface; +__u8 bInterfaceNumber;bool found;/* The resulting parameters (noop) */ struct uclogic_params p = {0 , };
@@ -846,6 +846,11 @@ int uclogic_params_init(struct uclogic_params *params, goto cleanup; } + udev =hid_to_usb_dev (hdev); + bNumInterfaces = udev->config->desc.bNumInterfaces; + iface =to_usb_interface (hdev->dev.parent); + bInterfaceNumber = iface->cur_altsetting->desc.bInterfaceNumber; +/* * Set replacement report descriptor if the original matches the * specified size. Otherwise keep interface unchanged.
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 244/563 scsi: pm80xx: Update WARN_ON check in pm8001_mpi_build_cmd()
In reply to Greg Kroah-HartmanFrom: Igor Pylypiv <[email protected]>
[ Upstream commit 606c54ae975ad3af540b505b46b55a687501711f ]
Starting from commit 05c6c029a44d ("scsi: pm80xx: Increase number of supported queues") driver initializes only max_q_num queues. Do not use an invalid queue if the WARN_ON condition is true.
--- drivers/scsi/pm8001/pm8001_hwi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/pm8001/pm8001_hwi.c +3 -1
@@ -1323,7 +1323,9 @@ int pm8001_mpi_build_cmd(struct pm8001_hba_info *pm8001_ha,int q_index = circularQ - pm8001_ha->inbnd_q_tbl;int rv =-1 ; -WARN_ON (q_index >=PM8001_MAX_INB_NUM ); +if (WARN_ON (q_index >= pm8001_ha->max_q_num)) +return -EINVAL ; +spin_lock_irqsave (&circularQ->iq_lock, flags); rv =pm8001_mpi_msg_free_get (circularQ, pm8001_ha->iomb_size, &pMessage);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 217/563 HID: hid-uclogic-params: Invalid parameter check in uclogic_params_huion_init
In reply to Greg Kroah-HartmanFrom: José Expósito <[email protected]>
[ Upstream commit ff6b548afe4d9d1ff3a0f6ef79e8cbca25d8f905 ]
The function performs a check on its input parameters, however, the hdev parameter is used before the check.
Initialize the stack variables after checking the input parameters to avoid a possible NULL pointer dereference.
Addresses-Coverity-ID: 1443804 ("Null pointer dereference")
--- drivers/hid/hid-uclogic-params.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/hid/hid-uclogic-params.c +7 -3
@@ -707,9 +707,9 @@ static int uclogic_params_huion_init(struct uclogic_params *params, struct hid_device *hdev) {int rc; -struct usb_device *udev =hid_to_usb_dev (hdev); -struct usb_interface *iface =to_usb_interface (hdev->dev.parent); -__u8 bInterfaceNumber = iface->cur_altsetting->desc.bInterfaceNumber; +struct usb_device *udev; +struct usb_interface *iface; +__u8 bInterfaceNumber;bool found;/* The resulting parameters (noop) */ struct uclogic_params p = {0 , };
@@ -723,6 +723,10 @@ static int uclogic_params_huion_init(struct uclogic_params *params, goto cleanup; } + udev =hid_to_usb_dev (hdev); + iface =to_usb_interface (hdev->dev.parent); + bInterfaceNumber = iface->cur_altsetting->desc.bInterfaceNumber; +/* If it's not a pen interface */ if (bInterfaceNumber !=0 ) {/* TODO: Consider marking the interface invalid */
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 216/563 HID: hid-uclogic-params: Invalid parameter check in uclogic_params_get_str_desc
In reply to Greg Kroah-HartmanFrom: José Expósito <[email protected]>
[ Upstream commit 0a94131d6920916ccb6a357037c535533af08819 ]
The function performs a check on the hdev input parameters, however, it is used before the check.
Initialize the udev variable after the sanity check to avoid a possible NULL pointer dereference.
Addresses-Coverity-ID: 1443827 ("Null pointer dereference")
--- drivers/hid/hid-uclogic-params.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hid/hid-uclogic-params.c +3 -1
@@ -65,7 +65,7 @@ static int uclogic_params_get_str_desc(__u8 **pbuf, struct hid_device *hdev, __u8 idx, size_t len) {int rc; -struct usb_device *udev =hid_to_usb_dev (hdev); +struct usb_device *udev;__u8 *buf =NULL ;/* Check arguments */
@@ -74,6 +74,8 @@ static int uclogic_params_get_str_desc(__u8 **pbuf, struct hid_device *hdev, goto cleanup; } + udev =hid_to_usb_dev (hdev); + buf =kmalloc (len,GFP_KERNEL );if (buf ==NULL ) { rc = -ENOMEM ;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 219/563 debugfs: lockdown: Allow reading debugfs files that are not world readable
In reply to Greg Kroah-HartmanFrom: Michal Suchanek <[email protected]>
[ Upstream commit 358fcf5ddbec4e6706405847d6a666f5933a6c25 ]
When the kernel is locked down the kernel allows reading only debugfs files with mode 444. Mode 400 is also valid but is not allowed.
Make the 444 into a mask.
--- fs/debugfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/debugfs/file.c +1 -1
@@ -147,7 +147,7 @@ static int debugfs_locked_down(struct inode *inode, struct file *filp, const struct file_operations *real_fops) { - if ((inode->i_mode & 07777) == 0444 && + if ((inode->i_mode & 07777 & ~0444) == 0 && !(filp->f_mode & FMODE_WRITE) && !real_fops->unlocked_ioctl && !real_fops->compat_ioctl &&
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 210/563 staging: greybus: audio: Check null pointer
In reply to Greg Kroah-HartmanFrom: Jiasheng Jiang <[email protected]>
[ Upstream commit 2e81948177d769106754085c3e03534e6cc1f623 ]
As the possible alloc failure of devm_kcalloc(), it could return null pointer.
Therefore, 'strings' should be checked and return NULL if alloc fails to prevent the dereference of the NULL pointer.
Also, the caller should also deal with the return value of the gb_generate_enum_strings() and return -ENOMEM if returns NULL. Moreover, because the memory allocated with devm_kzalloc() will be freed automatically when the last reference to the device is dropped, the 'gbe' in gbaudio_tplg_create_enum_kctl() and gbaudio_tplg_create_enum_ctl() do not need to free manually. But the 'control' in gbaudio_tplg_create_widget() and gbaudio_tplg_process_kcontrols() has a specially error handle to cleanup.
So it should be better to cleanup 'control' when fails.
--- drivers/staging/greybus/audio_topology.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/staging/greybus/audio_topology.c +15 -0
@@ -147,6 +147,9 @@ static const char **gb_generate_enum_strings(struct gbaudio_module_info *gb, items =le32_to_cpu (gbenum->items); strings =devm_kcalloc (gb->dev, items,sizeof (char *),GFP_KERNEL ); +if (!strings) +return NULL ; + data = gbenum->names;for (i =0 ; i < items; i++) {
@@ -655,6 +658,8 @@ static int gbaudio_tplg_create_enum_kctl(struct gbaudio_module_info *gb,/* since count=1, and reg is dummy */ gbe->items =le32_to_cpu (gb_enum->items); gbe->texts =gb_generate_enum_strings (gb, gb_enum); +if (!gbe->texts) +return -ENOMEM ;/* debug enum info */ dev_dbg(gb->dev, "Max:%d, name_length:%d\n", gbe->items,
@@ -862,6 +867,8 @@ static int gbaudio_tplg_create_enum_ctl(struct gbaudio_module_info *gb,/* since count=1, and reg is dummy */ gbe->items =le32_to_cpu (gb_enum->items); gbe->texts =gb_generate_enum_strings (gb, gb_enum); +if (!gbe->texts) +return -ENOMEM ;/* debug enum info */ dev_dbg(gb->dev, "Max:%d, name_length:%d\n", gbe->items,
@@ -1072,6 +1079,10 @@ static int gbaudio_tplg_create_widget(struct gbaudio_module_info *module, csize +=le16_to_cpu (gbenum->names_length); control->texts = (const char *const *)gb_generate_enum_strings (module, gbenum); +if (!control->texts) { + ret = -ENOMEM ; + goto error; + } control->items =le32_to_cpu (gbenum->items); }else { csize =sizeof (struct gb_audio_control );
@@ -1181,6 +1192,10 @@ static int gbaudio_tplg_process_kcontrols(struct gbaudio_module_info *module, csize +=le16_to_cpu (gbenum->names_length); control->texts = (const char *const *)gb_generate_enum_strings (module, gbenum); +if (!control->texts) { + ret = -ENOMEM ; + goto error; + } control->items =le32_to_cpu (gbenum->items); }else { csize =sizeof (struct gb_audio_control );
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 256/563 clocksource: Avoid accidental unstable marking of clocksources
In reply to Greg Kroah-HartmanFrom: Waiman Long <[email protected]>
[ Upstream commit c86ff8c55b8ae68837b2fa59dc0c203907e9a15f ]
Since commit db3a34e17433 ("clocksource: Retry clock read if long delays detected") and commit 2e27e793e280 ("clocksource: Reduce clocksource-skew threshold"), it is found that tsc clocksource fallback to hpet can sometimes happen on both Intel and AMD systems especially when they are running stressful benchmarking workloads. Of the 23 systems tested with a v5.14 kernel, 10 of them have switched to hpet clock source during the test run.
The result of falling back to hpet is a drastic reduction of performance when running benchmarks. For example, the fio performance tests can drop up to 70% whereas the iperf3 performance can drop up to 80%.
4 hpet fallbacks happened during bootup. They were:
[ 8.749399] clocksource: timekeeping watchdog on CPU13: hpet read-back delay of 263750ns, attempt 4, marking unstable [ 12.044610] clocksource: timekeeping watchdog on CPU19: hpet read-back delay of 186166ns, attempt 4, marking unstable [ 17.336941] clocksource: timekeeping watchdog on CPU28: hpet read-back delay of 182291ns, attempt 4, marking unstable [ 17.518565] clocksource: timekeeping watchdog on CPU34: hpet read-back delay of 252196ns, attempt 4, marking unstable
Other fallbacks happen when the systems were running stressful benchmarks. For example:
[ 2685.867873] clocksource: timekeeping watchdog on CPU117: hpet read-back delay of 57269ns, attempt 4, marking unstable [46215.471228] clocksource: timekeeping watchdog on CPU8: hpet read-back delay of 61460ns, attempt 4, marking unstable
Commit 2e27e793e280 ("clocksource: Reduce clocksource-skew threshold"), changed the skew margin from 100us to 50us. I think this is too small and can easily be exceeded when running some stressful workloads on a thermally stressed system. So it is switched back to 100us.
Even a maximum skew margin of 100us may be too small in for some systems when booting up especially if those systems are under thermal stress. To eliminate the case that the large skew is due to the system being too busy slowing down the reading of both the watchdog and the clocksource, an extra consecutive read of watchdog clock is being done to check this.
The consecutive watchdog read delay is compared against WATCHDOG_MAX_SKEW/2. If the delay exceeds the limit, we assume that the system is just too busy. A warning will be printed to the console and the clock skew check is skipped for this round.
--- kernel/time/clocksource.c | 50 ++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 9 deletions(-)
kernel/time/clocksource.c +41 -9
@@ -105,7 +105,7 @@ static u64 suspend_start;* This delay could be due to SMIs, NMIs, or to VCPU preemptions. Used as * a lower bound for cs->uncertainty_margin values when registering clocks. */ -#define WATCHDOG_MAX_SKEW (50 * NSEC_PER_USEC) +#define WATCHDOG_MAX_SKEW (100 * NSEC_PER_USEC)#ifdef CONFIG_CLOCKSOURCE_WATCHDOG static void clocksource_watchdog_work (struct work_struct *work);
@@ -200,17 +200,24 @@ void clocksource_mark_unstable(struct clocksource *cs)static ulong max_cswd_read_retries =3 ;module_param (max_cswd_read_retries, ulong,0644 ); -static bool cs_watchdog_read (struct clocksource *cs,u64 *csnow,u64 *wdnow) +enum wd_read_status { +WD_READ_SUCCESS , +WD_READ_UNSTABLE , +WD_READ_SKIP +}; + +static enum wd_read_status cs_watchdog_read (struct clocksource *cs,u64 *csnow,u64 *wdnow) {unsigned int nretries; -u64 wd_end, wd_delta; -int64_t wd_delay; +u64 wd_end, wd_end2, wd_delta; +int64_t wd_delay, wd_seq_delay;for (nretries =0 ; nretries <= max_cswd_read_retries; nretries++) {local_irq_disable (); *wdnow = watchdog->read (watchdog); *csnow = cs->read (cs); wd_end = watchdog->read (watchdog); + wd_end2 = watchdog->read (watchdog);local_irq_enable (); wd_delta =clocksource_delta (wd_end, *wdnow, watchdog->mask);
@@ -221,13 +228,34 @@ static bool cs_watchdog_read(struct clocksource *cs, u64 *csnow, u64 *wdnow)pr_warn ("timekeeping watchdog on CPU%d: %s retried %d times before success\n" ,smp_processor_id (), watchdog->name, nretries); } -return true; +return WD_READ_SUCCESS ; } + +/* +* Now compute delay in consecutive watchdog read to see if +* there is too much external interferences that cause +* significant delay in reading both clocksource and watchdog. +* +* If consecutive WD read-back delay > WATCHDOG_MAX_SKEW/2, +* report system busy, reinit the watchdog and skip the current +* watchdog test. +*/ + wd_delta =clocksource_delta (wd_end2, wd_end, watchdog->mask); + wd_seq_delay =clocksource_cyc2ns (wd_delta, watchdog->mult, watchdog->shift); +if (wd_seq_delay >WATCHDOG_MAX_SKEW /2 ) + goto skip_test; }pr_warn ("timekeeping watchdog on CPU%d: %s read-back delay of %lldns, attempt %d, marking unstable\n" ,smp_processor_id (), watchdog->name, wd_delay, nretries); -return false; +return WD_READ_UNSTABLE ; + +skip_test: +pr_info ("timekeeping watchdog on CPU%d: %s wd-wd read-back delay of %lldns\n" , +smp_processor_id (), watchdog->name, wd_seq_delay); +pr_info ("wd-%s-wd read-back delay of %lldns, clock-skew test skipped!\n" , + cs->name, wd_delay); +return WD_READ_SKIP ; }static u64 csnow_mid;
@@ -290,6 +318,7 @@ static void clocksource_watchdog(struct timer_list *unused)int next_cpu, reset_pending;int64_t wd_nsec, cs_nsec;struct clocksource *cs; +enum wd_read_status read_ret;u32 md;spin_lock (&watchdog_lock);
@@ -307,9 +336,12 @@ static void clocksource_watchdog(struct timer_list *unused)continue ; } -if (!cs_watchdog_read (cs, &csnow, &wdnow)) { -/* Clock readout unreliable, so give it up. */ -__clocksource_unstable (cs); + read_ret =cs_watchdog_read (cs, &csnow, &wdnow); + +if (read_ret !=WD_READ_SUCCESS ) { +if (read_ret ==WD_READ_UNSTABLE ) +/* Clock readout unreliable, so give it up. */ +__clocksource_unstable (cs);continue ; }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 258/563 ALSA: usb-audio: Drop superfluous 0 in Presonus Studio 1810cs ID
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
[ Upstream commit 1e583aef12aa74afd37c1418255cc4b74e023236 ]
The vendor ID of Presonus Studio 1810c had a superfluous '0' in its USB ID. Drop it.
--- sound/usb/format.c | 2 +- sound/usb/mixer_quirks.c | 2 +- sound/usb/quirks.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
sound/usb/format.c +1 -1
@@ -365,7 +365,7 @@ static int parse_uac2_sample_rate_range(struct snd_usb_audio *chip,for (rate = min; rate <= max; rate += res) {/* Filter out invalid rates on Presonus Studio 1810c */ -if (chip->usb_id ==USB_ID (0x0194f ,0x010c ) && +if (chip->usb_id ==USB_ID (0x194f ,0x010c ) && !s1810c_valid_sample_rate (fp, rate)) goto skip_rate;
sound/usb/mixer_quirks.c +1 -1
@@ -3033,7 +3033,7 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) err =snd_rme_controls_create (mixer);break ; -case USB_ID (0x0194f ,0x010c ):/* Presonus Studio 1810c */ +case USB_ID (0x194f ,0x010c ):/* Presonus Studio 1810c */ err =snd_sc1810_init_mixer (mixer);break ;case USB_ID (0x2a39 ,0x3fb0 ):/* RME Babyface Pro FS */
sound/usb/quirks.c +1 -1
@@ -1310,7 +1310,7 @@ int snd_usb_apply_interface_quirk(struct snd_usb_audio *chip,if (chip->usb_id ==USB_ID (0x0763 ,0x2012 ))return fasttrackpro_skip_setting_quirk (chip, iface, altno);/* presonus studio 1810c: skip altsets incompatible with device_setup */ -if (chip->usb_id ==USB_ID (0x0194f ,0x010c )) +if (chip->usb_id ==USB_ID (0x194f ,0x010c ))return s1810c_skip_setting_quirk (chip, iface, altno);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 379/563 um: registers: Rename function names to avoid conflicts and build problems
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit 077b7320942b64b0da182aefd83c374462a65535 ]
The function names init_registers() and restore_registers() are used in several net/ethernet/ and gpu/drm/ drivers for other purposes (not calls to UML functions), so rename them.
This fixes multiple build errors.
--- arch/um/include/shared/registers.h | 4 ++-- arch/um/os-Linux/registers.c | 4 ++-- arch/um/os-Linux/start_up.c | 2 +- arch/x86/um/syscalls_64.c | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-)
arch/um/include/shared/registers.h +2 -2
@@ -16,8 +16,8 @@ extern int restore_fp_registers(int pid, unsigned long *fp_regs);extern int save_fpx_registers (int pid,unsigned long *fp_regs);extern int restore_fpx_registers (int pid,unsigned long *fp_regs);extern int save_registers (int pid,struct uml_pt_regs *regs); -extern int restore_registers (int pid,struct uml_pt_regs *regs); -extern int init_registers (int pid); +extern int restore_pid_registers (int pid,struct uml_pt_regs *regs); +extern int init_pid_registers (int pid);extern void get_safe_registers (unsigned long *regs,unsigned long *fp_regs);extern unsigned long get_thread_reg (int reg,jmp_buf *buf);extern int get_fp_registers (int pid,unsigned long *regs);
arch/um/os-Linux/registers.c +2 -2
@@ -21,7 +21,7 @@ int save_registers(int pid, struct uml_pt_regs *regs)return 0 ; } -int restore_registers (int pid,struct uml_pt_regs *regs) +int restore_pid_registers (int pid,struct uml_pt_regs *regs) {int err;
@@ -36,7 +36,7 @@ int restore_registers(int pid, struct uml_pt_regs *regs)static unsigned long exec_regs[MAX_REG_NR ];static unsigned long exec_fp_regs[FP_SIZE ]; -int init_registers (int pid) +int init_pid_registers (int pid) {int err;
arch/um/os-Linux/start_up.c +1 -1
@@ -336,7 +336,7 @@ void __init os_early_checks(void)check_tmpexec (); pid =start_ptraced_child (); -if (init_registers (pid)) +if (init_pid_registers (pid))fatal ("Failed to initialize default registers" );stop_ptraced_child (pid,1 ,1 ); }
arch/x86/um/syscalls_64.c +2 -1
@@ -11,6 +11,7 @@#include <linux/uaccess.h> #include <asm/prctl.h> /* XXX This should get the constants from libc */ #include <os.h> +#include <registers.h> long arch_prctl (struct task_struct *task,int option,unsigned long __user *arg2)
@@ -35,7 +36,7 @@ long arch_prctl(struct task_struct *task, int option,switch (option) {case ARCH_SET_FS :case ARCH_SET_GS : - ret =restore_registers (pid, ¤t->thread.regs.regs); + ret =restore_pid_registers (pid, ¤t->thread.regs.regs);if (ret)return ret;break ;
Signature · 9 lines
2.34.1 _______________________________________________ linux-um mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-um
Greg Kroah-Hartman
maintainerPATCH 260/563 binder: fix handling of error during copy
In reply to Greg Kroah-HartmanFrom: Todd Kjos <[email protected]>
[ Upstream commit fe6b1869243f23a485a106c214bcfdc7aa0ed593 ]
If a memory copy function fails to copy the whole buffer, a positive integar with the remaining bytes is returned. In binder_translate_fd_array() this can result in an fd being skipped due to the failed copy, but the loop continues processing fds since the early return condition expects a negative integer on error.
Fix by returning "ret > 0 ? -EINVAL : ret" to handle this case.
--- drivers/android/binder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/android/binder.c +2 -2
@@ -2657,8 +2657,8 @@ static int binder_translate_fd_array(struct binder_fd_array_object *fda,if (!ret) ret =binder_translate_fd (fd, offset, t, thread, in_reply_to); -if (ret <0 ) -return ret; +if (ret) +return ret >0 ? -EINVAL : ret; }return 0 ; }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 261/563 openrisc: Add clone3 ABI wrapper
In reply to Greg Kroah-HartmanFrom: Stafford Horne <[email protected]>
[ Upstream commit 433fe39f674d58bc7a3e8254a5d2ffc290b7e04e ]
Like fork and clone the clone3 syscall needs a wrapper to save callee saved registers, which is required by the OpenRISC ABI. This came up after auditing code following a discussion with Rob Landley and Arnd Bergmann [0].
Tested with the clone3 kselftests and there were no issues.
[0] https://lore.kernel.org/all/[email protected]/T/#m9c0cdb2703813b9df4da04cf6b30de1f1aa89944
--- arch/openrisc/include/asm/syscalls.h | 2 ++ arch/openrisc/kernel/entry.S | 5 +++++ 2 files changed, 7 insertions(+)
arch/openrisc/include/asm/syscalls.h +2 -0
@@ -22,9 +22,11 @@ asmlinkage long sys_or1k_atomic(unsigned long type, unsigned long *v1,asmlinkage long __sys_clone (unsigned long clone_flags,unsigned long newsp,void __user *parent_tid,void __user *child_tid,int tls); +asmlinkage long __sys_clone3 (struct clone_args __user *uargs,size_t size);asmlinkage long __sys_fork (void );#define sys_clone __sys_clone +#define sys_clone3 __sys_clone3#define sys_fork __sys_fork#endif /* __ASM_OPENRISC_SYSCALLS_H */
arch/openrisc/kernel/entry.S +5 -0
@@ -1170,6 +1170,11 @@ ENTRY(__sys_clone) l.j _fork_save_extra_regs_and_call l.nop +ENTRY(__sys_clone3) + l.movhi r29,hi(sys_clone3) + l.j _fork_save_extra_regs_and_call + l.ori r29,r29,lo(sys_clone3) + ENTRY(__sys_fork) l.movhi r29,hi(sys_fork) l.ori r29,r29,lo(sys_fork)
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 263/563 iommu/io-pgtable-arm: Fix table descriptor paddr formatting
In reply to Greg Kroah-HartmanFrom: Hector Martin <[email protected]>
[ Upstream commit 9abe2ac834851a7d0b0756e295cf7a292c45ca53 ]
Table descriptors were being installed without properly formatting the address using paddr_to_iopte, which does not match up with the iopte_deref in __arm_lpae_map. This is incorrect for the LPAE pte format, as it does not handle the high bits properly.
This was found on Apple T6000 DARTs, which require a new pte format (different shift); adding support for that to paddr_to_iopte/iopte_to_paddr caused it to break badly, as even <48-bit addresses would end up incorrect in that case.
--- drivers/iommu/io-pgtable-arm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/iommu/io-pgtable-arm.c +5 -4
@@ -302,11 +302,12 @@ static int arm_lpae_init_pte(struct arm_lpae_io_pgtable *data,static arm_lpae_iopte arm_lpae_install_table (arm_lpae_iopte *table,arm_lpae_iopte *ptep,arm_lpae_iopte curr, -struct io_pgtable_cfg *cfg) +struct arm_lpae_io_pgtable *data) {arm_lpae_iopte old, new; +struct io_pgtable_cfg *cfg = &data->iop.cfg; - new =__pa (table) |ARM_LPAE_PTE_TYPE_TABLE ; + new =paddr_to_iopte (__pa (table), data) |ARM_LPAE_PTE_TYPE_TABLE ;if (cfg->quirks &IO_PGTABLE_QUIRK_ARM_NS ) new |=ARM_LPAE_PTE_NSTABLE ;
@@ -357,7 +358,7 @@ static int __arm_lpae_map(struct arm_lpae_io_pgtable *data, unsigned long iova,if (!cptep)return -ENOMEM ; - pte =arm_lpae_install_table (cptep, ptep,0 , cfg); + pte =arm_lpae_install_table (cptep, ptep,0 , data);if (pte)__arm_lpae_free_pages (cptep, tblsz, cfg); }else if (!cfg->coherent_walk && !(pte &ARM_LPAE_PTE_SW_SYNC )) {
@@ -546,7 +547,7 @@ static size_t arm_lpae_split_blk_unmap(struct arm_lpae_io_pgtable *data,__arm_lpae_init_pte (data, blk_paddr, pte, lvl, &tablep[i]); } - pte =arm_lpae_install_table (tablep, ptep, blk_pte, cfg); + pte =arm_lpae_install_table (tablep, ptep, blk_pte, data);if (pte != blk_pte) {__arm_lpae_free_pages (tablep, tablesz, cfg);/*
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 264/563 scsi: ufs: Fix race conditions related to driver data
In reply to Greg Kroah-HartmanFrom: Bart Van Assche <[email protected]>
[ Upstream commit 21ad0e49085deb22c094f91f9da57319a97188e4 ]
The driver data pointer must be set before any callbacks are registered that use that pointer. Hence move the initialization of that pointer from after the ufshcd_init() call to inside ufshcd_init().
--- drivers/scsi/ufs/tc-dwc-g210-pci.c | 1 - drivers/scsi/ufs/ufshcd-pci.c | 2 -- drivers/scsi/ufs/ufshcd-pltfrm.c | 2 -- drivers/scsi/ufs/ufshcd.c | 7 +++++++ 4 files changed, 7 insertions(+), 5 deletions(-)
drivers/scsi/ufs/tc-dwc-g210-pci.c +0 -1
@@ -135,7 +135,6 @@ tc_dwc_g210_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)return err; } -pci_set_drvdata (pdev, hba);pm_runtime_put_noidle (&pdev->dev);pm_runtime_allow (&pdev->dev);
drivers/scsi/ufs/ufshcd-pci.c +0 -2
@@ -347,8 +347,6 @@ ufshcd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)return err; } -pci_set_drvdata (pdev, hba); - hba->vops = (struct ufs_hba_variant_ops *)id->driver_data; err =ufshcd_init (hba, mmio_base, pdev->irq);
drivers/scsi/ufs/ufshcd-pltfrm.c +0 -2
@@ -412,8 +412,6 @@ int ufshcd_pltfrm_init(struct platform_device *pdev, goto dealloc_host; } -platform_set_drvdata (pdev, hba); -pm_runtime_set_active (&pdev->dev);pm_runtime_enable (&pdev->dev);
drivers/scsi/ufs/ufshcd.c +7 -0
@@ -9085,6 +9085,13 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)struct device *dev = hba->dev;char eh_wq_name[sizeof ("ufs_eh_wq_00" )]; +/* +* dev_set_drvdata() must be called before any callbacks are registered +* that use dev_get_drvdata() (frequency scaling, clock scaling, hwmon, +* sysfs). +*/ +dev_set_drvdata (dev, hba); +if (!mmio_base) {dev_err (hba->dev,"Invalid memory reference for mmio_base is NULL\n" );
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 265/563 RDMA/qedr: Fix reporting max_{send/recv}_wr attrs
In reply to Greg Kroah-HartmanFrom: Kamal Heib <[email protected]>
[ Upstream commit b1a4da64bfc189510e08df1ccb1c589e667dc7a3 ]
Fix the wrongly reported max_send_wr and max_recv_wr attributes for user QP by making sure to save their valuse on QP creation, so when query QP is called the attributes will be reported correctly.
--- drivers/infiniband/hw/qedr/verbs.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/infiniband/hw/qedr/verbs.c +2 -0
@@ -1918,6 +1918,7 @@ static int qedr_create_user_qp(struct qedr_dev *dev,/* db offset was calculated in copy_qp_uresp, now set in the user q */ if (qedr_qp_has_sq (qp)) { qp->usq.db_addr = ctx->dpi_addr + uresp.sq_db_offset; + qp->sq.max_wr = attrs->cap.max_send_wr; rc = qedr_db_recovery_add(dev, qp->usq.db_addr, &qp->usq.db_rec_data->db_data, DB_REC_WIDTH_32B,
@@ -1928,6 +1929,7 @@ static int qedr_create_user_qp(struct qedr_dev *dev,if (qedr_qp_has_rq (qp)) { qp->urq.db_addr = ctx->dpi_addr + uresp.rq_db_offset; + qp->rq.max_wr = attrs->cap.max_recv_wr; rc = qedr_db_recovery_add(dev, qp->urq.db_addr, &qp->urq.db_rec_data->db_data, DB_REC_WIDTH_32B,
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 269/563 RDMA/cma: Let cma_resolve_ib_dev() continue search even after empty entry
In reply to Greg Kroah-HartmanFrom: Avihai Horon <[email protected]>
[ Upstream commit 20679094a0161c94faf77e373fa3f7428a8e14bd ]
Currently, when cma_resolve_ib_dev() searches for a matching GID it will stop searching after encountering the first empty GID table entry. This behavior is wrong since neither IB nor RoCE spec enforce tightly packed GID tables.
For example, when the matching valid GID entry exists at index N, and if a GID entry is empty at index N-1, cma_resolve_ib_dev() will fail to find the matching valid entry.
Fix it by making cma_resolve_ib_dev() continue searching even after encountering missing entries.
--- drivers/infiniband/core/cma.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/infiniband/core/cma.c +9 -3
@@ -775,6 +775,7 @@ static int cma_resolve_ib_dev(struct rdma_id_private *id_priv)unsigned int p;u16 pkey, index;enum ib_port_state port_state; +int ret;int i; cma_dev =NULL ;
@@ -793,9 +794,14 @@ static int cma_resolve_ib_dev(struct rdma_id_private *id_priv)if (ib_get_cached_port_state (cur_dev->device, p, &port_state))continue ; -for (i =0 ; !rdma_query_gid (cur_dev->device, - p, i, &gid); - i++) { + +for (i =0 ; i < cur_dev->device->port_data[p].immutable.gid_tbl_len; + ++i) { + ret =rdma_query_gid (cur_dev->device, p, i, + &gid); +if (ret) +continue ; +if (!memcmp (&gid, dgid,sizeof (gid))) { cma_dev = cur_dev; sgid = gid;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 268/563 RDMA/core: Let ib_find_gid() continue search even after empty entry
In reply to Greg Kroah-HartmanFrom: Avihai Horon <[email protected]>
[ Upstream commit 483d805191a23191f8294bbf9b4e94836f5d92e4 ]
Currently, ib_find_gid() will stop searching after encountering the first empty GID table entry. This behavior is wrong since neither IB nor RoCE spec enforce tightly packed GID tables.
For example, when a valid GID entry exists at index N, and if a GID entry is empty at index N-1, ib_find_gid() will fail to find the valid entry.
Fix it by making ib_find_gid() continue searching even after encountering missing entries.
--- drivers/infiniband/core/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/core/device.c +2 -1
@@ -2411,7 +2411,8 @@ int ib_find_gid(struct ib_device *device, union ib_gid *gid, ++i) { ret =rdma_query_gid (device, port, i, &tmp_gid);if (ret) -return ret; +continue ; +if (!memcmp (&tmp_gid, gid,sizeof *gid)) { *port_num = port;if (index)
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 270/563 ASoC: rt5663: Handle device_property_read_u32_array error codes
In reply to Greg Kroah-HartmanFrom: Jiasheng Jiang <[email protected]>
[ Upstream commit 2167c0b205960607fb136b4bb3c556a62be1569a ]
The return value of device_property_read_u32_array() is not always 0. To catch the exception in case that devm_kzalloc failed and the rt5663->imp_table was NULL, which caused the failure of device_property_read_u32_array.
--- sound/soc/codecs/rt5663.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
sound/soc/codecs/rt5663.c +9 -3
@@ -3461,6 +3461,7 @@ static void rt5663_calibrate(struct rt5663_priv *rt5663)static int rt5663_parse_dp (struct rt5663_priv *rt5663,struct device *dev) {int table_size; +int ret;device_property_read_u32 (dev,"realtek,dc_offset_l_manual" , &rt5663->pdata.dc_offset_l_manual);
@@ -3477,9 +3478,11 @@ static int rt5663_parse_dp(struct rt5663_priv *rt5663, struct device *dev) table_size =sizeof (struct impedance_mapping_table ) * rt5663->pdata.impedance_sensing_num; rt5663->imp_table =devm_kzalloc (dev, table_size,GFP_KERNEL ); -device_property_read_u32_array (dev, + ret =device_property_read_u32_array (dev,"realtek,impedance_sensing_table" , (u32 *)rt5663->imp_table, table_size); +if (ret) +return ret; }return 0 ;
@@ -3504,8 +3507,11 @@ static int rt5663_i2c_probe(struct i2c_client *i2c,if (pdata) rt5663->pdata = *pdata; -else -rt5663_parse_dp (rt5663, &i2c->dev); +else { + ret =rt5663_parse_dp (rt5663, &i2c->dev); +if (ret) +return ret; + }for (i =0 ; i <ARRAY_SIZE (rt5663->supplies); i++) rt5663->supplies[i].supply = rt5663_supply_names[i];
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 271/563 of: unittest: fix warning on PowerPC frame size warning
In reply to Greg Kroah-HartmanFrom: Jim Quinlan <[email protected]>
[ Upstream commit a8d61a9112ad0c9216ab45d050991e07bc4f3408 ]
The struct device variable "dev_bogus" was triggering this warning on a PowerPC build:
drivers/of/unittest.c: In function 'of_unittest_dma_ranges_one.constprop':
[...] >> The frame size of 1424 bytes is larger than 1024 bytes
[-Wframe-larger-than=]
This variable is now dynamically allocated.
--- drivers/of/unittest.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/of/unittest.c +12 -4
@@ -910,11 +910,18 @@ static void __init of_unittest_dma_ranges_one(const char *path,if (!rc) {phys_addr_t paddr;dma_addr_t dma_addr; -struct device dev_bogus; +struct device *dev_bogus; - dev_bogus.dma_range_map = map; - paddr =dma_to_phys (&dev_bogus, expect_dma_addr); - dma_addr =phys_to_dma (&dev_bogus, expect_paddr); + dev_bogus =kzalloc (sizeof (struct device ),GFP_KERNEL ); +if (!dev_bogus) { +unittest (0 ,"kzalloc() failed\n" ); +kfree (map); +return ; + } + + dev_bogus->dma_range_map = map; + paddr =dma_to_phys (dev_bogus, expect_dma_addr); + dma_addr =phys_to_dma (dev_bogus, expect_paddr); unittest(paddr == expect_paddr, "of_dma_get_range: wrong phys addr %pap (expecting %llx) on node %pOF\n",
@@ -924,6 +931,7 @@ static void __init of_unittest_dma_ranges_one(const char *path, &dma_addr, expect_dma_addr, np);kfree (map); + kfree(dev_bogus); }of_node_put (np);#endif
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 273/563 clk: stm32: Fix ltdcs clock turn off by clk_disable_unused() after system enter shell
In reply to Greg Kroah-HartmanFrom: Dillon Min <[email protected]>
[ Upstream commit 6fc058a72f3b7b07fc4de6d66ad1f68951b00f6e ]
stm32's clk driver register two ltdc gate clk to clk core by clk_hw_register_gate() and clk_hw_register_composite()
first: 'stm32f429_gates[]', clk name is 'ltdc', which no user to use.
second: 'stm32f429_aux_clk[]', clk name is 'lcd-tft', used by ltdc driver
both of them point to the same offset of stm32's RCC register. after kernel enter console, clk core turn off ltdc's clk as 'stm32f429_gates[]' is no one to use. but, actually 'stm32f429_aux_clk[]' is in use.
stm32f469/746/769 have the same issue, fix it.
--- drivers/clk/clk-stm32f4.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/clk/clk-stm32f4.c +0 -4
@@ -129,7 +129,6 @@ static const struct stm32f4_gate_data stm32f429_gates[] __initconst = { { STM32F4_RCC_APB2ENR, 20, "spi5", "apb2_div" }, { STM32F4_RCC_APB2ENR, 21, "spi6", "apb2_div" }, { STM32F4_RCC_APB2ENR, 22, "sai1", "apb2_div" }, - { STM32F4_RCC_APB2ENR, 26, "ltdc", "apb2_div" }, }; static const struct stm32f4_gate_data stm32f469_gates[] __initconst = {
@@ -211,7 +210,6 @@ static const struct stm32f4_gate_data stm32f469_gates[] __initconst = { { STM32F4_RCC_APB2ENR, 20, "spi5", "apb2_div" }, { STM32F4_RCC_APB2ENR, 21, "spi6", "apb2_div" }, { STM32F4_RCC_APB2ENR, 22, "sai1", "apb2_div" }, - { STM32F4_RCC_APB2ENR, 26, "ltdc", "apb2_div" }, }; static const struct stm32f4_gate_data stm32f746_gates[] __initconst = {
@@ -286,7 +284,6 @@ static const struct stm32f4_gate_data stm32f746_gates[] __initconst = { { STM32F4_RCC_APB2ENR, 21, "spi6", "apb2_div" }, { STM32F4_RCC_APB2ENR, 22, "sai1", "apb2_div" }, { STM32F4_RCC_APB2ENR, 23, "sai2", "apb2_div" }, - { STM32F4_RCC_APB2ENR, 26, "ltdc", "apb2_div" }, }; static const struct stm32f4_gate_data stm32f769_gates[] __initconst = {
@@ -364,7 +361,6 @@ static const struct stm32f4_gate_data stm32f769_gates[] __initconst = { { STM32F4_RCC_APB2ENR, 21, "spi6", "apb2_div" }, { STM32F4_RCC_APB2ENR, 22, "sai1", "apb2_div" }, { STM32F4_RCC_APB2ENR, 23, "sai2", "apb2_div" }, - { STM32F4_RCC_APB2ENR, 26, "ltdc", "apb2_div" }, { STM32F4_RCC_APB2ENR, 30, "mdio", "apb2_div" }, };
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 276/563 dmaengine: pxa/mmp: stop referencing config->slave_id
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 134c37fa250a87a7e77c80a7c59ae16c462e46e0 ]
The last driver referencing the slave_id on Marvell PXA and MMP platforms was the SPI driver, but this stopped doing so a long time ago, so the TODO from the earlier patch can no be removed.
--- drivers/dma/mmp_pdma.c | 6 ------ drivers/dma/pxa_dma.c | 7 ------- 2 files changed, 13 deletions(-)
drivers/dma/mmp_pdma.c +0 -6
@@ -728,12 +728,6 @@ static int mmp_pdma_config_write(struct dma_chan *dchan, chan->dir = direction; chan->dev_addr = addr; -/* FIXME: drivers should be ported over to use the filter -* function. Once that's done, the following two lines can -* be removed. -*/ -if (cfg->slave_id) - chan->drcmr = cfg->slave_id;return 0 ; }
drivers/dma/pxa_dma.c +0 -7
@@ -911,13 +911,6 @@ static void pxad_get_config(struct pxad_chan *chan, *dcmd |=PXA_DCMD_BURST16 ; else if (maxburst == 32) *dcmd |= PXA_DCMD_BURST32; - - /* FIXME: drivers should be ported over to use the filter - * function. Once that's done, the following two lines can - * be removed. - */ - if (chan->cfg.slave_id) - chan->drcmr = chan->cfg.slave_id; } static struct dma_async_tx_descriptor *
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 281/563 scsi: block: pm: Always set request queue runtime active in blk_post_runtime_resume()
In reply to Greg Kroah-HartmanFrom: Alan Stern <[email protected]>
[ Upstream commit 6e1fcab00a23f7fe9f4fe9704905a790efa1eeab ]
John Garry reported a deadlock that occurs when trying to access a runtime-suspended SATA device. For obscure reasons, the rescan procedure causes the link to be hard-reset, which disconnects the device.
The rescan tries to carry out a runtime resume when accessing the device. scsi_rescan_device() holds the SCSI device lock and won't release it until it can put commands onto the device's block queue. This can't happen until the queue is successfully runtime-resumed or the device is unregistered. But the runtime resume fails because the device is disconnected, and __scsi_remove_device() can't do the unregistration because it can't get the device lock.
The best way to resolve this deadlock appears to be to allow the block queue to start running again even after an unsuccessful runtime resume. The idea is that the driver or the SCSI error handler will need to be able to use the queue to resolve the runtime resume failure.
This patch removes the err argument to blk_post_runtime_resume() and makes the routine act as though the resume was successful always. This fixes the deadlock.
--- block/blk-pm.c | 22 +++++++--------------- drivers/scsi/scsi_pm.c | 2 +- include/linux/blk-pm.h | 2 +- 3 files changed, 9 insertions(+), 17 deletions(-)
block/blk-pm.c +7 -15
@@ -163,27 +163,19 @@ EXPORT_SYMBOL(blk_pre_runtime_resume);/** * blk_post_runtime_resume - Post runtime resume processing * @q: the queue of the device -* @err: return value of the device's runtime_resume function * * Description: -* Update the queue's runtime status according to the return value of the -* device's runtime_resume function. If the resume was successful, call -* blk_set_runtime_active() to do the real work of restarting the queue. +* For historical reasons, this routine merely calls blk_set_runtime_active() +* to do the real work of restarting the queue. It does this regardless of +* whether the device's runtime-resume succeeded; even if it failed the +* driver or error handler will need to communicate with the device. * * This function should be called near the end of the device's * runtime_resume callback. */ -void blk_post_runtime_resume (struct request_queue *q,int err) +void blk_post_runtime_resume (struct request_queue *q) { -if (!q->dev) -return ; -if (!err) { -blk_set_runtime_active (q); - }else { -spin_lock_irq (&q->queue_lock); - q->rpm_status =RPM_SUSPENDED ; -spin_unlock_irq (&q->queue_lock); - } +blk_set_runtime_active (q); }EXPORT_SYMBOL (blk_post_runtime_resume);
@@ -201,7 +193,7 @@ EXPORT_SYMBOL(blk_post_runtime_resume);* runtime PM status and re-enable peeking requests from the queue. It * should be called before first request is added to the queue. * -* This function is also called by blk_post_runtime_resume() for successful +* This function is also called by blk_post_runtime_resume() for * runtime resumes. It does everything necessary to restart the queue. */ void blk_set_runtime_active (struct request_queue *q)
drivers/scsi/scsi_pm.c +1 -1
@@ -262,7 +262,7 @@ static int sdev_runtime_resume(struct device *dev)blk_pre_runtime_resume (sdev->request_queue);if (pm && pm->runtime_resume) err = pm->runtime_resume (dev); -blk_post_runtime_resume (sdev->request_queue, err); +blk_post_runtime_resume (sdev->request_queue);return err; }
include/linux/blk-pm.h +1 -1
@@ -14,7 +14,7 @@ extern void blk_pm_runtime_init(struct request_queue *q, struct device *dev);extern int blk_pre_runtime_suspend (struct request_queue *q);extern void blk_post_runtime_suspend (struct request_queue *q,int err);extern void blk_pre_runtime_resume (struct request_queue *q); -extern void blk_post_runtime_resume (struct request_queue *q,int err); +extern void blk_post_runtime_resume (struct request_queue *q);extern void blk_set_runtime_active (struct request_queue *q);#else static inline void blk_pm_runtime_init(struct request_queue *q,
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 280/563 iommu/iova: Fix race between FQ timeout and teardown
In reply to Greg Kroah-HartmanFrom: Xiongfeng Wang <[email protected]>
[ Upstream commit d7061627d701c90e1cac1e1e60c45292f64f3470 ]
It turns out to be possible for hotplugging out a device to reach the stage of tearing down the device's group and default domain before the domain's flush queue has drained naturally. At this point, it is then possible for the timeout to expire just before the del_timer() call in free_iova_flush_queue(), such that we then proceed to free the FQ resources while fq_flush_timeout() is still accessing them on another CPU. Crashes due to this have been observed in the wild while removing NVMe devices.
Close the race window by using del_timer_sync() to safely wait for any active timeout handler to finish before we start to free things. We already avoid any locking in free_iova_flush_queue() since the FQ is supposed to be inactive anyway, so the potential deadlock scenario does not apply.
--- drivers/iommu/iova.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/iommu/iova.c +1 -2
@@ -64,8 +64,7 @@ static void free_iova_flush_queue(struct iova_domain *iovad)if (!has_iova_flush_queue (iovad))return ; -if (timer_pending (&iovad->fq_timer)) -del_timer (&iovad->fq_timer); +del_timer_sync (&iovad->fq_timer);fq_destroy_all_entries (iovad);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 246/563 powerpc/prom_init: Fix improper check of prom_getprop()
In reply to Greg Kroah-HartmanFrom: Peiwei Hu <[email protected]>
[ Upstream commit 869fb7e5aecbc163003f93f36dcc26d0554319f6 ]
prom_getprop() can return PROM_ERROR. Binary operator can not identify it.
--- arch/powerpc/kernel/prom_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/prom_init.c +1 -1
@@ -2956,7 +2956,7 @@ static void __init fixup_device_tree_efika_add_phy(void)/* Check if the phy-handle property exists - bail if it does */ rv =prom_getprop (node,"phy-handle" , prop,sizeof (prop)); -if (!rv) +if (rv <=0 )return ;/*
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 252/563 powerpc/irq: Add helper to set regs->softe
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
[ Upstream commit fb5608fd117a8b48752d2b5a7e70847c1ed33d33 ]
regs->softe doesn't exist on PPC32.
Add irq_soft_mask_regs_set_state() helper to set regs->softe. This helper will void on PPC32.
--- arch/powerpc/include/asm/hw_irq.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/hw_irq.h +9 -2
@@ -38,6 +38,8 @@#define PACA_IRQ_MUST_HARD_MASK (PACA_IRQ_EE)#endif +#endif /* CONFIG_PPC64 */ +/* * flags for paca->irq_soft_mask */
@@ -46,8 +48,6 @@#define IRQS_PMI_DISABLED 2#define IRQS_ALL_DISABLED (IRQS_DISABLED | IRQS_PMI_DISABLED) -#endif /* CONFIG_PPC64 */ -#ifndef __ASSEMBLY__extern void replay_system_reset (void );
@@ -296,6 +296,10 @@ extern void irq_set_pending_from_srr1(unsigned long srr1);extern void force_external_irq_replay (void ); +static inline void irq_soft_mask_regs_set_state (struct pt_regs *regs,unsigned long val) +{ + regs->softe = val; +}#else /* CONFIG_PPC64 */ static inline unsigned long arch_local_save_flags (void )
@@ -364,6 +368,9 @@ static inline bool arch_irq_disabled_regs(struct pt_regs *regs)static inline void may_hard_irq_enable (void ) { } +static inline void irq_soft_mask_regs_set_state (struct pt_regs *regs,unsigned long val) +{ +}#endif /* CONFIG_PPC64 */ #define ARCH_IRQ_INIT_FLAGS IRQ_NOREQUEST
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 255/563 clocksource: Reduce clocksource-skew threshold
In reply to Greg Kroah-HartmanFrom: Paul E. McKenney <[email protected]>
[ Upstream commit 2e27e793e280ff12cb5c202a1214c08b0d3a0f26 ]
Currently, WATCHDOG_THRESHOLD is set to detect a 62.5-millisecond skew in a 500-millisecond WATCHDOG_INTERVAL. This requires that clocks be skewed by more than 12.5% in order to be marked unstable. Except that a clock that is skewed by that much is probably destroying unsuspecting software right and left. And given that there are now checks for false-positive skews due to delays between reading the two clocks, it should be possible to greatly decrease WATCHDOG_THRESHOLD, at least for fine-grained clocks such as TSC.
Therefore, add a new uncertainty_margin field to the clocksource structure that contains the maximum uncertainty in nanoseconds for the corresponding clock. This field may be initialized manually, as it is for clocksource_tsc_early and clocksource_jiffies, which is copied to refined_jiffies. If the field is not initialized manually, it will be computed at clock-registry time as the period of the clock in question based on the scale and freq parameters to __clocksource_update_freq_scale() function. If either of those two parameters are zero, the tens-of-milliseconds WATCHDOG_THRESHOLD is used as a cowardly alternative to dividing by zero. No matter how the uncertainty_margin field is calculated, it is bounded below by twice WATCHDOG_MAX_SKEW, that is, by 100 microseconds.
Note that manually initialized uncertainty_margin fields are not adjusted, but there is a WARN_ON_ONCE() that triggers if any such field is less than twice WATCHDOG_MAX_SKEW. This WARN_ON_ONCE() is intended to discourage production use of the one-nanosecond uncertainty_margin values that are used to test the clock-skew code itself.
The actual clock-skew check uses the sum of the uncertainty_margin fields of the two clocksource structures being compared. Integer overflow is avoided because the largest computed value of the uncertainty_margin fields is one billion (10^9), and double that value fits into an unsigned int. However, if someone manually specifies (say) UINT_MAX, they will get what they deserve.
Note that the refined_jiffies uncertainty_margin field is initialized to TICK_NSEC, which means that skew checks involving this clocksource will be sufficently forgiving. In a similar vein, the clocksource_tsc_early uncertainty_margin field is initialized to 32*NSEC_PER_MSEC, which replicates the current behavior and allows custom setting if needed in order to address the rare skews detected for this clocksource in current mainline.
--- arch/x86/kernel/tsc.c | 1 + include/linux/clocksource.h | 3 +++ kernel/time/clocksource.c | 48 +++++++++++++++++++++++++++++-------- kernel/time/jiffies.c | 15 ++++++------ 4 files changed, 50 insertions(+), 17 deletions(-)
arch/x86/kernel/tsc.c +1 -0
@@ -1127,6 +1127,7 @@ static int tsc_cs_enable(struct clocksource *cs)static struct clocksource clocksource_tsc_early = { .name ="tsc-early" , .rating =299 , + .uncertainty_margin =32 *NSEC_PER_MSEC , .read = read_tsc, .mask =CLOCKSOURCE_MASK (64 ), .flags = CLOCK_SOURCE_IS_CONTINUOUS |
include/linux/clocksource.h +3 -0
@@ -42,6 +42,8 @@ struct module;* @shift: Cycle to nanosecond divisor (power of two) * @max_idle_ns: Maximum idle time permitted by the clocksource (nsecs) * @maxadj: Maximum adjustment value to mult (~11%) +* @uncertainty_margin: Maximum uncertainty in nanoseconds per half second. +* Zero says to use default WATCHDOG_THRESHOLD. * @archdata: Optional arch-specific data * @max_cycles: Maximum safe cycle value which won't overflow on * multiplication
@@ -93,6 +95,7 @@ struct clocksource {u32 shift;u64 max_idle_ns;u32 maxadj; +u32 uncertainty_margin;#ifdef CONFIG_ARCH_CLOCKSOURCE_DATA struct arch_clocksource_data archdata;#endif
kernel/time/clocksource.c +38 -10
80 lines not on this page · raw message
kernel/time/jiffies.c +8 -7
@@ -49,13 +49,14 @@ static u64 jiffies_read(struct clocksource *cs)* for "tick-less" systems. */ static struct clocksource clocksource_jiffies = { - .name ="jiffies" , - .rating =1 ,/* lowest valid rating*/ - .read = jiffies_read, - .mask =CLOCKSOURCE_MASK (32 ), - .mult =TICK_NSEC <<JIFFIES_SHIFT ,/* details above */ - .shift =JIFFIES_SHIFT , - .max_cycles =10 , + .name ="jiffies" , + .rating =1 ,/* lowest valid rating*/ + .uncertainty_margin =32 *NSEC_PER_MSEC , + .read = jiffies_read, + .mask =CLOCKSOURCE_MASK (32 ), + .mult =TICK_NSEC <<JIFFIES_SHIFT ,/* details above */ + .shift =JIFFIES_SHIFT , + .max_cycles =10 , };__cacheline_aligned_in_smp DEFINE_RAW_SPINLOCK (jiffies_lock );
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 296/563 of: base: Fix phandle argument length mismatch error message
In reply to Greg Kroah-HartmanFrom: Baruch Siach <[email protected]>
[ Upstream commit 94a4950a4acff39b5847cc1fee4f65e160813493 ]
The cell_count field of of_phandle_iterator is the number of cells we expect in the phandle arguments list when cells_name is missing. The error message should show the number of cells we actually see.
--- drivers/of/base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/of/base.c +2 -2
@@ -1328,9 +1328,9 @@ int of_phandle_iterator_next(struct of_phandle_iterator *it)* property data length */ if (it->cur + count > it->list_end) { -pr_err ("%pOF: %s = %d found %d\n" , +pr_err ("%pOF: %s = %d found %td\n" , it->parent, it->cells_name, - count, it->cell_count); + count, it->list_end - it->cur); goto err; } }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 278/563 iommu/amd: Restore GA log/tail pointer on host resume
In reply to Greg Kroah-HartmanFrom: Maxim Levitsky <[email protected]>
[ Upstream commit a8d4a37d1bb93608501d0d0545f902061152669a ]
This will give IOMMU GA log a chance to work after resume from s3/s4.
--- drivers/iommu/amd/init.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-)
drivers/iommu/amd/init.c +15 -16
@@ -805,16 +805,27 @@ static int iommu_ga_log_enable(struct amd_iommu *iommu) {#ifdef CONFIG_IRQ_REMAP u32 status, i; +u64 entry;if (!iommu->ga_log)return -EINVAL ; - status =readl (iommu->mmio_base +MMIO_STATUS_OFFSET ); -/* Check if already running */ -if (status & (MMIO_STATUS_GALOG_RUN_MASK )) + status =readl (iommu->mmio_base +MMIO_STATUS_OFFSET ); +if (WARN_ON (status & (MMIO_STATUS_GALOG_RUN_MASK )))return 0 ; + entry =iommu_virt_to_phys (iommu->ga_log) |GA_LOG_SIZE_512 ; +memcpy_toio (iommu->mmio_base +MMIO_GA_LOG_BASE_OFFSET , + &entry,sizeof (entry)); + entry = (iommu_virt_to_phys (iommu->ga_log_tail) & + (BIT_ULL (52 )-1 )) & ~7ULL ; +memcpy_toio (iommu->mmio_base +MMIO_GA_LOG_TAIL_OFFSET , + &entry,sizeof (entry)); +writel (0x00 , iommu->mmio_base +MMIO_GA_HEAD_OFFSET ); +writel (0x00 , iommu->mmio_base +MMIO_GA_TAIL_OFFSET ); + +iommu_feature_enable (iommu,CONTROL_GAINT_EN );iommu_feature_enable (iommu,CONTROL_GALOG_EN );
@@ -824,7 +835,7 @@ static int iommu_ga_log_enable(struct amd_iommu *iommu) break; } -if (i >=LOOP_TIMEOUT ) +if (WARN_ON (i >=LOOP_TIMEOUT ))return -EINVAL ;#endif /* CONFIG_IRQ_REMAP */ return 0 ;
@@ -833,8 +844,6 @@ static int iommu_ga_log_enable(struct amd_iommu *iommu)static int iommu_init_ga_log (struct amd_iommu *iommu) {#ifdef CONFIG_IRQ_REMAP -u64 entry; -if (!AMD_IOMMU_GUEST_IR_VAPIC (amd_iommu_guest_ir))return 0 ;
@@ -848,16 +857,6 @@ static int iommu_init_ga_log(struct amd_iommu *iommu)if (!iommu->ga_log_tail) goto err_out; - entry =iommu_virt_to_phys (iommu->ga_log) |GA_LOG_SIZE_512 ; -memcpy_toio (iommu->mmio_base +MMIO_GA_LOG_BASE_OFFSET , - &entry,sizeof (entry)); - entry = (iommu_virt_to_phys (iommu->ga_log_tail) & - (BIT_ULL (52 )-1 )) & ~7ULL ; -memcpy_toio (iommu->mmio_base +MMIO_GA_LOG_TAIL_OFFSET , - &entry,sizeof (entry)); -writel (0x00 , iommu->mmio_base +MMIO_GA_HEAD_OFFSET ); -writel (0x00 , iommu->mmio_base +MMIO_GA_TAIL_OFFSET ); -return 0 ; err_out:free_ga_log (iommu);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 298/563 Bluetooth: Fix debugfs entry leak in hci_register_dev()
In reply to Greg Kroah-HartmanFrom: Wei Yongjun <[email protected]>
[ Upstream commit 5a4bb6a8e981d3d0d492aa38412ee80b21033177 ]
Fault injection test report debugfs entry leak as follows:
debugfs: Directory 'hci0' with parent 'bluetooth' already present!
When register_pm_notifier() failed in hci_register_dev(), the debugfs create by debugfs_create_dir() do not removed in the error handing path.
Add the remove debugfs code to fix it.
--- net/bluetooth/hci_core.c | 1 + 1 file changed, 1 insertion(+)
net/bluetooth/hci_core.c +1 -0
@@ -3810,6 +3810,7 @@ int hci_register_dev(struct hci_dev *hdev)return id; err_wqueue: +debugfs_remove_recursive (hdev->debugfs);destroy_workqueue (hdev->workqueue);destroy_workqueue (hdev->req_workqueue); err:
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 302/563 selftests/bpf: Fix bpf_object leak in skb_ctx selftest
In reply to Greg Kroah-HartmanFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit 8c7a95520184b6677ca6075e12df9c208d57d088 ]
skb_ctx selftest didn't close bpf_object implicitly allocated by bpf_prog_test_load() helper. Fix the problem by explicitly calling bpf_object__close() at the end of the test.
--- tools/testing/selftests/bpf/prog_tests/skb_ctx.c | 2 ++ 1 file changed, 2 insertions(+)
tools/testing/selftests/bpf/prog_tests/skb_ctx.c +2 -0
@@ -105,4 +105,6 @@ void test_skb_ctx(void)"ctx_out_mark" ,"skb->mark == %u, expected %d\n" , skb.mark, 10); + +bpf_object__close (obj); }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 303/563 ar5523: Fix null-ptr-deref with unexpected WDCMSG_TARGET_START reply
In reply to Greg Kroah-HartmanFrom: Zekun Shen <[email protected]>
[ Upstream commit ae80b6033834342601e99f74f6a62ff5092b1cee ]
Unexpected WDCMSG_TARGET_START replay can lead to null-ptr-deref when ar->tx_cmd->odata is NULL. The patch adds a null check to prevent such case.
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] ar5523_cmd+0x46a/0x581 [ar5523] ar5523_probe.cold+0x1b7/0x18da [ar5523] ? ar5523_cmd_rx_cb+0x7a0/0x7a0 [ar5523] ? __pm_runtime_set_status+0x54a/0x8f0 ? _raw_spin_trylock_bh+0x120/0x120 ? pm_runtime_barrier+0x220/0x220 ? __pm_runtime_resume+0xb1/0xf0 usb_probe_interface+0x25b/0x710 really_probe+0x209/0x5d0 driver_probe_device+0xc6/0x1b0 device_driver_attach+0xe2/0x120
I found the bug using a custome USBFuzz port. It's a research work to fuzz USB stack/drivers. I modified it to fuzz ath9k driver only, providing hand-crafted usb descriptors to QEMU.
After fixing the code (fourth byte in usb packet) to WDCMSG_TARGET_START, I got the null-ptr-deref bug. I believe the bug is triggerable whenever cmd->odata is NULL. After patching, I tested with the same input and no longer see the KASAN report.
This was NOT tested on a real device.
--- drivers/net/wireless/ath/ar5523/ar5523.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/wireless/ath/ar5523/ar5523.c +4 -0
@@ -153,6 +153,10 @@ static void ar5523_cmd_rx_cb(struct urb *urb)ar5523_err (ar,"Invalid reply to WDCMSG_TARGET_START" );return ; } +if (!cmd->odata) { +ar5523_err (ar,"Unexpected WDCMSG_TARGET_START reply" ); +return ; + }memcpy (cmd->odata, hdr +1 ,sizeof (u32)); cmd->olen =sizeof (u32); cmd->res =0 ;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 307/563 media: atomisp: set per-devices default mode
In reply to Greg Kroah-HartmanFrom: Mauro Carvalho Chehab <[email protected]>
[ Upstream commit 2c45e343c581091835c9047ed5298518aa133163 ]
The atomisp driver originally used the s_parm command to initialize the run_mode type to the driver. So, before start setting up the streaming, s_parm should be called.
So, even having 5 "normal" video devices, one meant to be used for each type, the run_mode was actually selected when s_parm is called.
Without setting the run mode, applications that don't call VIDIOC_SET_PARM with a custom atomisp parameters won't work, as the pipeline won't be set:
atomisp-isp2 0000:00:03.0: can't create streams atomisp-isp2 0000:00:03.0: __get_frame_info 1600x1200 (padded to 0) returned -22
However, commit 8a7c5594c020 ("media: v4l2-ioctl: clear fields in s_parm") broke support for it, with a good reason, as drivers shoudn't be extending the API for their own purposes.
So, as an step to allow generic apps to use this driver, put the device's run_mode in preview after open.
After this patch, using v4l2grab starts to work on preview mode (/dev/video2):
$ v4l2grab -f YUYV -x 1600 -y 1200 -d /dev/video2 -n 1 -u $ feh out000.pnm
So, let's just setup the default run_mode that each video devnode should assume, setting it at open() time.
--- drivers/staging/media/atomisp/pci/atomisp_fops.c | 5 +++++ .../staging/media/atomisp/pci/atomisp_subdev.c | 15 ++++++++++----- .../staging/media/atomisp/pci/atomisp_subdev.h | 3 +++ drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 4 +++- drivers/staging/media/atomisp/pci/atomisp_v4l2.h | 3 ++- 5 files changed, 23 insertions(+), 7 deletions(-)
drivers/staging/media/atomisp/pci/atomisp_fops.c +5 -0
@@ -877,6 +877,11 @@ done:else pipe->users++;rt_mutex_unlock (&isp->mutex); + +/* Ensure that a mode is set */ +if (asd) +v4l2_ctrl_s_ctrl (asd->run_mode, pipe->default_run_mode); +return 0 ; css_error:
drivers/staging/media/atomisp/pci/atomisp_subdev.c +10 -5
@@ -1178,23 +1178,28 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *asd)atomisp_init_acc_pipe (asd, &asd->video_acc); - ret =atomisp_video_init (&asd->video_in,"MEMORY" ); + ret =atomisp_video_init (&asd->video_in,"MEMORY" , +ATOMISP_RUN_MODE_SDV );if (ret <0 )return ret; - ret =atomisp_video_init (&asd->video_out_capture,"CAPTURE" ); + ret =atomisp_video_init (&asd->video_out_capture,"CAPTURE" , +ATOMISP_RUN_MODE_STILL_CAPTURE );if (ret <0 )return ret; - ret =atomisp_video_init (&asd->video_out_vf,"VIEWFINDER" ); + ret =atomisp_video_init (&asd->video_out_vf,"VIEWFINDER" , +ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE );if (ret <0 )return ret; - ret =atomisp_video_init (&asd->video_out_preview,"PREVIEW" ); + ret =atomisp_video_init (&asd->video_out_preview,"PREVIEW" , +ATOMISP_RUN_MODE_PREVIEW );if (ret <0 )return ret; - ret =atomisp_video_init (&asd->video_out_video_capture,"VIDEO" ); + ret =atomisp_video_init (&asd->video_out_video_capture,"VIDEO" , +ATOMISP_RUN_MODE_VIDEO );if (ret <0 )return ret;
drivers/staging/media/atomisp/pci/atomisp_subdev.h +3 -0
@@ -81,6 +81,9 @@ struct atomisp_video_pipe {/* the link list to store per_frame parameters */ struct list_head per_frame_params; +/* Store here the initial run mode */ +unsigned int default_run_mode; +unsigned int buffers_in_css;/* irq_lock is used to protect video buffer state change operations and
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +3 -1
@@ -447,7 +447,8 @@ const struct atomisp_dfs_config dfs_config_cht_soc = { .dfs_table_size = ARRAY_SIZE(dfs_rules_cht_soc), }; -int atomisp_video_init (struct atomisp_video_pipe *video,const char *name) +int atomisp_video_init (struct atomisp_video_pipe *video,const char *name, +unsigned int run_mode) {int ret;const char *direction;
@@ -478,6 +479,7 @@ int atomisp_video_init(struct atomisp_video_pipe *video, const char *name) "ATOMISP ISP %s %s", name, direction); video->vdev.release = video_device_release_empty;video_set_drvdata (&video->vdev, video->isp); + video->default_run_mode = run_mode;return 0 ; }
drivers/staging/media/atomisp/pci/atomisp_v4l2.h +2 -1
@@ -27,7 +27,8 @@ struct v4l2_device;struct atomisp_device ;struct firmware ; -int atomisp_video_init (struct atomisp_video_pipe *video,const char *name); +int atomisp_video_init (struct atomisp_video_pipe *video,const char *name, +unsigned int run_mode);void atomisp_acc_init (struct atomisp_acc_pipe *video,const char *name);void atomisp_video_unregister (struct atomisp_video_pipe *video);void atomisp_acc_unregister (struct atomisp_acc_pipe *video);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 308/563 media: atomisp-ov2680: Fix ov2680_set_fmt() clobbering the exposure
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit 4492289c31364d28c2680b43b18883385a5d216c ]
Now that we restore the default or last user set exposure setting on power_up() there is no need for the registers written by ov2680_set_fmt() to write to the exposure register.
Not doing so fixes the exposure always being reset to the value from the res->regs array after a set_fmt().
--- drivers/staging/media/atomisp/i2c/ov2680.h | 24 ---------------------- 1 file changed, 24 deletions(-)
drivers/staging/media/atomisp/i2c/ov2680.h +0 -24
@@ -289,8 +289,6 @@ static struct ov2680_reg const ov2680_global_setting[] = {*/ static struct ov2680_reg const ov2680_QCIF_30fps[] = { {0x3086 ,0x01 }, - {0x3501 ,0x24 }, - {0x3502 ,0x40 }, {0x370a ,0x23 }, {0x3801 ,0xa0 }, {0x3802 ,0x00 },
@@ -334,8 +332,6 @@ static struct ov2680_reg const ov2680_QCIF_30fps[] = {*/ static struct ov2680_reg const ov2680_CIF_30fps[] = { {0x3086 ,0x01 }, - {0x3501 ,0x24 }, - {0x3502 ,0x40 }, {0x370a ,0x23 }, {0x3801 ,0xa0 }, {0x3802 ,0x00 },
@@ -377,8 +373,6 @@ static struct ov2680_reg const ov2680_CIF_30fps[] = {*/ static struct ov2680_reg const ov2680_QVGA_30fps[] = { {0x3086 ,0x01 }, - {0x3501 ,0x24 }, - {0x3502 ,0x40 }, {0x370a ,0x23 }, {0x3801 ,0xa0 }, {0x3802 ,0x00 },
@@ -420,8 +414,6 @@ static struct ov2680_reg const ov2680_QVGA_30fps[] = {*/ static struct ov2680_reg const ov2680_656x496_30fps[] = { {0x3086 ,0x01 }, - {0x3501 ,0x24 }, - {0x3502 ,0x40 }, {0x370a ,0x23 }, {0x3801 ,0xa0 }, {0x3802 ,0x00 },
@@ -463,8 +455,6 @@ static struct ov2680_reg const ov2680_656x496_30fps[] = {*/ static struct ov2680_reg const ov2680_720x592_30fps[] = { {0x3086 ,0x01 }, - {0x3501 ,0x26 }, - {0x3502 ,0x40 }, {0x370a ,0x23 }, {0x3801 ,0x00 },// X_ADDR_START; {0x3802 ,0x00 },
@@ -508,8 +498,6 @@ static struct ov2680_reg const ov2680_720x592_30fps[] = {*/ static struct ov2680_reg const ov2680_800x600_30fps[] = { {0x3086 ,0x01 }, - {0x3501 ,0x26 }, - {0x3502 ,0x40 }, {0x370a ,0x23 }, {0x3801 ,0x00 }, {0x3802 ,0x00 },
@@ -551,8 +539,6 @@ static struct ov2680_reg const ov2680_800x600_30fps[] = {*/ static struct ov2680_reg const ov2680_720p_30fps[] = { {0x3086 ,0x00 }, - {0x3501 ,0x48 }, - {0x3502 ,0xe0 }, {0x370a ,0x21 }, {0x3801 ,0xa0 }, {0x3802 ,0x00 },
@@ -594,8 +580,6 @@ static struct ov2680_reg const ov2680_720p_30fps[] = {*/ static struct ov2680_reg const ov2680_1296x976_30fps[] = { {0x3086 ,0x00 }, - {0x3501 ,0x48 }, - {0x3502 ,0xe0 }, {0x370a ,0x21 }, {0x3801 ,0xa0 }, {0x3802 ,0x00 },
@@ -637,8 +621,6 @@ static struct ov2680_reg const ov2680_1296x976_30fps[] = {*/ static struct ov2680_reg const ov2680_1456x1096_30fps[] = { {0x3086 ,0x00 }, - {0x3501 ,0x48 }, - {0x3502 ,0xe0 }, {0x370a ,0x21 }, {0x3801 ,0x90 }, {0x3802 ,0x00 },
@@ -682,8 +664,6 @@ static struct ov2680_reg const ov2680_1456x1096_30fps[] = {static struct ov2680_reg const ov2680_1616x916_30fps[] = { {0x3086 ,0x00 }, - {0x3501 ,0x48 }, - {0x3502 ,0xe0 }, {0x370a ,0x21 }, {0x3801 ,0x00 }, {0x3802 ,0x00 },
@@ -726,8 +706,6 @@ static struct ov2680_reg const ov2680_1616x916_30fps[] = {#if 0 static struct ov2680_reg const ov2680_1616x1082_30fps[] = { {0x3086 ,0x00 }, - {0x3501 ,0x48 }, - {0x3502 ,0xe0 }, {0x370a ,0x21 }, {0x3801 ,0x00 }, {0x3802, 0x00},
@@ -769,8 +747,6 @@ static struct ov2680_reg const ov2680_1616x1082_30fps[] = {*/ static struct ov2680_reg const ov2680_1616x1216_30fps[] = { {0x3086 ,0x00 }, - {0x3501 ,0x48 }, - {0x3502 ,0xe0 }, {0x370a ,0x21 }, {0x3801 ,0x00 }, {0x3802 ,0x00 },
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 267/563 powerpc/powermac: Add additional missing lockdep_register_key()
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
[ Upstream commit b149d5d45ac9171ed699a256f026c8ebef901112 ]
Commit df1f679d19ed ("powerpc/powermac: Add missing lockdep_register_key()") fixed a problem that was causing a WARNING.
There are two other places in the same file with the same problem originating from commit 9e607f72748d ("i2c_powermac: shut up lockdep warning").
Add missing lockdep_register_key()
Depends-on: df1f679d19ed ("powerpc/powermac: Add missing lockdep_register_key()")
--- arch/powerpc/platforms/powermac/low_i2c.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/platforms/powermac/low_i2c.c +2 -0
@@ -810,6 +810,7 @@ static void __init pmu_i2c_probe(void) bus->hostdata = bus +1 ; bus->xfer = pmu_i2c_xfer;mutex_init (&bus->mutex); +lockdep_register_key (&bus->lock_key);lockdep_set_class (&bus->mutex, &bus->lock_key); bus->flags = pmac_i2c_multibus;list_add (&bus->link, &pmac_i2c_busses);
@@ -933,6 +934,7 @@ static void __init smu_i2c_probe(void) bus->hostdata = bus +1 ; bus->xfer = smu_i2c_xfer;mutex_init (&bus->mutex); +lockdep_register_key (&bus->lock_key);lockdep_set_class (&bus->mutex, &bus->lock_key); bus->flags =0 ;list_add (&bus->link, &pmac_i2c_busses);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 279/563 ASoC: Intel: catpt: Test dmaengine_submit() result before moving on
In reply to Greg Kroah-HartmanFrom: Cezary Rojewski <[email protected]>
[ Upstream commit 2a9a72e290d4a4741e673f86b9fba9bfb319786d ]
After calling dmaengine_submit(), the submitted transfer descriptor belongs to the DMA engine. Pointer to that descriptor may no longer be valid after the call and should be tested before awaiting transfer completion.
--- sound/soc/intel/catpt/dsp.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
sound/soc/intel/catpt/dsp.c +12 -2
@@ -65,6 +65,7 @@ static int catpt_dma_memcpy(struct catpt_dev *cdev, struct dma_chan *chan, {struct dma_async_tx_descriptor *desc;enum dma_status status; +int ret; desc =dmaengine_prep_dma_memcpy (chan, dst_addr, src_addr, size,DMA_CTRL_ACK );
@@ -77,13 +78,22 @@ static int catpt_dma_memcpy(struct catpt_dev *cdev, struct dma_chan *chan,catpt_updatel_shim (cdev,HMDC ,CATPT_HMDC_HDDA (CATPT_DMA_DEVID , chan->chan_id),CATPT_HMDC_HDDA (CATPT_DMA_DEVID , chan->chan_id)); -dmaengine_submit (desc); + + ret =dma_submit_error (dmaengine_submit (desc)); +if (ret) { +dev_err (cdev->dev,"submit tx failed: %d\n" , ret); + goto clear_hdda; + } + status =dma_wait_for_async_tx (desc); + ret = (status ==DMA_COMPLETE ) ?0 : -EPROTO ; + +clear_hdda:/* regardless of status, disable access to HOST memory in demand mode */ catpt_updatel_shim (cdev,HMDC ,CATPT_HMDC_HDDA (CATPT_DMA_DEVID , chan->chan_id),0 ); -return (status ==DMA_COMPLETE ) ?0 : -EPROTO ; +return ret; } int catpt_dma_memcpy_todsp(struct catpt_dev *cdev, struct dma_chan *chan,
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 309/563 ARM: shmobile: rcar-gen2: Add missing of_node_put()
In reply to Greg Kroah-HartmanFrom: Wan Jiabing <[email protected]>
[ Upstream commit 85744f2d938c5f3cfc44cb6533c157469634da93 ]
Fix following coccicheck warning:
./arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c:156:1-33: Function for_each_matching_node_and_match should have of_node_put() before break and goto.
Early exits from for_each_matching_node_and_match() should decrement the node reference counter.
--- arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c +4 -1
@@ -154,8 +154,10 @@ static int __init rcar_gen2_regulator_quirk(void)return -ENODEV ;for_each_matching_node_and_match (np, rcar_gen2_quirk_match, &id) { -if (!of_device_is_available (np)) +if (!of_device_is_available (np)) { +of_node_put (np);break ; + } ret =of_property_read_u32 (np,"reg" , &addr);if (ret)/* Skip invalid entry and continue */
@@ -164,6 +166,7 @@ static int __init rcar_gen2_regulator_quirk(void) quirk =kzalloc (sizeof (*quirk),GFP_KERNEL );if (!quirk) { ret = -ENOMEM ; +of_node_put (np); goto err_mem; }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 288/563 arm64: tegra: Remove non existent Tegra194 reset
In reply to Greg Kroah-HartmanFrom: Sameer Pujar <[email protected]>
[ Upstream commit 146b3a77af8091cabbd1decc51d67799e69682d2 ]
Tegra194 does not really have "hda2codec_2x" related reset. Hence drop this entry to reflect actual HW.
--- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/nvidia/tegra194.dtsi +2 -3
@@ -786,9 +786,8 @@ <&bpmp TEGRA194_CLK_HDA2CODEC_2X>; clock-names = "hda", "hda2hdmi", "hda2codec_2x"; resets = <&bpmp TEGRA194_RESET_HDA>, - <&bpmp TEGRA194_RESET_HDA2HDMICODEC>, - <&bpmp TEGRA194_RESET_HDA2CODEC_2X>; - reset-names = "hda", "hda2hdmi", "hda2codec_2x"; + <&bpmp TEGRA194_RESET_HDA2HDMICODEC>; + reset-names = "hda", "hda2hdmi"; power-domains = <&bpmp TEGRA194_POWER_DOMAIN_DISP>; interconnects = <&mc TEGRA194_MEMORY_CLIENT_HDAR &emc>, <&mc TEGRA194_MEMORY_CLIENT_HDAW &emc>;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 312/563 ath11k: Fix crash caused by uninitialized TX ring
In reply to Greg Kroah-HartmanFrom: Baochen Qiang <[email protected]>
[ Upstream commit 273703ebdb01b6c5f1aaf4b98fb57b177609055c ]
Commit 31582373a4a8 ("ath11k: Change number of TCL rings to one for QCA6390") avoids initializing the other entries of dp->tx_ring cause the corresponding TX rings on QCA6390/WCN6855 are not used, but leaves those ring masks in ath11k_hw_ring_mask_qca6390.tx unchanged. Normally this is OK because we will only get interrupts from the first TX ring on these chips and thus only the first entry of dp->tx_ring is involved.
In case of one MSI vector, all DP rings share the same IRQ. For each interrupt, all rings have to be checked, which means the other entries of dp->tx_ring are involved. However since they are not initialized, system crashes.
Fix this issue by simply removing those ring masks.
crash stack:
[ 102.907438] BUG: kernel NULL pointer dereference, address: 0000000000000028 [ 102.907447] #PF: supervisor read access in kernel mode [ 102.907451] #PF: error_code(0x0000) - not-present page [ 102.907453] PGD 1081f0067 P4D 1081f0067 PUD 1081f1067 PMD 0 [ 102.907460] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC NOPTI [ 102.907465] CPU: 0 PID: 3511 Comm: apt-check Kdump: loaded Tainted: G E 5.15.0-rc4-wt-ath+ #20 [ 102.907470] Hardware name: AMD Celadon-RN/Celadon-RN, BIOS RCD1005E 10/08/2020 [ 102.907472] RIP: 0010:ath11k_dp_tx_completion_handler+0x201/0x830 [ath11k] [ 102.907497] Code: 3c 24 4e 8d ac 37 10 04 00 00 4a 8d bc 37 68 04 00 00 48 89 3c 24 48 63 c8 89 83 84 18 00 00 48 c1 e1 05 48 03 8b 78 18 00 00 <8b> 51 08 89 d6 83 e6 07 89 74 24 24 83 fe 03 74 04 85 f6 75 63 41 [ 102.907501] RSP: 0000:ffff9b7340003e08 EFLAGS: 00010202 [ 102.907505] RAX: 0000000000000001 RBX: ffff8e21530c0100 RCX: 0000000000000020 [ 102.907508] RDX: 0000000000000000 RSI: 00000000fffffe00 RDI: ffff8e21530c1938 [ 102.907511] RBP: ffff8e21530c0000 R08: 0000000000000001 R09: 0000000000000000 [ 102.907513] R10: ffff8e2145534c10 R11: 0000000000000001 R12: ffff8e21530c2938 [ 102.907515] R13: ffff8e21530c18e0 R14: 0000000000000100 R15: ffff8e21530c2978 [ 102.907518] FS: 00007f5d4297e740(0000) GS:ffff8e243d600000(0000) knlGS:0000000000000000 [ 102.907521] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 102.907524] CR2: 0000000000000028 CR3: 00000001034ea000 CR4: 0000000000350ef0 [ 102.907527] Call Trace: [ 102.907531] <IRQ> [ 102.907537] ath11k_dp_service_srng+0x5c/0x2f0 [ath11k] [ 102.907556] ath11k_pci_ext_grp_napi_poll+0x21/0x70 [ath11k_pci] [ 102.907562] __napi_poll+0x2c/0x160 [ 102.907570] net_rx_action+0x251/0x310 [ 102.907576] __do_softirq+0x107/0x2fc [ 102.907585] irq_exit_rcu+0x74/0x90 [ 102.907593] common_interrupt+0x83/0xa0 [ 102.907600] </IRQ> [ 102.907601] asm_common_interrupt+0x1e/0x40
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
--- drivers/net/wireless/ath/ath11k/hw.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/wireless/ath/ath11k/hw.c +0 -2
@@ -246,8 +246,6 @@ const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074 = {const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390 = { .tx = {ATH11K_TX_RING_MASK_0 , -ATH11K_TX_RING_MASK_1 , -ATH11K_TX_RING_MASK_2 , }, .rx_mon_status = {0 ,0 ,0 ,0 ,
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 330/563 rsi: Fix out-of-bounds read in rsi_read_pkt()
In reply to Greg Kroah-HartmanFrom: Zekun Shen <[email protected]>
[ Upstream commit f1cb3476e48b60c450ec3a1d7da0805bffc6e43a ]
rsi_get_* functions rely on an offset variable from usb input. The size of usb input is RSI_MAX_RX_USB_PKT_SIZE(3000), while 2-byte offset can be up to 0xFFFF. Thus a large offset can cause out-of-bounds read.
The patch adds a bound checking condition when rcv_pkt_len is 0, indicating it's USB. It's unclear whether this is triggerable from other type of bus. The following check might help in that case. offset > rcv_pkt_len - FRAME_DESC_SZ
The bug is trigerrable with conpromised/malfunctioning USB devices. I tested the patch with the crashing input and got no more bug report.
Attached is the KASAN report from fuzzing.
BUG: KASAN: slab-out-of-bounds in rsi_read_pkt+0x42e/0x500 [rsi_91x] Read of size 2 at addr ffff888019439fdb by task RX-Thread/227 CPU: 0 PID: 227 Comm: RX-Thread Not tainted 5.6.0 #66 Call Trace: dump_stack+0x76/0xa0 print_address_description.constprop.0+0x16/0x200 ? rsi_read_pkt+0x42e/0x500 [rsi_91x] ? rsi_read_pkt+0x42e/0x500 [rsi_91x] __kasan_report.cold+0x37/0x7c ? rsi_read_pkt+0x42e/0x500 [rsi_91x] kasan_report+0xe/0x20 rsi_read_pkt+0x42e/0x500 [rsi_91x] rsi_usb_rx_thread+0x1b1/0x2fc [rsi_usb] ? rsi_probe+0x16a0/0x16a0 [rsi_usb] ? _raw_spin_lock_irqsave+0x7b/0xd0 ? _raw_spin_trylock_bh+0x120/0x120 ? __wake_up_common+0x10b/0x520 ? rsi_probe+0x16a0/0x16a0 [rsi_usb] kthread+0x2b5/0x3b0 ? kthread_create_on_node+0xd0/0xd0 ret_from_fork+0x22/0x40
--- drivers/net/wireless/rsi/rsi_91x_main.c | 4 ++++ drivers/net/wireless/rsi/rsi_91x_usb.c | 1 - drivers/net/wireless/rsi/rsi_usb.h | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/rsi/rsi_91x_main.c +4 -0
@@ -23,6 +23,7 @@#include "rsi_common.h" #include "rsi_coex.h" #include "rsi_hal.h" +#include "rsi_usb.h" u32 rsi_zone_enabled =/* INFO_ZONE | INIT_ZONE |
@@ -168,6 +169,9 @@ int rsi_read_pkt(struct rsi_common *common, u8 *rx_pkt, s32 rcv_pkt_len) frame_desc = &rx_pkt[index]; actual_length = *(u16 *)&frame_desc[0 ]; offset = *(u16 *)&frame_desc[2 ]; +if (!rcv_pkt_len && offset > +RSI_MAX_RX_USB_PKT_SIZE -FRAME_DESC_SZ ) + goto fail; queueno =rsi_get_queueno (frame_desc, offset); length =rsi_get_length (frame_desc, offset);
drivers/net/wireless/rsi/rsi_91x_usb.c +0 -1
@@ -328,7 +328,6 @@ static int rsi_rx_urb_submit(struct rsi_hw *adapter, u8 ep_num, gfp_t mem_flags)struct sk_buff *skb;u8 dword_align_bytes =0 ; -#define RSI_MAX_RX_USB_PKT_SIZE 3000 skb =dev_alloc_skb (RSI_MAX_RX_USB_PKT_SIZE );if (!skb)return -ENOMEM ;
drivers/net/wireless/rsi/rsi_usb.h +2 -0
@@ -44,6 +44,8 @@#define RSI_USB_BUF_SIZE 4096#define RSI_USB_CTRL_BUF_SIZE 0x04 +#define RSI_MAX_RX_USB_PKT_SIZE 3000 +struct rx_usb_ctrl_block {u8 *data;struct urb *rx_urb;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 332/563 media: venus: avoid calling core_clk_setrate() concurrently during concurrent video sessions
In reply to Greg Kroah-HartmanFrom: Mansur Alisha Shaik <[email protected]>
[ Upstream commit 91f2b7d269e5c885c38c7ffa261f5276bd42f907 ]
In existing implementation, core_clk_setrate() is getting called concurrently in concurrent video sessions. Before the previous call to core_clk_setrate returns, new call to core_clk_setrate is invoked from another video session running concurrently. This results in latest calculated frequency being set (higher/lower) instead of actual frequency required for that video session. It also results in stability crashes mention below. These resources are specific to video core, hence keeping under core lock would ensure that they are estimated for all running video sessions and called once for the video core.
Crash logs:
[ 1.900089] WARNING: CPU: 4 PID: 1 at drivers/opp/debugfs.c:33 opp_debug_remove_one+0x2c/0x48 [ 1.908493] Modules linked in: [ 1.911524] CPU: 4 PID: 1 Comm: swapper/0 Not tainted 5.10.67 #35 f8edb8c30cf2dd6838495dd9ef9be47af7f5f60c [ 1.921036] Hardware name: Qualcomm Technologies, Inc. sc7280 IDP SKU2 platform (DT) [ 1.928673] pstate: 60800009 (nZCv daif -PAN +UAO -TCO BTYPE=--) [ 1.934608] pc : opp_debug_remove_one+0x2c/0x48 [ 1.939080] lr : opp_debug_remove_one+0x2c/0x48 [ 1.943560] sp : ffffffc011d7b7f0 [ 1.946836] pmr_save: 000000e0 [ 1.949854] x29: ffffffc011d7b7f0 x28: ffffffc010733bbc [ 1.955104] x27: ffffffc010733ba8 x26: ffffff8083cedd00 [ 1.960355] x25: 0000000000000001 x24: 0000000000000000 [ 1.965603] x23: ffffff8083cc2878 x22: ffffff8083ceb900 [ 1.970852] x21: ffffff8083ceb910 x20: ffffff8083cc2800 [ 1.976101] x19: ffffff8083ceb900 x18: 00000000ffff0a10 [ 1.981352] x17: ffffff80837a5620 x16: 00000000000000ec [ 1.986601] x15: ffffffc010519ad4 x14: 0000000000000003 [ 1.991849] x13: 0000000000000004 x12: 0000000000000001 [ 1.997100] x11: c0000000ffffdfff x10: 00000000ffffffff [ 2.002348] x9 : d2627c580300dc00 x8 : d2627c580300dc00 [ 2.007596] x7 : 0720072007200720 x6 : ffffff80802ecf00 [ 2.012845] x5 : 0000000000190004 x4 : 0000000000000000 [ 2.018094] x3 : ffffffc011d7b478 x2 : ffffffc011d7b480 [ 2.023343] x1 : 00000000ffffdfff x0 : 0000000000000017 [ 2.028594] Call trace: [ 2.031022] opp_debug_remove_one+0x2c/0x48 [ 2.035160] dev_pm_opp_put+0x94/0xb0 [ 2.038780] _opp_remove_all+0x7c/0xc8 [ 2.042486] _opp_remove_all_static+0x54/0x7c [ 2.046796] dev_pm_opp_remove_table+0x74/0x98 [ 2.051183] devm_pm_opp_of_table_release+0x18/0x24 [ 2.056001] devm_action_release+0x1c/0x28 [ 2.060053] release_nodes+0x23c/0x2b8 [ 2.063760] devres_release_group+0xcc/0xd0 [ 2.067900] component_bind+0xac/0x168 [ 2.071608] component_bind_all+0x98/0x124 [ 2.075664] msm_drm_bind+0x1e8/0x678 [ 2.079287] try_to_bring_up_master+0x60/0x134 [ 2.083674] component_master_add_with_match+0xd8/0x120 [ 2.088834] msm_pdev_probe+0x20c/0x2a0 [ 2.092629] platform_drv_probe+0x9c/0xbc [ 2.096598] really_probe+0x11c/0x46c [ 2.100217] driver_probe_device+0x8c/0xf0 [ 2.104270] device_driver_attach+0x54/0x78 [ 2.108407] __driver_attach+0x48/0x148 [ 2.112201] bus_for_each_dev+0x88/0xd4 [ 2.115998] driver_attach+0x2c/0x38 [ 2.119534] bus_add_driver+0x10c/0x200 [ 2.123330] driver_register+0x6c/0x104 [ 2.127122] __platform_driver_register+0x4c/0x58 [ 2.131767] msm_drm_register+0x6c/0x70 [ 2.135560] do_one_initcall+0x64/0x23c [ 2.139357] do_initcall_level+0xac/0x15c [ 2.143321] do_initcalls+0x5c/0x9c [ 2.146778] do_basic_setup+0x2c/0x38 [ 2.150401] kernel_init_freeable+0xf8/0x15c [ 2.154622] kernel_init+0x1c/0x11c [ 2.158079] ret_from_fork+0x10/0x30 [ 2.161615] ---[ end trace a2cc45a0f784b212 ]---
[ 2.166272] Removing OPP: 300000000
--- .../media/platform/qcom/venus/pm_helpers.c | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/media/platform/qcom/venus/pm_helpers.c +14 -14
@@ -147,14 +147,12 @@ static u32 load_per_type(struct venus_core *core, u32 session_type)struct venus_inst *inst =NULL ;u32 mbs_per_sec =0 ; -mutex_lock (&core->lock);list_for_each_entry (inst, &core->instances, list) {if (inst->session_type != session_type)continue ; mbs_per_sec +=load_per_instance (inst); } -mutex_unlock (&core->lock);return mbs_per_sec; }
@@ -203,14 +201,12 @@ static int load_scale_bw(struct venus_core *core)struct venus_inst *inst =NULL ;u32 mbs_per_sec, avg, peak, total_avg =0 , total_peak =0 ; -mutex_lock (&core->lock);list_for_each_entry (inst, &core->instances, list) { mbs_per_sec =load_per_instance (inst);mbs_to_bw (inst, mbs_per_sec, &avg, &peak); total_avg += avg; total_peak += peak; } -mutex_unlock (&core->lock);/* * keep minimum bandwidth vote for "video-mem" path,
@@ -237,8 +233,9 @@ static int load_scale_v1(struct venus_inst *inst)struct device *dev = core->dev;u32 mbs_per_sec;unsigned int i; -int ret; +int ret =0 ; +mutex_lock (&core->lock); mbs_per_sec =load_per_type (core,VIDC_SESSION_TYPE_ENC ) +load_per_type (core,VIDC_SESSION_TYPE_DEC );
@@ -263,17 +260,19 @@ set_freq:if (ret) {dev_err (dev,"failed to set clock rate %lu (%d)\n" , freq, ret); -return ret; + goto exit; } ret =load_scale_bw (core);if (ret) {dev_err (dev,"failed to set bandwidth (%d)\n" , ret); -return ret; + goto exit; } -return 0 ; +exit: +mutex_unlock (&core->lock); +return ret; }static int core_get_v1 (struct venus_core *core)
@@ -960,13 +959,13 @@ static int load_scale_v4(struct venus_inst *inst)struct device *dev = core->dev;unsigned long freq =0 , freq_core1 =0 , freq_core2 =0 ;unsigned long filled_len =0 ; -int i, ret; +int i, ret =0 ;for (i =0 ; i < inst->num_input_bufs; i++) filled_len =max (filled_len, inst->payloads[i]);if (inst->session_type ==VIDC_SESSION_TYPE_DEC && !filled_len) -return 0 ; +return ret; freq =calculate_inst_freq (inst, filled_len); inst->clk_data.freq = freq;
@@ -982,7 +981,6 @@ static int load_scale_v4(struct venus_inst *inst) freq_core2 += inst->clk_data.freq; } } -mutex_unlock (&core->lock); freq =max (freq_core1, freq_core2);
@@ -1006,17 +1004,19 @@ set_freq:if (ret) {dev_err (dev,"failed to set clock rate %lu (%d)\n" , freq, ret); -return ret; + goto exit; } ret =load_scale_bw (core);if (ret) {dev_err (dev,"failed to set bandwidth (%d)\n" , ret); -return ret; + goto exit; } -return 0 ; +exit: +mutex_unlock (&core->lock); +return ret; }static const struct venus_pm_ops pm_ops_v4 = {
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 334/563 ACPI: Change acpi_device_always_present() into acpi_device_override_status()
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit 1a68b346a2c9969c05e80a3b99a9ab160b5655c0 ]
Currently, acpi_bus_get_status() calls acpi_device_always_present() to allow platform quirks to override the _STA return to report that a device is present (status = ACPI_STA_DEFAULT) independent of the _STA return.
In some cases it might also be useful to have the opposite functionality and have a platform quirk which marks a device as not present (status = 0) to work around ACPI table bugs.
Change acpi_device_always_present() into a more generic acpi_device_override_status() function to allow this.
--- drivers/acpi/bus.c | 4 +-- drivers/acpi/x86/utils.c | 64 +++++++++++++++++++++++----------------- include/acpi/acpi_bus.h | 5 ++-- 3 files changed, 42 insertions(+), 31 deletions(-)
drivers/acpi/bus.c +2 -2
@@ -98,8 +98,8 @@ int acpi_bus_get_status(struct acpi_device *device)acpi_status status;unsigned long long sta; -if (acpi_device_always_present (device)) { -acpi_set_device_status (device,ACPI_STA_DEFAULT ); +if (acpi_device_override_status (device, &sta)) { +acpi_set_device_status (device, sta);return 0 ; }
drivers/acpi/x86/utils.c +37 -27
136 lines not on this page · raw message
include/acpi/acpi_bus.h +3 -2
@@ -605,9 +605,10 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state);int acpi_disable_wakeup_device_power (struct acpi_device *dev);#ifdef CONFIG_X86 -bool acpi_device_always_present (struct acpi_device *adev); +bool acpi_device_override_status (struct acpi_device *adev,unsigned long long *status);#else -static inline bool acpi_device_always_present (struct acpi_device *adev) +static inline bool acpi_device_override_status (struct acpi_device *adev, +unsigned long long *status) {return false; }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 335/563 ACPI / x86: Allow specifying acpi_device_override_status() quirks by path
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit ba46e42e925b5d09b4e441f8de3db119cc7df58f ]
Not all ACPI-devices have a HID + UID, allow specifying quirks for acpi_device_override_status() by path too.
Note this moves the path/HID+UID check to after the CPU + DMI checks since the path lookup is somewhat costly.
This way this lookup is only done on devices where the other checks match.
--- drivers/acpi/x86/utils.c | 42 ++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-)
drivers/acpi/x86/utils.c +32 -10
@@ -38,22 +38,30 @@ struct override_status_id {struct x86_cpu_id cpu_ids[2 ];struct dmi_system_id dmi_ids[2 ];/* Optional */ const char *uid; +const char *path;unsigned long long status; }; -#define ENTRY(status, hid, uid, cpu_model, dmi...) { \ +#define ENTRY(status, hid, uid, path, cpu_model, dmi...) { \ { { hid, }, {} }, \ { X86_MATCH_INTEL_FAM6_MODEL(cpu_model, NULL), {} }, \ { { .matches = dmi }, {} }, \ uid, \ + path, \ status, \ } #define PRESENT_ENTRY_HID(hid, uid, cpu_model, dmi...) \ - ENTRY(ACPI_STA_DEFAULT, hid, uid, cpu_model, dmi) + ENTRY(ACPI_STA_DEFAULT, hid, uid, NULL, cpu_model, dmi) #define NOT_PRESENT_ENTRY_HID(hid, uid, cpu_model, dmi...) \ - ENTRY(0, hid, uid, cpu_model, dmi) + ENTRY(0, hid, uid, NULL, cpu_model, dmi) + +#define PRESENT_ENTRY_PATH(path, cpu_model, dmi...) \ + ENTRY(ACPI_STA_DEFAULT, "", NULL, path, cpu_model, dmi) + +#define NOT_PRESENT_ENTRY_PATH(path, cpu_model, dmi...) \ + ENTRY(0, "", NULL, path, cpu_model, dmi)static const struct override_status_id override_status_ids[] = {/*
@@ -120,13 +128,6 @@ bool acpi_device_override_status(struct acpi_device *adev, unsigned long long *sunsigned int i;for (i =0 ; i <ARRAY_SIZE (override_status_ids); i++) { -if (acpi_match_device_ids (adev, override_status_ids[i].hid)) -continue ; - -if (!adev->pnp.unique_id || -strcmp (adev->pnp.unique_id, override_status_ids[i].uid)) -continue ; -if (!x86_match_cpu (override_status_ids[i].cpu_ids))continue ;
@@ -134,6 +135,27 @@ bool acpi_device_override_status(struct acpi_device *adev, unsigned long long *s !dmi_check_system(override_status_ids[i].dmi_ids)) continue; +if (override_status_ids[i].path) { +struct acpi_buffer path = {ACPI_ALLOCATE_BUFFER ,NULL }; +bool match; + +if (acpi_get_name (adev->handle,ACPI_FULL_PATHNAME , &path)) +continue ; + + match =strcmp ((char *)path.pointer, override_status_ids[i].path) ==0 ; +kfree (path.pointer); + +if (!match) +continue ; + }else { +if (acpi_match_device_ids (adev, override_status_ids[i].hid)) +continue ; + +if (!adev->pnp.unique_id || +strcmp (adev->pnp.unique_id, override_status_ids[i].uid)) +continue ; + } + *status = override_status_ids[i].status; ret = true;break ;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 341/563 drm: rcar-du: Fix CRTC timings when CMM is used
In reply to Greg Kroah-HartmanFrom: Laurent Pinchart <[email protected]>
[ Upstream commit f0ce591dc9a97067c6e783a2eaccd22c5476144d ]
When the CMM is enabled, an offset of 25 pixels must be subtracted from the HDS (horizontal display start) and HDE (horizontal display end) registers. Fix the timings calculation, and take this into account in the mode validation.
This fixes a visible horizontal offset in the image with VGA monitors. HDMI monitors seem to be generally more tolerant to incorrect timings, but may be affected too.
--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +16 -4
@@ -215,6 +215,7 @@ static void rcar_du_crtc_set_display_timing(struct rcar_du_crtc *rcrtc)const struct drm_display_mode *mode = &rcrtc->crtc.state->adjusted_mode;struct rcar_du_device *rcdu = rcrtc->dev;unsigned long mode_clock = mode->clock *1000 ; +unsigned int hdse_offset;u32 dsmr;u32 escr;
@@ -298,10 +299,15 @@ static void rcar_du_crtc_set_display_timing(struct rcar_du_crtc *rcrtc) | DSMR_DIPM_DISP | DSMR_CSPM;rcar_du_crtc_write (rcrtc,DSMR , dsmr); + hdse_offset =19 ; +if (rcrtc->group->cmms_mask &BIT (rcrtc->index %2 )) + hdse_offset +=25 ; +/* Display timings */ -rcar_du_crtc_write (rcrtc,HDSR , mode->htotal - mode->hsync_start -19 ); +rcar_du_crtc_write (rcrtc,HDSR , mode->htotal - mode->hsync_start - + hdse_offset);rcar_du_crtc_write (rcrtc,HDER , mode->htotal - mode->hsync_start + - mode->hdisplay -19 ); + mode->hdisplay - hdse_offset);rcar_du_crtc_write (rcrtc,HSWR , mode->hsync_end - mode->hsync_start -1 );rcar_du_crtc_write (rcrtc,HCR , mode->htotal -1 );
@@ -831,6 +837,7 @@ rcar_du_crtc_mode_valid(struct drm_crtc *crtc,struct rcar_du_crtc *rcrtc =to_rcar_crtc (crtc);struct rcar_du_device *rcdu = rcrtc->dev;bool interlaced = mode->flags &DRM_MODE_FLAG_INTERLACE ; +unsigned int min_sync_porch;unsigned int vbp;if (interlaced && !rcar_du_has (rcdu,RCAR_DU_FEATURE_INTERLACED ))
@@ -838,9 +845,14 @@ rcar_du_crtc_mode_valid(struct drm_crtc *crtc,/* * The hardware requires a minimum combined horizontal sync and back -* porch of 20 pixels and a minimum vertical back porch of 3 lines. +* porch of 20 pixels (when CMM isn't used) or 45 pixels (when CMM is +* used), and a minimum vertical back porch of 3 lines. */ -if (mode->htotal - mode->hsync_start <20 ) + min_sync_porch =20 ; +if (rcrtc->group->cmms_mask &BIT (rcrtc->index %2 )) + min_sync_porch +=25 ; + +if (mode->htotal - mode->hsync_start < min_sync_porch)return MODE_HBLANK_NARROW ; vbp = (mode->vtotal - mode->vsync_end) / (interlaced ?2 :1 );
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 343/563 media: rcar-vin: Update format alignment constraints
In reply to Greg Kroah-HartmanFrom: Niklas Söderlund <[email protected]>
[ Upstream commit da6911f330d40cfe115a37249e47643eff555e82 ]
This change fixes two issues with the size constraints for buffers.
- There is no width alignment constraint for RGB formats. Prior to this change they were treated as YUV and as a result were more restricted than needed. Add a new check to differentiate between the two.
- The minimum width and height supported is 5x2, not 2x4, this is an artifact from the driver's soc-camera days. Fix this incorrect assumption.
--- drivers/media/platform/rcar-vin/rcar-v4l2.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/media/platform/rcar-vin/rcar-v4l2.c +11 -4
@@ -175,20 +175,27 @@ static void rvin_format_align(struct rvin_dev *vin, struct v4l2_pix_format *pix)break ; } -/* HW limit width to a multiple of 32 (2^5) for NV12/16 else 2 (2^1) */ +/* Hardware limits width alignment based on format. */ switch (pix->pixelformat) { +/* Multiple of 32 (2^5) for NV12/16. */ case V4L2_PIX_FMT_NV12 :case V4L2_PIX_FMT_NV16 : walign =5 ;break ; -default : +/* Multiple of 2 (2^1) for YUV. */ +case V4L2_PIX_FMT_YUYV : +case V4L2_PIX_FMT_UYVY : walign =1 ;break ; +/* No multiple for RGB. */ +default : + walign =0 ; +break ; }/* Limit to VIN capabilities */ -v4l_bound_align_image (&pix->width,2 , vin->info->max_width, walign, - &pix->height,4 , vin->info->max_height,2 ,0 ); +v4l_bound_align_image (&pix->width,5 , vin->info->max_width, walign, + &pix->height,2 , vin->info->max_height,0 ,0 ); pix->bytesperline =rvin_format_bytesperline (vin, pix); pix->sizeimage =rvin_format_sizeimage (pix);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 329/563 rsi: Fix use-after-free in rsi_rx_done_handler()
In reply to Greg Kroah-HartmanFrom: Zekun Shen <[email protected]>
[ Upstream commit b07e3c6ebc0c20c772c0f54042e430acec2945c3 ]
When freeing rx_cb->rx_skb, the pointer is not set to NULL, a later rsi_rx_done_handler call will try to read the freed address.
This bug will very likley lead to double free, although detected early as use-after-free bug.
The bug is triggerable with a compromised/malfunctional usb device. After applying the patch, the same input no longer triggers the use-after-free.
Attached is the kasan report from fuzzing.
BUG: KASAN: use-after-free in rsi_rx_done_handler+0x354/0x430 [rsi_usb] Read of size 4 at addr ffff8880188e5930 by task modprobe/231 Call Trace: <IRQ> dump_stack+0x76/0xa0 print_address_description.constprop.0+0x16/0x200 ? rsi_rx_done_handler+0x354/0x430 [rsi_usb] ? rsi_rx_done_handler+0x354/0x430 [rsi_usb] __kasan_report.cold+0x37/0x7c ? dma_direct_unmap_page+0x90/0x110 ? rsi_rx_done_handler+0x354/0x430 [rsi_usb] kasan_report+0xe/0x20 rsi_rx_done_handler+0x354/0x430 [rsi_usb] __usb_hcd_giveback_urb+0x1e4/0x380 usb_giveback_urb_bh+0x241/0x4f0 ? __usb_hcd_giveback_urb+0x380/0x380 ? apic_timer_interrupt+0xa/0x20 tasklet_action_common.isra.0+0x135/0x330 __do_softirq+0x18c/0x634 ? handle_irq_event+0xcd/0x157 ? handle_edge_irq+0x1eb/0x7b0 irq_exit+0x114/0x140 do_IRQ+0x91/0x1e0 common_interrupt+0xf/0xf </IRQ>
--- drivers/net/wireless/rsi/rsi_91x_usb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/wireless/rsi/rsi_91x_usb.c +7 -1
@@ -269,8 +269,12 @@ static void rsi_rx_done_handler(struct urb *urb)struct rsi_91x_usbdev *dev = (struct rsi_91x_usbdev *)rx_cb->data;int status = -EINVAL ; +if (!rx_cb->rx_skb) +return ; +if (urb->status) {dev_kfree_skb (rx_cb->rx_skb); + rx_cb->rx_skb =NULL ;return ; }
@@ -294,8 +298,10 @@ out:if (rsi_rx_urb_submit (dev->priv, rx_cb->ep_num,GFP_ATOMIC ))rsi_dbg (ERR_ZONE ,"%s: Failed in urb submission" , __func__); -if (status) +if (status) {dev_kfree_skb (rx_cb->rx_skb); + rx_cb->rx_skb =NULL ; + } }static void rsi_rx_urb_kill (struct rsi_hw *adapter,u8 ep_num)
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 318/563 ARM: imx: rename DEBUG_IMX21_IMX27_UART to DEBUG_IMX27_UART
In reply to Greg Kroah-HartmanFrom: Lukas Bulwahn <[email protected]>
[ Upstream commit b0100bce4ff82ec1ccd3c1f3d339fd2df6a81784 ]
Since commit 4b563a066611 ("ARM: imx: Remove imx21 support"), the config DEBUG_IMX21_IMX27_UART is really only debug support for IMX27.
So, rename this option to DEBUG_IMX27_UART and adjust dependencies in Kconfig and rename the definitions to IMX27 as further clean-up.
This issue was discovered with ./scripts/checkkconfigsymbols.py, which reported that DEBUG_IMX21_IMX27_UART depends on the non-existing config SOC_IMX21.
--- arch/arm/Kconfig.debug | 14 +++++++------- arch/arm/include/debug/imx-uart.h | 18 +++++++++--------- 2 files changed, 16 insertions(+), 16 deletions(-)
arch/arm/Kconfig.debug +7 -7
@@ -400,12 +400,12 @@ choice Say Y here if you want kernel low-level debugging support on i.MX25. - config DEBUG_IMX21_IMX27_UART - bool "i.MX21 and i.MX27 Debug UART" - depends on SOC_IMX21 || SOC_IMX27 + config DEBUG_IMX27_UART + bool "i.MX27 Debug UART" + depends on SOC_IMX27 help Say Y here if you want kernel low-level debugging support - on i.MX21 or i.MX27. + on i.MX27. config DEBUG_IMX28_UART bool "i.MX28 Debug UART"
@@ -1523,7 +1523,7 @@ config DEBUG_IMX_UART_PORT int "i.MX Debug UART Port Selection" depends on DEBUG_IMX1_UART || \ DEBUG_IMX25_UART || \ - DEBUG_IMX21_IMX27_UART || \ + DEBUG_IMX27_UART || \ DEBUG_IMX31_UART || \ DEBUG_IMX35_UART || \ DEBUG_IMX50_UART || \
@@ -1591,12 +1591,12 @@ config DEBUG_LL_INCLUDE default "debug/icedcc.S" if DEBUG_ICEDCC default "debug/imx.S" if DEBUG_IMX1_UART || \ DEBUG_IMX25_UART || \ - DEBUG_IMX21_IMX27_UART || \ + DEBUG_IMX27_UART || \ DEBUG_IMX31_UART || \ DEBUG_IMX35_UART || \ DEBUG_IMX50_UART || \ DEBUG_IMX51_UART || \ - DEBUG_IMX53_UART ||\ + DEBUG_IMX53_UART || \ DEBUG_IMX6Q_UART || \ DEBUG_IMX6SL_UART || \ DEBUG_IMX6SX_UART || \
arch/arm/include/debug/imx-uart.h +9 -9
@@ -11,13 +11,6 @@#define IMX1_UART_BASE_ADDR (n) IMX1_UART##n##_BASE_ADDR#define IMX1_UART_BASE (n) IMX1_UART_BASE_ADDR(n) -#define IMX21_UART1_BASE_ADDR 0x1000a000 -#define IMX21_UART2_BASE_ADDR 0x1000b000 -#define IMX21_UART3_BASE_ADDR 0x1000c000 -#define IMX21_UART4_BASE_ADDR 0x1000d000 -#define IMX21_UART_BASE_ADDR (n) IMX21_UART##n##_BASE_ADDR -#define IMX21_UART_BASE (n) IMX21_UART_BASE_ADDR(n) -#define IMX25_UART1_BASE_ADDR 0x43f90000#define IMX25_UART2_BASE_ADDR 0x43f94000#define IMX25_UART3_BASE_ADDR 0x5000c000
@@ -26,6 +19,13 @@#define IMX25_UART_BASE_ADDR (n) IMX25_UART##n##_BASE_ADDR#define IMX25_UART_BASE (n) IMX25_UART_BASE_ADDR(n) +#define IMX27_UART1_BASE_ADDR 0x1000a000 +#define IMX27_UART2_BASE_ADDR 0x1000b000 +#define IMX27_UART3_BASE_ADDR 0x1000c000 +#define IMX27_UART4_BASE_ADDR 0x1000d000 +#define IMX27_UART_BASE_ADDR (n) IMX27_UART##n##_BASE_ADDR +#define IMX27_UART_BASE (n) IMX27_UART_BASE_ADDR(n) +#define IMX31_UART1_BASE_ADDR 0x43f90000#define IMX31_UART2_BASE_ADDR 0x43f94000#define IMX31_UART3_BASE_ADDR 0x5000c000
@@ -112,10 +112,10 @@#ifdef CONFIG_DEBUG_IMX1_UART #define UART_PADDR IMX_DEBUG_UART_BASE(IMX1) -#elif defined(CONFIG_DEBUG_IMX21_IMX27_UART ) -#define UART_PADDR IMX_DEBUG_UART_BASE(IMX21)#elif defined(CONFIG_DEBUG_IMX25_UART )#define UART_PADDR IMX_DEBUG_UART_BASE(IMX25) +#elif defined(CONFIG_DEBUG_IMX27_UART ) +#define UART_PADDR IMX_DEBUG_UART_BASE(IMX27)#elif defined(CONFIG_DEBUG_IMX31_UART )#define UART_PADDR IMX_DEBUG_UART_BASE(IMX31)#elif defined(CONFIG_DEBUG_IMX35_UART )
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 364/563 media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach()
In reply to Greg Kroah-HartmanFrom: Zhou Qingyang <[email protected]>
[ Upstream commit 3af86b046933ba513d08399dba0d4d8b50d607d0 ]
In hexium_attach(dev, info), saa7146_vv_init() is called to allocate a new memory for dev->vv_data. saa7146_vv_release() will be called on failure of saa7146_register_device(). There is a dereference of dev->vv_data in saa7146_vv_release(), which could lead to a NULL pointer dereference on failure of saa7146_vv_init().
Fix this bug by adding a check of saa7146_vv_init().
This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs.
Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug.
Builds with CONFIG_VIDEO_HEXIUM_GEMINI=m show no new warnings, and our static analyzer no longer warns about this code.
--- drivers/media/common/saa7146/saa7146_fops.c | 2 +- drivers/media/pci/saa7146/hexium_gemini.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-)
drivers/media/common/saa7146/saa7146_fops.c +1 -1
@@ -523,7 +523,7 @@ int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv)ERR ("out of memory. aborting.\n" );kfree (vv);v4l2_ctrl_handler_free (hdl); -return -1 ; +return -ENOMEM ; } saa7146_video_uops.init (dev,vv);
drivers/media/pci/saa7146/hexium_gemini.c +6 -1
@@ -284,7 +284,12 @@ static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_dhexium_set_input (hexium,0 ); hexium->cur_input =0 ; -saa7146_vv_init (dev, &vv_data); + ret =saa7146_vv_init (dev, &vv_data); +if (ret) { +i2c_del_adapter (&hexium->i2c_adapter); +kfree (hexium); +return ret; + } vv_data.vid_ops.vidioc_enum_input = vidioc_enum_input; vv_data.vid_ops.vidioc_g_input = vidioc_g_input;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 368/563 arm64: tegra: Adjust length of CCPLEX cluster MMIO region
In reply to Greg Kroah-HartmanFrom: Thierry Reding <[email protected]>
[ Upstream commit 2b14cbd643feea5fc17c6e8bead4e71088c69acd ]
The Tegra186 CCPLEX cluster register region is 4 MiB is length, not 4 MiB - 1. This was likely presumed to be the "limit" rather than length. Fix it up.
--- arch/arm64/boot/dts/nvidia/tegra186.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/nvidia/tegra186.dtsi +1 -1
@@ -985,7 +985,7 @@ ccplex@e000000 { compatible = "nvidia,tegra186-ccplex-cluster"; - reg = <0x0 0x0e000000 0x0 0x3fffff>; + reg = <0x0 0x0e000000 0x0 0x400000>; nvidia,bpmp = <&bpmp>; };
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 369/563 PM: runtime: Add safety net to supplier device release
In reply to Greg Kroah-HartmanFrom: Rafael J. Wysocki <[email protected]>
[ Upstream commit d1579e61192e0e686faa4208500ef4c3b529b16c ]
Because refcount_dec_not_one() returns true if the target refcount becomes saturated, it is generally unsafe to use its return value as a loop termination condition, but that is what happens when a device link's supplier device is released during runtime PM suspend operations and on device link removal.
To address this, introduce pm_runtime_release_supplier() to be used in the above cases which will check the supplier device's runtime PM usage counter in addition to the refcount_dec_not_one() return value, so the loop can be terminated in case the rpm_active refcount value becomes invalid, and update the code in question to use it as appropriate.
This change is not expected to have any visible functional impact.
--- drivers/base/core.c | 3 +-- drivers/base/power/runtime.c | 41 ++++++++++++++++++++++++++---------- include/linux/pm_runtime.h | 3 +++ 3 files changed, 34 insertions(+), 13 deletions(-)
drivers/base/core.c +1 -2
@@ -348,8 +348,7 @@ static void device_link_release_fn(struct work_struct *work)/* Ensure that all references to the link object have been dropped. */ device_link_synchronize_removal (); -while (refcount_dec_not_one (&link->rpm_active)) -pm_runtime_put (link->supplier); +pm_runtime_release_supplier (link, true);put_device (link->consumer);put_device (link->supplier);
drivers/base/power/runtime.c +30 -11
58 lines not on this page · raw message
include/linux/pm_runtime.h +3 -0
@@ -58,6 +58,7 @@ extern void pm_runtime_get_suppliers(struct device *dev);extern void pm_runtime_put_suppliers (struct device *dev);extern void pm_runtime_new_link (struct device *dev);extern void pm_runtime_drop_link (struct device_link *link); +extern void pm_runtime_release_supplier (struct device_link *link,bool check_idle);/** * pm_runtime_get_if_in_use - Conditionally bump up runtime PM usage counter.
@@ -279,6 +280,8 @@ static inline void pm_runtime_get_suppliers(struct device *dev) {}static inline void pm_runtime_put_suppliers (struct device *dev) {}static inline void pm_runtime_new_link (struct device *dev) {}static inline void pm_runtime_drop_link (struct device_link *link) {} +static inline void pm_runtime_release_supplier (struct device_link *link, +bool check_idle) {}#endif /* !CONFIG_PM */
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 373/563 rtw88: 8822c: update rx settings to prevent potential hw deadlock
In reply to Greg Kroah-HartmanFrom: Po-Hao Huang <[email protected]>
[ Upstream commit c1afb26727d9e507d3e17a9890e7aaf7fc85cd55 ]
These settings enables mac to detect and recover when rx fifo circuit deadlock occurs. Previous version missed this, so we fix it.
--- drivers/net/wireless/realtek/rtw88/main.c | 2 +- drivers/net/wireless/realtek/rtw88/rtw8821c.h | 2 +- drivers/net/wireless/realtek/rtw88/rtw8822b.c | 2 +- drivers/net/wireless/realtek/rtw88/rtw8822c.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/realtek/rtw88/main.c +1 -1
@@ -1652,7 +1652,7 @@ int rtw_core_init(struct rtw_dev *rtwdev)/* default rx filter setting */ rtwdev->hal.rcr =BIT_APP_FCS |BIT_APP_MIC |BIT_APP_ICV | -BIT_HTC_LOC_CTRL |BIT_APP_PHYSTS | +BIT_PKTCTL_DLEN |BIT_HTC_LOC_CTRL |BIT_APP_PHYSTS |BIT_AB |BIT_AM |BIT_APM ; ret =rtw_load_firmware (rtwdev,RTW_NORMAL_FW );
drivers/net/wireless/realtek/rtw88/rtw8821c.h +1 -1
@@ -131,7 +131,7 @@ _rtw_write32s_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask, u32 data)#define WLAN_TX_FUNC_CFG2 0x30#define WLAN_MAC_OPT_NORM_FUNC1 0x98#define WLAN_MAC_OPT_LB_FUNC1 0x80 -#define WLAN_MAC_OPT_FUNC2 0x30810041 +#define WLAN_MAC_OPT_FUNC2 0xb0810041#define WLAN_SIFS_CFG (WLAN_SIFS_CCK_CONT_TX | \ (WLAN_SIFS_OFDM_CONT_TX << BIT_SHIFT_SIFS_OFDM_CTX) | \
drivers/net/wireless/realtek/rtw88/rtw8822b.c +1 -1
@@ -204,7 +204,7 @@ static void rtw8822b_phy_set_param(struct rtw_dev *rtwdev)#define WLAN_TX_FUNC_CFG2 0x30#define WLAN_MAC_OPT_NORM_FUNC1 0x98#define WLAN_MAC_OPT_LB_FUNC1 0x80 -#define WLAN_MAC_OPT_FUNC2 0x30810041 +#define WLAN_MAC_OPT_FUNC2 0xb0810041#define WLAN_SIFS_CFG (WLAN_SIFS_CCK_CONT_TX | \ (WLAN_SIFS_OFDM_CONT_TX << BIT_SHIFT_SIFS_OFDM_CTX) | \
drivers/net/wireless/realtek/rtw88/rtw8822c.c +1 -1
@@ -1248,7 +1248,7 @@ static void rtw8822c_phy_set_param(struct rtw_dev *rtwdev)#define WLAN_TX_FUNC_CFG2 0x30#define WLAN_MAC_OPT_NORM_FUNC1 0x98#define WLAN_MAC_OPT_LB_FUNC1 0x80 -#define WLAN_MAC_OPT_FUNC2 0x30810041 +#define WLAN_MAC_OPT_FUNC2 0xb0810041#define WLAN_MAC_INT_MIG_CFG 0x33330000#define WLAN_SIFS_CFG (WLAN_SIFS_CCK_CONT_TX | \
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 374/563 PM: AVS: qcom-cpr: Use div64_ul instead of do_div
In reply to Greg Kroah-HartmanFrom: Changcheng Deng <[email protected]>
[ Upstream commit 92c550f9ffd2884bb5def52b5c0485a35e452784 ]
do_div() does a 64-by-32 division. Here the divisor is an unsigned long which on some platforms is 64 bit wide. So use div64_ul instead of do_div to avoid a possible truncation.
--- drivers/soc/qcom/cpr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/cpr.c +1 -1
@@ -1043,7 +1043,7 @@ static int cpr_interpolate(const struct corner *corner, int step_volt,return corner->uV; temp = f_diff * (uV_high - uV_low); -do_div (temp, f_high - f_low); + temp =div64_ul (temp, f_high - f_low);/* * max_volt_scale has units of uV/MHz while freq values
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 356/563 x86/mce: Allow instrumentation during task work queueing
In reply to Greg Kroah-HartmanFrom: Borislav Petkov <[email protected]>
[ Upstream commit 4fbce464db81a42f9a57ee242d6150ec7f996415 ]
Fixes
vmlinux.o: warning: objtool: do_machine_check()+0xdb1: call to queue_task_work() leaves .noinstr.text section
--- arch/x86/kernel/cpu/mce/core.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
arch/x86/kernel/cpu/mce/core.c +11 -0
@@ -1443,6 +1443,14 @@ noinstr void do_machine_check(struct pt_regs *regs)if (worst !=MCE_AR_SEVERITY && !kill_it) goto out; +/* +* Enable instrumentation around the external facilities like +* task_work_add() (via queue_task_work()), fixup_exception() etc. +* For now, that is. Fixing this properly would need a lot more involved +* reorganization. +*/ +instrumentation_begin (); +/* Fault was in user mode and we need to take some action */ if ((m.cs &3 ) ==3 ) {/* If this triggers there is no way to recover. Die hard. */
@@ -1468,6 +1476,9 @@ noinstr void do_machine_check(struct pt_regs *regs)if (m.kflags &MCE_IN_KERNEL_COPYIN )queue_task_work (&m, msg, kill_it); } + +instrumentation_end (); + out:mce_wrmsrl (MSR_IA32_MCG_STATUS ,0 ); }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 382/563 xfrm: rate limit SA mapping change message to user space
In reply to Greg Kroah-HartmanFrom: Antony Antony <[email protected]>
[ Upstream commit 4e484b3e969b52effd95c17f7a86f39208b2ccf4 ]
Kernel generates mapping change message, XFRM_MSG_MAPPING, when a source port chage is detected on a input state with UDP encapsulation set. Kernel generates a message for each IPsec packet with new source port. For a high speed flow per packet mapping change message can be excessive, and can overload the user space listener.
Introduce rate limiting for XFRM_MSG_MAPPING message to the user space.
The rate limiting is configurable via netlink, when adding a new SA or updating it. Use the new attribute XFRMA_MTIMER_THRESH in seconds.
v1->v2 change:
update xfrm_sa_len()
v2->v3 changes:
use u32 insted unsigned long to reduce size of struct xfrm_state fix xfrm_ompat size Reported-by: kernel test robot <[email protected]> accept XFRM_MSG_MAPPING only when XFRMA_ENCAP is present
--- include/net/xfrm.h | 5 +++++ include/uapi/linux/xfrm.h | 1 + net/xfrm/xfrm_compat.c | 6 ++++-- net/xfrm/xfrm_state.c | 23 ++++++++++++++++++++++- net/xfrm/xfrm_user.c | 18 +++++++++++++++++- 5 files changed, 49 insertions(+), 4 deletions(-)
include/net/xfrm.h +5 -0
@@ -193,6 +193,11 @@ struct xfrm_state {struct xfrm_algo_aead *aead;const char *geniv; +/* mapping change rate limiting */ +__be16 new_mapping_sport; +u32 new_mapping;/* seconds */ +u32 mapping_maxage;/* seconds for input SA */ +/* Data for encapsulator */ struct xfrm_encap_tmpl *encap;struct sock __rcu *encap_sk;
include/uapi/linux/xfrm.h +1 -0
@@ -308,6 +308,7 @@ enum xfrm_attr_type_t {XFRMA_SET_MARK ,/* __u32 */ XFRMA_SET_MARK_MASK ,/* __u32 */ XFRMA_IF_ID ,/* __u32 */ +XFRMA_MTIMER_THRESH ,/* __u32 in seconds for input SA */ __XFRMA_MAX#define XFRMA_OUTPUT_MARK XFRMA_SET_MARK/* Compatibility */
net/xfrm/xfrm_compat.c +4 -2
@@ -127,6 +127,7 @@ static const struct nla_policy compat_policy[XFRMA_MAX+1] = { [XFRMA_SET_MARK] = { .type = NLA_U32 }, [XFRMA_SET_MARK_MASK] = { .type = NLA_U32 }, [XFRMA_IF_ID] = { .type = NLA_U32 }, + [XFRMA_MTIMER_THRESH] = { .type = NLA_U32 }, }; static struct nlmsghdr *xfrm_nlmsg_put_compat(struct sk_buff *skb,
@@ -274,9 +275,10 @@ static int xfrm_xlate64_attr(struct sk_buff *dst, const struct nlattr *src)case XFRMA_SET_MARK :case XFRMA_SET_MARK_MASK :case XFRMA_IF_ID : +case XFRMA_MTIMER_THRESH :return xfrm_nla_cpy (dst, src,nla_len (src));default : -BUILD_BUG_ON (XFRMA_MAX !=XFRMA_IF_ID ); +BUILD_BUG_ON (XFRMA_MAX !=XFRMA_MTIMER_THRESH );pr_warn_once ("unsupported nla_type %d\n" , src->nla_type);return -EOPNOTSUPP ; }
@@ -431,7 +433,7 @@ static int xfrm_xlate32_attr(void *dst, const struct nlattr *nla,int err;if (type >XFRMA_MAX ) { -BUILD_BUG_ON (XFRMA_MAX !=XFRMA_IF_ID ); +BUILD_BUG_ON (XFRMA_MAX !=XFRMA_MTIMER_THRESH );NL_SET_ERR_MSG (extack,"Bad attribute" );return -EOPNOTSUPP ; }
net/xfrm/xfrm_state.c +22 -1
@@ -1557,6 +1557,9 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig, x->km.seq = orig->km.seq; x->replay = orig->replay; x->preplay = orig->preplay; + x->mapping_maxage = orig->mapping_maxage; + x->new_mapping =0 ; + x->new_mapping_sport =0 ;return x;
@@ -2208,7 +2211,7 @@ int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol) }EXPORT_SYMBOL (km_query); -int km_new_mapping (struct xfrm_state *x,xfrm_address_t *ipaddr,__be16 sport) +static int __km_new_mapping (struct xfrm_state *x,xfrm_address_t *ipaddr,__be16 sport) {int err = -EINVAL ;struct xfrm_mgr *km;
@@ -2223,6 +2226,24 @@ int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport)rcu_read_unlock ();return err; } + +int km_new_mapping (struct xfrm_state *x,xfrm_address_t *ipaddr,__be16 sport) +{ +int ret =0 ; + +if (x->mapping_maxage) { +if ((jiffies /HZ - x->new_mapping) > x->mapping_maxage || + x->new_mapping_sport != sport) { + x->new_mapping_sport = sport; + x->new_mapping = jiffies /HZ ; + ret =__km_new_mapping (x, ipaddr, sport); + } + }else { + ret =__km_new_mapping (x, ipaddr, sport); + } + +return ret; +}EXPORT_SYMBOL (km_new_mapping);void km_policy_expired (struct xfrm_policy *pol,int dir,int hard,u32 portid)
net/xfrm/xfrm_user.c +17 -1
@@ -282,6 +282,10 @@ static int verify_newsa_info(struct xfrm_usersa_info *p, err =0 ; +if (attrs[XFRMA_MTIMER_THRESH ]) +if (!attrs[XFRMA_ENCAP ]) + err = -EINVAL ; + out:return err; }
@@ -521,6 +525,7 @@ static void xfrm_update_ae_params(struct xfrm_state *x, struct nlattr **attrs,struct nlattr *lt = attrs[XFRMA_LTIME_VAL ];struct nlattr *et = attrs[XFRMA_ETIMER_THRESH ];struct nlattr *rt = attrs[XFRMA_REPLAY_THRESH ]; +struct nlattr *mt = attrs[XFRMA_MTIMER_THRESH ];if (re) {struct xfrm_replay_state_esn *replay_esn;
@@ -552,6 +557,9 @@ static void xfrm_update_ae_params(struct xfrm_state *x, struct nlattr **attrs,if (rt) x->replay_maxdiff =nla_get_u32 (rt); + +if (mt) + x->mapping_maxage =nla_get_u32 (mt); }static void xfrm_smark_init (struct nlattr **attrs,struct xfrm_mark *m)
@@ -969,8 +977,13 @@ static int copy_to_user_state_extra(struct xfrm_state *x,if (ret) goto out; } -if (x->security) +if (x->security) { ret =copy_sec_ctx (x->security, skb); +if (ret) + goto out; + } +if (x->mapping_maxage) + ret =nla_put_u32 (skb,XFRMA_MTIMER_THRESH , x->mapping_maxage); out:return ret; }
@@ -2924,6 +2937,9 @@ static inline unsigned int xfrm_sa_len(struct xfrm_state *x)/* Must count x->lastused as it may become non-zero behind our back. */ l +=nla_total_size_64bit (sizeof (u64)); +if (x->mapping_maxage) + l +=nla_total_size (sizeof (x->mapping_maxage)); +return l; }
Signature · 1 line
2.34.1