id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
baa9934908ad1cb6f7093c8ba15d518a43419f9a
Analyze and fix the following issue in the Linux kernel code: MAINTAINERS: fix nonexistent dtbinding file name
Problem Details: The blamed commit converted the fsl,qoriq-mc.txt into fsl,qoriq-mc.yaml but forgot to also update the MAINTAINERS file to reference the new filename. Fix this by using the corrent filename - fsl,qoriq-mc.yaml. Fixes: bfb921b2a9d5 ("dt-bindings: misc: fsl,qoriq-mc: convert to yaml format") Signed-off-...
```diff diff --git a/MAINTAINERS b/MAINTAINERS index 1fd70e62829b..28a69aaa0fa5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19298,7 +19298,7 @@ M: Ioana Ciornei <ioana.ciornei@nxp.com> L: linux-kernel@vger.kernel.org S: Maintained F: Documentation/ABI/stable/sysfs-bus-fsl-mc -F: Documentation/devicetree/bindings/...
97e81f78d3cbf061a809bbb8180a5b96395b8e03
Analyze and fix the following issue in the Linux kernel code: drm/i915/display: Fix build error without DRM_FBDEV_EMULATION
Problem Details: In file included from <command-line>: ./drivers/gpu/drm/i915/display/intel_fbdev.h: In function ‘intel_fbdev_framebuffer’: ./drivers/gpu/drm/i915/display/intel_fbdev.h:32:16: error: ‘NULL’ undeclared (first use in this function) 32 | return NULL; | ^~~~ ./drivers/gpu/drm...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.h b/drivers/gpu/drm/i915/display/intel_fbdev.h index ca2c8c438f02..89bad3a2b01a 100644 --- a/drivers/gpu/drm/i915/display/intel_fbdev.h +++ b/drivers/gpu/drm/i915/display/intel_fbdev.h @@ -6,6 +6,8 @@ #ifndef __INTEL_FBDEV_H__ #define __INTEL_FBDEV_H__ +...
2790ce23951f0c497810c44ad60a126a59c8d84c
Analyze and fix the following issue in the Linux kernel code: serial: stm32: do not deassert RS485 RTS GPIO prematurely
Problem Details: If stm32_usart_start_tx is called with an empty xmit buffer, RTS GPIO could be deasserted prematurely, as bytes in TX FIFO are still transmitting. So this patch remove rts disable when xmit buffer is empty. Fixes: d7c76716169d ("serial: stm32: Use TC interrupt to deassert GPIO RTS in RS485 mode") Cc: ...
```diff diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 4c97965ec43b..ad06b760cfca 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -965,10 +965,8 @@ static void stm32_usart_start_tx(struct uart_port *port) { struct tty_port *tport = &port...
9e2a0d4591d2fef24f79940b884470e674374ed8
Analyze and fix the following issue in the Linux kernel code: serial: icom: fix code format problems
Problem Details: Fix below inconsistent indenting smatch warning. smatch warnings: drivers/tty/serial/icom.c:1768 icom_probe() warn: inconsistent indenting Removed that useless (void *), the code would fit on a single 100c line Removed '{' and '}'. Signed-off-by: Charles Han <hanchunchao@inspur.com> Link: https://lo...
```diff diff --git a/drivers/tty/serial/icom.c b/drivers/tty/serial/icom.c index 29e42831df39..7fb995a8490e 100644 --- a/drivers/tty/serial/icom.c +++ b/drivers/tty/serial/icom.c @@ -1764,11 +1764,10 @@ static int icom_probe(struct pci_dev *dev, goto probe_exit1; } - /* save off irq and request irq line */ - r...
81100b9a7b0515132996d62a7a676a77676cb6e3
Analyze and fix the following issue in the Linux kernel code: serial: sh-sci: Save and restore more registers
Problem Details: On (H)SCIF with a Baud Rate Generator for External Clock (BRG), there are multiple ways to configure the requested serial speed. If firmware uses a different method than Linux, and if any debug info is printed after the Bit Rate Register (SCBRR) is restored, but before termios is reconfigured (which c...
```diff diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 2db2d85003f7..1c8480d0338e 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -105,10 +105,15 @@ struct plat_sci_reg { }; struct sci_suspend_regs { + u16 scdl; + u16 sccks; u16 scsmr; u16 scscr; u16...
e98ab45ec5182605d2e00114cba3bbf46b0ea27f
Analyze and fix the following issue in the Linux kernel code: tty: serial: lpuart: only disable CTS instead of overwriting the whole UARTMODIR register
Problem Details: No need to overwrite the whole UARTMODIR register before waiting the transmit engine complete, actually our target here is only to disable CTS flow control to avoid the dirty data in TX FIFO may block the transmit engine complete. Also delete the following duplicate CTS disable configuration. Fixes: d...
```diff diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index c8cc0a241fba..33eeefa6fa8f 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -2349,15 +2349,19 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, /* update the per-po...
a26503092c75abba70a0be2aa01145ecf90c2a22
Analyze and fix the following issue in the Linux kernel code: serial: 8250_dma: terminate correct DMA in tx_dma_flush()
Problem Details: When flushing transmit side DMA, it is the transmit channel that should be terminated, not the receive channel. Fixes: 9e512eaaf8f40 ("serial: 8250: Fix fifo underflow on flush") Cc: stable <stable@kernel.org> Reported-by: Wentao Guan <guanwentao@uniontech.com> Signed-off-by: John Keeping <jkeeping@in...
```diff diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c index f245a84f4a50..bdd26c9f34bd 100644 --- a/drivers/tty/serial/8250/8250_dma.c +++ b/drivers/tty/serial/8250/8250_dma.c @@ -162,7 +162,7 @@ void serial8250_tx_dma_flush(struct uart_8250_port *p) */ dma->tx_size = 0; - ...
f5cb528d6441eb860250a2f085773aac4f44085e
Analyze and fix the following issue in the Linux kernel code: tty: serial: fsl_lpuart: disable transmitter before changing RS485 related registers
Problem Details: According to the LPUART reference manual, TXRTSE and TXRTSPOL of MODIR register only can be changed when the transmitter is disabled. So disable the transmitter before changing RS485 related registers and re-enable it after the change is done. Fixes: 67b01837861c ("tty: serial: lpuart: Add RS485 suppo...
```diff diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 91d02c55c470..203ec3b46304 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1484,6 +1484,19 @@ static int lpuart32_config_rs485(struct uart_port *port, struct ktermios *termio unsigned ...
528f31191ebaa00d4a99b293eef1d16f604a0bd0
Analyze and fix the following issue in the Linux kernel code: tty: srmcons: fix retval from srmcons_init()
Problem Details: The value returned from srmcons_init() was -ENODEV for over 2 decades. But it does not matter, given device_initcall() ignores retvals. But to be honest, return 0 in case the tty driver was registered properly. To do that, the condition is inverted and a short path taken in case of error. err_free_d...
```diff diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c index 3e61073f4b30..b9cd364e814e 100644 --- a/arch/alpha/kernel/srmcons.c +++ b/arch/alpha/kernel/srmcons.c @@ -196,40 +196,44 @@ static const struct tty_operations srmcons_ops = { static int __init srmcons_init(void) { + struct tty_drive...
109e06ae1dcf41d470705c54a67b123792424279
Analyze and fix the following issue in the Linux kernel code: tty: tty_driver: convert "TTY Driver Flags" to an enum
Problem Details: Convert TTY_DRIVER_* macros (flags) to an enum. This allows for easier kernel-doc (the comment needed fine tuning), grouping of these nicely, and proper checking. Given these are flags, define them using modern BIT() instead of hex constants. It turns out (thanks, kernel-doc checker) that internal TT...
```diff diff --git a/Documentation/driver-api/tty/tty_driver.rst b/Documentation/driver-api/tty/tty_driver.rst index cc529f863406..f6cbffdb6e01 100644 --- a/Documentation/driver-api/tty/tty_driver.rst +++ b/Documentation/driver-api/tty/tty_driver.rst @@ -35,7 +35,7 @@ Here comes the documentation of flags accepted by t...
d97aa066678bd1e2951ee93db9690835dfe57ab6
Analyze and fix the following issue in the Linux kernel code: tty: n_tty: use uint for space returned by tty_write_room()
Problem Details: tty_write_room() returns an "unsigned int". So in case some insane driver (like my tty test driver) returns (legitimate) UINT_MAX from its tty_operations::write_room(), n_tty is confused on several places. For example, in process_output_block(), the result of tty_write_room() is stored into (signed) "...
```diff diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 2c5995019dd1..765d24268d75 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -488,7 +488,8 @@ static int do_output_char(u8 c, struct tty_struct *tty, int space) static int process_output(u8 c, struct tty_struct *tty) { struct n_tty_dat...
c1aa3daa517292303d98ff61f0440c354669f948
Analyze and fix the following issue in the Linux kernel code: printk/panic: Add option to allow non-panic CPUs to write to the ring buffer.
Problem Details: Commit 779dbc2e78d7 ("printk: Avoid non-panic CPUs writing to ringbuffer") aimed to isolate panic-related messages. However, when panic() itself malfunctions, messages from non-panic CPUs become crucial for debugging. While commit bcc954c6caba ("printk/panic: Allow cpu backtraces to be written into ri...
```diff diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 05f5935eeac8..961bc82f0599 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5013,6 +5013,14 @@ Format: <bool> default...
fc486c2d060f67d672ddad81724f7c8a4d329570
Analyze and fix the following issue in the Linux kernel code: Revert "gre: Fix IPv6 link-local address generation."
Problem Details: This reverts commit 183185a18ff96751db52a46ccf93fff3a1f42815. This patch broke net/forwarding/ip6gre_custom_multipath_hash.sh in some circumstances (https://lore.kernel.org/netdev/Z9RIyKZDNoka53EO@mini-arch/). Let's revert it while the problem is being investigated. Fixes: 183185a18ff9 ("gre: Fix IPv...
```diff diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 8b6258819dad..ac8cc1076536 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -3209,13 +3209,16 @@ static void add_v4_addrs(struct inet6_dev *idev) struct in6_addr addr; struct net_device *dev; struct net *net = dev_net(idev->dev); - ...
355d940f4d5ae56ed082a455ce2cc737c7e898e8
Analyze and fix the following issue in the Linux kernel code: Revert "selftests: Add IPv6 link-local address generation tests for GRE devices."
Problem Details: This reverts commit 6f50175ccad4278ed3a9394c00b797b75441bd6e. Commit 183185a18ff9 ("gre: Fix IPv6 link-local address generation.") is going to be reverted. So let's revert the corresponding kselftest first. Signed-off-by: Guillaume Nault <gnault@redhat.com> Link: https://patch.msgid.link/259a9e98f7f1...
```diff diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile index 843ab747645d..8f32b4f01aee 100644 --- a/tools/testing/selftests/net/Makefile +++ b/tools/testing/selftests/net/Makefile @@ -31,7 +31,6 @@ TEST_PROGS += veth.sh TEST_PROGS += ioam6.sh TEST_PROGS += gro.sh TEST_PROGS...
51d0de7596a458096756c895cfed6bc4a7ecac10
Analyze and fix the following issue in the Linux kernel code: rust: platform: require Send for Driver trait implementers
Problem Details: The instance of Self, returned and created by Driver::probe() is dropped in the bus' remove() callback. Request implementers of the Driver trait to implement Send, since the remove() callback is not guaranteed to run from the same thread as probe(). Fixes: 683a63befc73 ("rust: platform: add basic pla...
```diff diff --git a/rust/kernel/platform.rs b/rust/kernel/platform.rs index 2811ca53d8b6..e37531bae8e9 100644 --- a/rust/kernel/platform.rs +++ b/rust/kernel/platform.rs @@ -149,7 +149,7 @@ macro_rules! module_platform_driver { /// } /// } ///``` -pub trait Driver { +pub trait Driver: Send { /// The type h...
935e1d90bf6f14cd190b3a95f3cbf7e298123043
Analyze and fix the following issue in the Linux kernel code: rust: pci: require Send for Driver trait implementers
Problem Details: The instance of Self, returned and created by Driver::probe() is dropped in the bus' remove() callback. Request implementers of the Driver trait to implement Send, since the remove() callback is not guaranteed to run from the same thread as probe(). Fixes: 1bd8b6b2c5d3 ("rust: pci: add basic PCI devi...
```diff diff --git a/rust/kernel/pci.rs b/rust/kernel/pci.rs index 0d09ae34a64d..22a32172b108 100644 --- a/rust/kernel/pci.rs +++ b/rust/kernel/pci.rs @@ -222,7 +222,7 @@ macro_rules! pci_device_table { ///``` /// Drivers must implement this trait in order to get a PCI driver registered. Please refer to the /// `Ada...
90a7138619a0c55e2aefaad27b12ffc2ddbeed78
Analyze and fix the following issue in the Linux kernel code: net/neighbor: add missing policy for NDTPA_QUEUE_LENBYTES
Problem Details: Previous commit 8b5c171bb3dc ("neigh: new unresolved queue limits") introduces new netlink attribute NDTPA_QUEUE_LENBYTES to represent approximative value for deprecated QUEUE_LEN. However, it forgot to add the associated nla_policy in nl_ntbl_parm_policy array. Fix it with one simple NLA_U32 type poli...
```diff diff --git a/net/core/neighbour.c b/net/core/neighbour.c index bd0251bd74a1..1a620f903c56 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -2250,6 +2250,7 @@ static const struct nla_policy nl_neightbl_policy[NDTA_MAX+1] = { static const struct nla_policy nl_ntbl_parm_policy[NDTPA_MAX+1] = { [N...
23b763302ce068d7c97441e75434dc9f903adc7d
Analyze and fix the following issue in the Linux kernel code: tools headers: Sync uapi/asm-generic/socket.h with the kernel sources
Problem Details: This also fixes a wrong definitions for SCM_TS_OPT_ID & SO_RCVPRIORITY. Accidentally found while working on another patchset. Cc: linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org Cc: Eric Dumazet <edumazet@google.com> Cc: Jakub Kicinski <kuba@kernel.org> Cc: Vadim Fedorenko <vadim.fedorenko@li...
```diff diff --git a/tools/include/uapi/asm-generic/socket.h b/tools/include/uapi/asm-generic/socket.h index ffff554a5230..aa5016ff3d91 100644 --- a/tools/include/uapi/asm-generic/socket.h +++ b/tools/include/uapi/asm-generic/socket.h @@ -119,14 +119,31 @@ #define SO_DETACH_REUSEPORT_BPF 68 +#define SO_PREFER_BUSY...
2c1f97a52cb827a5f2768e67a9dddffae1ed47ab
Analyze and fix the following issue in the Linux kernel code: mptcp: Fix data stream corruption in the address announcement
Problem Details: Because of the size restriction in the TCP options space, the MPTCP ADD_ADDR option is exclusive and cannot be sent with other MPTCP ones. For this reason, in the linked mptcp_out_options structure, group of fields linked to different options are part of the same union. There is a case where the mptcp...
```diff diff --git a/net/mptcp/options.c b/net/mptcp/options.c index fd2de185bc93..23949ae2a3a8 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -651,6 +651,7 @@ static bool mptcp_established_options_add_addr(struct sock *sk, struct sk_buff * struct mptcp_sock *msk = mptcp_sk(subflow->conn); bool drop_...
cfb320d990919836b49bd090c6c232c6c4d90b41
Analyze and fix the following issue in the Linux kernel code: staging: vchiq_arm: Stop kthreads if vchiq cdev register fails
Problem Details: In case the vchiq character device cannot be registered during probe, all kthreads needs to be stopped to avoid resource leaks. Fixes: 863a756aaf49 ("staging: vc04_services: vchiq_core: Stop kthreads on vchiq module unload") Signed-off-by: Stefan Wahren <wahrenst@gmx.net> Link: https://lore.kernel.org...
```diff diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 910b8fd34cb1..6434cbdc1a6e 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm...
3db89bc6d973e2bcaa852f6409c98c228f39a926
Analyze and fix the following issue in the Linux kernel code: staging: vchiq_arm: Fix possible NPR of keep-alive thread
Problem Details: In case vchiq_platform_conn_state_changed() is never called or fails before driver removal, ka_thread won't be a valid pointer to a task_struct. So do the necessary checks before calling kthread_stop to avoid a crash. Fixes: 863a756aaf49 ("staging: vc04_services: vchiq_core: Stop kthreads on vchiq mod...
```diff diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 31bdb15fd751..910b8fd34cb1 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm...
63f4dbb196db60a8536ba3d1b835d597a83f6cbb
Analyze and fix the following issue in the Linux kernel code: staging: vchiq_arm: Register debugfs after cdev
Problem Details: The commit 2a4d15a4ae98 ("staging: vchiq: Refactor vchiq cdev code") moved the debugfs directory creation before vchiq character device registration. In case the latter fails, the debugfs directory won't be cleaned up. Fixes: 2a4d15a4ae98 ("staging: vchiq: Refactor vchiq cdev code") Signed-off-by: Ste...
```diff diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 2db219e4786f..31bdb15fd751 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm...
b2a9a6a26b7e954297e51822e396572026480bad
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: select CONFIG_CRYPTO_LIB_AES
Problem Details: This fixes the following issue: ERROR: modpost: "aes_expandkey" [drivers/staging/rtl8723bs/r8723bs.ko] undefined! ERROR: modpost: "aes_encrypt" [drivers/staging/rtl8723bs/r8723bs.ko] undefined! Fixes: 7d40753d8820 ("staging: rtl8723bs: use in-kernel aes encryption in OMAC1 routines") Fixes: 3d3a170f6d...
```diff diff --git a/drivers/staging/rtl8723bs/Kconfig b/drivers/staging/rtl8723bs/Kconfig index 8d48c61961a6..353e6ee2c145 100644 --- a/drivers/staging/rtl8723bs/Kconfig +++ b/drivers/staging/rtl8723bs/Kconfig @@ -4,6 +4,7 @@ config RTL8723BS depends on WLAN && MMC && CFG80211 depends on m select CRYPTO + select...
ed3751860e6ca5f4f3bb8db3006e607460b047cd
Analyze and fix the following issue in the Linux kernel code: staging: gpib: change return type of t1_delay function to report errors
Problem Details: The current code returns "unsigned int" and it doesn't handle errors correctly if it happens during ioctl call for t1 delay configuration. The ni_usb_t1_delay(), from NI, is the only function returning -1 at this point. The caller, t1_delay_ioctl(), doesn't check for errors and sets board->t1_nano_sec...
```diff diff --git a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c index 15a9c4ab77ba..445b9380ff98 100644 --- a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c +++ b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c @@ -455,8 +455,7 @@ static int ag...
31e75ed964582257f59156ce6a42860e1ae4cc39
Analyze and fix the following issue in the Linux kernel code: mmc: host: Wait for Vdd to settle on card power off
Problem Details: The SD spec version 6.0 section 6.4.1.5 requires that Vdd must be lowered to less than 0.5V for a minimum of 1 ms when powering off a card. Increase wait to 15 ms so that voltage has time to drain down to 0.5V and cards can power off correctly. Issues with voltage drain time were only observed on Apoll...
```diff diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c index 1f0bd723f011..13a84b9309e0 100644 --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c @@ -610,8 +610,12 @@ static void sdhci_intel_set_power(struct sdhci_host *host, unsigned char mode, sdhci...
f17cd486391cc24dcc3d4d63699721c6a7937b84
Analyze and fix the following issue in the Linux kernel code: staging: gpib: fix kernel-doc section for usb_gpib_line_status() function
Problem Details: The function name field in the kernel-doc section for the usb_gpib_line_status() is defined as 'line_status'. In addition, after the kernel-doc section, there are three macro definition instead of the function definition. These issues trigger the warning: warning: expecting prototype for line_status(...
```diff diff --git a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c index 37d97cd01822..041600dc443f 100644 --- a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +++ b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c @@ -78,6 +78,10 @@ module_param(debug, in...
4ec9b9b584c9b3e3515d4174aa815589e70e65aa
Analyze and fix the following issue in the Linux kernel code: staging: gpib: fix kernel-doc section for function usb_gpib_interface_clear()
Problem Details: Add '@' character in kernel-doc comment in order 'assert' to be picked as argument by the kernel-doc compiler. This change fix the following warning: warning: Function parameter or struct member 'assert' not described in 'usb_gpib_interface_clear' Signed-off-by: Gaston Gonzalez <gascoar@gmail.com> L...
```diff diff --git a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c index 7f3da11291f6..37d97cd01822 100644 --- a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +++ b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c @@ -621,7 +621,7 @@ static int usb_gpib_g...
4f991a6430f7634d7e5c6cfa089160c6337f3bc2
Analyze and fix the following issue in the Linux kernel code: staging: gpib: fix kernel-doc section for write_loop() function
Problem Details: Add a colon character in the kernel-doc section of write_loop() in order 'leng' to be picked as argument by the kernel-doc compiler. This change fix the following warning: warning: Function parameter or struct member 'leng' not described in 'send_command' Signed-off-by: Gaston Gonzalez <gascoar@gmai...
```diff diff --git a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c index 1675aa2aff6c..7f3da11291f6 100644 --- a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +++ b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c @@ -232,7 +232,7 @@ static int write_loop...
8491e73a5223acb0a4b4d78c3f8b96aa9c5e774d
Analyze and fix the following issue in the Linux kernel code: staging: gpib: Fix Oops after disconnect in agilent usb
Problem Details: If the agilent usb dongle is disconnected subsequent calls to the driver cause a NULL dereference Oops as the bus_interface is set to NULL on disconnect. This problem was introduced by setting usb_dev from the bus_interface for dev_xxx messages. Previously bus_interface was checked for NULL only in t...
```diff diff --git a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c index 7ebebe00dc48..e0d36f0dff25 100644 --- a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c +++ b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c @@ -427,7 +427,7 @@ static int ag...
a239c6e91b665f1837cf57b97fe638ef1baf2e78
Analyze and fix the following issue in the Linux kernel code: staging: gpib: Fix Oops after disconnect in ni_usb
Problem Details: If the usb dongle is disconnected subsequent calls to the driver cause a NULL dereference Oops as the bus_interface is set to NULL on disconnect. This problem was introduced by setting usb_dev from the bus_interface for dev_xxx messages. Previously bus_interface was checked for NULL only in the the f...
```diff diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c index 61b15b19e134..62fbc78204ce 100644 --- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c +++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c @@ -591,7 +591,7 @@ static int ni_usb_read(gpib_board_t *board, uint8_t *buff...
6ea39cc388899a121b5b19b6968692e9460ee4a3
Analyze and fix the following issue in the Linux kernel code: i2c: amd-mp2: drop free_irq() of devm_request_irq() allocated irq
Problem Details: irq allocated with devm_request_irq() will be freed in devm_irq_release(), using free_irq() in ->remove() will causes a dangling pointer, and a subsequent double free. So remove the free_irq() in the error path and remove path. Fixes: 969864efae78 ("i2c: amd-mp2: use msix/msi if the hardware supports"...
```diff diff --git a/drivers/i2c/busses/i2c-amd-mp2-pci.c b/drivers/i2c/busses/i2c-amd-mp2-pci.c index 143165300949..ef7370d3dbea 100644 --- a/drivers/i2c/busses/i2c-amd-mp2-pci.c +++ b/drivers/i2c/busses/i2c-amd-mp2-pci.c @@ -327,13 +327,11 @@ static int amd_mp2_pci_init(struct amd_mp2_dev *privdata, amd_mp2...
f70681e9e6066ab7b102e6b46a336a8ed67812ae
Analyze and fix the following issue in the Linux kernel code: libfs: Fix duplicate directory entry in offset_dir_lookup
Problem Details: There is an issue in the kernel: In tmpfs, when using the "ls" command to list the contents of a directory with a large number of files, glibc performs the getdents call in multiple rounds. If a concurrent unlink occurs between these getdents calls, it may lead to duplicate directory entries in the ls...
```diff diff --git a/fs/libfs.c b/fs/libfs.c index 8444f5cc4064..dc042a975a56 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -496,7 +496,7 @@ offset_dir_lookup(struct dentry *parent, loff_t offset) found = find_positive_dentry(parent, NULL, false); else { rcu_read_lock(); - child = mas_find(&mas, DIR_OFFSET_MAX);...
ad4488845193e81549c11903a5083b4c9cc19785
Analyze and fix the following issue in the Linux kernel code: spi: spi-mem: Introduce a default ->exec_op() debug log
Problem Details: Many spi-mem controller drivers have a very similar debug log at the beginning of their ->exec_op() callback implementation. This debug log is effectively useful, so let's create one that is complete and concise enough, so developers no longer need to write their own. The verbosity being high, VERBOSE_...
```diff diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c index e9beae95dded..62a11142bd63 100644 --- a/drivers/spi/spi-aspeed-smc.c +++ b/drivers/spi/spi-aspeed-smc.c @@ -303,13 +303,6 @@ static int do_aspeed_spi_exec_op(struct spi_mem *mem, const struct spi_mem_op *o u32 ctl_val; int ret = ...
ee3d1f09e04643b1b48bd894de1de3c600a01c05
Analyze and fix the following issue in the Linux kernel code: ALSA: oxygen: Fix dependency on CONFIG_PM_SLEEP
Problem Details: The conversion to EXPORT_SIMPLE_DEV_PM_OPS() also replaced the pm ops assignment with pm_ptr() macro, but this made difference from the original code; it had conditional with ifdef CONFIG_PM_SLEEP, while we have now with CONFIG_PM, instead. This seems causing build errors with randomconfig. For fixi...
```diff diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c index 6d0deea47ee6..ff7439634d76 100644 --- a/sound/pci/oxygen/oxygen.c +++ b/sound/pci/oxygen/oxygen.c @@ -855,7 +855,7 @@ static struct pci_driver oxygen_driver = { .id_table = oxygen_ids, .probe = generic_oxygen_probe, .driver = { - .p...
3ed61b8938c66680e13a1d1929afb9b145c26a86
Analyze and fix the following issue in the Linux kernel code: selftests: net: test for lwtunnel dst ref loops
Problem Details: As recently specified by commit 0ea09cbf8350 ("docs: netdev: add a note on selftest posting") in net-next, the selftest is therefore shipped in this series. However, this selftest does not really test this series. It needs this series to avoid crashing the kernel. What it really tests, thanks to kmemle...
```diff diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile index 5916f3b81c39..843ab747645d 100644 --- a/tools/testing/selftests/net/Makefile +++ b/tools/testing/selftests/net/Makefile @@ -101,6 +101,7 @@ TEST_PROGS += vlan_bridge_binding.sh TEST_PROGS += bpf_offload.py TEST_PROG...
3e7a60b368eadf6c30a4a79dea1eb8f88b6d620d
Analyze and fix the following issue in the Linux kernel code: net: ipv6: ioam6: fix lwtunnel_output() loop
Problem Details: Fix the lwtunnel_output() reentry loop in ioam6_iptunnel when the destination is the same after transformation. Note that a check on the destination address was already performed, but it was not enough. This is the example of a lwtunnel user taking care of loops without relying only on the last resort ...
```diff diff --git a/net/ipv6/ioam6_iptunnel.c b/net/ipv6/ioam6_iptunnel.c index 2c383c12a431..09065187378e 100644 --- a/net/ipv6/ioam6_iptunnel.c +++ b/net/ipv6/ioam6_iptunnel.c @@ -337,7 +337,6 @@ static int ioam6_do_encap(struct net *net, struct sk_buff *skb, static int ioam6_output(struct net *net, struct sock *sk...
986ffb3a57c5650fb8bf6d59a8f0f07046abfeb6
Analyze and fix the following issue in the Linux kernel code: net: lwtunnel: fix recursion loops
Problem Details: This patch acts as a parachute, catch all solution, by detecting recursion loops in lwtunnel users and taking care of them (e.g., a loop between routes, a loop within the same route, etc). In general, such loops are the consequence of pathological configurations. Each lwtunnel user is still free to cat...
```diff diff --git a/net/core/lwtunnel.c b/net/core/lwtunnel.c index 711cd3b4347a..4417a18b3e95 100644 --- a/net/core/lwtunnel.c +++ b/net/core/lwtunnel.c @@ -23,6 +23,8 @@ #include <net/ip6_fib.h> #include <net/rtnh.h> +#include "dev.h" + DEFINE_STATIC_KEY_FALSE(nf_hooks_lwtunnel_enabled); EXPORT_SYMBOL_GPL(nf_h...
47a9b5e52abd2b717dfc8b9460589f89936d93cf
Analyze and fix the following issue in the Linux kernel code: net: ti: icssg-prueth: Add lock to stats
Problem Details: Currently the API emac_update_hardware_stats() reads different ICSSG stats without any lock protection. This API gets called by .ndo_get_stats64() which is only under RCU protection and nothing else. Add lock to this API so that the reading of statistics happens during lock. Fixes: c1e10d5dc7a1 ("net...
```diff diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c index 00ed97860547..9a75733e3f8f 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c @@ -1679,6 +1679,7 @@ static int prueth_probe(struct platform_dev...
f3009d0d6ab78053117f8857b921a8237f4d17b3
Analyze and fix the following issue in the Linux kernel code: net: atm: fix use after free in lec_send()
Problem Details: The ->send() operation frees skb so save the length before calling ->send() to avoid a use after free. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/c751531d-4af4-42fe-affe-61...
```diff diff --git a/net/atm/lec.c b/net/atm/lec.c index ffef658862db..a948dd47c3f3 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c @@ -181,6 +181,7 @@ static void lec_send(struct atm_vcc *vcc, struct sk_buff *skb) { struct net_device *dev = skb->dev; + unsigned int len = skb->len; ATM_SKB(skb)->vcc = vcc; atm...
27b918007d96402aba10ed52a6af8015230f1793
Analyze and fix the following issue in the Linux kernel code: net: vlan: don't propagate flags on open
Problem Details: With the device instance lock, there is now a possibility of a deadlock: [ 1.211455] ============================================ [ 1.211571] WARNING: possible recursive locking detected [ 1.211687] 6.14.0-rc5-01215-g032756b4ca7a-dirty #5 Not tainted [ 1.211823] ---------------------------...
```diff diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 770a4dcf7f63..fbf296137b09 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -274,17 +274,6 @@ static int vlan_dev_open(struct net_device *dev) goto out; } - if (dev->flags & IFF_ALLMULTI) { - err = dev_set_allmulti(real_dev, ...
66eae21a0c1405fec50636b58fad5002d5fe4437
Analyze and fix the following issue in the Linux kernel code: arm64: dts: Add gpio_intc node for Amlogic A4 SoCs
Problem Details: Add GPIO interrupt controller device. Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com> Link: https://lore.kernel.org/r/20250311-irqchip-gpio-a4-a5-v5-3-ca4cc276c18c@amlogic.com [narmstrong: fix commit to apply without pinctrl node] Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
```diff diff --git a/arch/arm64/boot/dts/amlogic/amlogic-a4.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-a4.dtsi index de10e7aebf21..a06838552f21 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-a4.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-a4.dtsi @@ -48,3 +48,24 @@ }; }; }; + +&apb { + gpio_intc: interrupt-co...
113ec87b0f26a17b02c58aa2714a9b8f1020eed9
Analyze and fix the following issue in the Linux kernel code: pinctrl: npcm8xx: Fix incorrect struct npcm8xx_pincfg assignment
Problem Details: Sparse is not happy about implementation of the NPCM8XX_PINCFG() pinctrl-npcm8xx.c:1314:9: warning: obsolete array initializer, use C99 syntax pinctrl-npcm8xx.c:1315:9: warning: obsolete array initializer, use C99 syntax ... pinctrl-npcm8xx.c:1412:9: warning: obsolete array initializer, use C99 sy...
```diff diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c index 70e6966049e4..309f66dde309 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c @@ -1290,12 +1290,14 @@ static struct npcm8xx_func npcm8xx_funcs[] = { }; ...
5a062c3c3b82004766bc3ece82b594d337076152
Analyze and fix the following issue in the Linux kernel code: pinctrl: tegra: Fix off by one in tegra_pinctrl_get_group()
Problem Details: This should be >= pmx->soc->ngroups instead of > to avoid an out of bounds access. The pmx->soc->groups[] array is allocated in tegra_pinctrl_probe(). Fixes: c12bfa0fee65 ("pinctrl-tegra: Restore SFSEL bit when freeing pins") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Kunwu ...
```diff diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c b/drivers/pinctrl/tegra/pinctrl-tegra.c index 0246acba7703..11ecbd6a9b2a 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra.c @@ -306,7 +306,7 @@ static const struct tegra_pingroup *tegra_pinctrl_get_group(struct pinctr...
93ae6e68b6d6b62d92b3a89d1c253d4a1721a1d3
Analyze and fix the following issue in the Linux kernel code: iommu/vt-d: Fix possible circular locking dependency
Problem Details: We have recently seen report of lockdep circular lock dependency warnings on platforms like Skylake and Kabylake: ====================================================== WARNING: possible circular locking dependency detected 6.14.0-rc6-CI_DRM_16276-gca2c04fe76e8+ #1 Not tainted --------------------...
```diff diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index 072223fe6fe7..4eafc0518fa7 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -3049,6 +3049,7 @@ static int __init probe_acpi_namespace_devices(void) if (dev->bus != &acpi_bus_type) continue; + u...
688124cc541f60d26a7547f45637b23dada4e527
Analyze and fix the following issue in the Linux kernel code: iommu/vt-d: Don't clobber posted vCPU IRTE when host IRQ affinity changes
Problem Details: Don't overwrite an IRTE that is posting IRQs to a vCPU with a posted MSI entry if the host IRQ affinity happens to change. If/when the IRTE is reverted back to "host mode", it will be reconfigured as a posted MSI or remapped entry as appropriate. Drop the "mode" field, which doesn't differentiate bet...
```diff diff --git a/drivers/iommu/intel/irq_remapping.c b/drivers/iommu/intel/irq_remapping.c index c495b533103f..ea3ca5203919 100644 --- a/drivers/iommu/intel/irq_remapping.c +++ b/drivers/iommu/intel/irq_remapping.c @@ -25,11 +25,6 @@ #include "../irq_remapping.h" #include "../iommu-pages.h" -enum irq_mode { - I...
2454823e97a63d85a6b215905f71e5a06324eab7
Analyze and fix the following issue in the Linux kernel code: iommu/vt-d: Put IRTE back into posted MSI mode if vCPU posting is disabled
Problem Details: Add a helper to take care of reconfiguring an IRTE to deliver IRQs to the host, i.e. not to a vCPU, and use the helper when an IRTE's vCPU affinity is nullified, i.e. when KVM puts an IRTE back into "host" mode. Because posted MSIs use an ephemeral IRTE, using modify_irte() puts the IRTE into full rem...
```diff diff --git a/drivers/iommu/intel/irq_remapping.c b/drivers/iommu/intel/irq_remapping.c index ad795c772f21..c495b533103f 100644 --- a/drivers/iommu/intel/irq_remapping.c +++ b/drivers/iommu/intel/irq_remapping.c @@ -1169,7 +1169,17 @@ static void intel_ir_reconfigure_irte_posted(struct irq_data *irqd) static in...
b8741496c058c6d65d09799081158d1593554638
Analyze and fix the following issue in the Linux kernel code: iommu: apple-dart: fix potential null pointer deref
Problem Details: If kzalloc() fails, accessing cfg->supports_bypass causes a null pointer dereference. Fix by checking for NULL immediately after allocation and returning -ENOMEM. Fixes: 3bc0102835f6 ("iommu: apple-dart: Allow mismatched bypass support") Signed-off-by: Qasim Ijaz <qasdev00@gmail.com> Reviewed-by: Aly...
```diff diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index 13ccb801f52a..e13501541fdd 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -797,12 +797,11 @@ static int apple_dart_of_xlate(struct device *dev, if (!cfg) { cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); - + ...
f90aa59eb2999e4c33049f7e5679a6424da5c6b9
Analyze and fix the following issue in the Linux kernel code: iommu/rockchip: Register in a sensible order
Problem Details: Currently Rockchip calls iommu_device_register() before it's finished setting up the hardware and driver state, and as such it now gets unhappy in various ways when registration starts working the way it was always intended to, and probing client devices straight away. Reorder the operations to ensure ...
```diff diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 48826d1ccfd8..9d2120a9232a 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -1256,14 +1256,6 @@ static int rk_iommu_probe(struct platform_device *pdev) if (err) return err; - err = iommu_...
f48dcda8f6a48d4592cc74f944d65d6a09f17895
Analyze and fix the following issue in the Linux kernel code: iommu/rockchip: Allocate per-device data sensibly
Problem Details: Now that DT-based probing is finally happening in the right order again, it reveals an issue in Rockchip's of_xlate, which can now be called during registration, but is using the global dma_dev which is only assigned later. However, this makes little sense when we're already looking up the correct IOMM...
```diff diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 323cc665c357..48826d1ccfd8 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -1148,12 +1148,12 @@ static int rk_iommu_of_xlate(struct device *dev, struct platform_device *iommu_dev; struct rk...
8dcfc910a81d8b53f59f8b23211e81f2a91f84f9
Analyze and fix the following issue in the Linux kernel code: ptp: ocp: reject unsupported periodic output flags
Problem Details: The ptp_ocp_signal_from_perout() function supports PTP_PEROUT_DUTY_CYCLE and PTP_PEROUT_PHASE. It does not support PTP_PEROUT_ONE_SHOT, but does not reject a request with such an unsupported flag. Add the appropriate check to ensure that unsupported requests are rejected both for PTP_PEROUT_ONE_SHOT a...
```diff diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c index 34c616bd0a02..b25635c5c745 100644 --- a/drivers/ptp/ptp_ocp.c +++ b/drivers/ptp/ptp_ocp.c @@ -2090,6 +2090,10 @@ ptp_ocp_signal_from_perout(struct ptp_ocp *bp, int gen, { struct ptp_ocp_signal s = { }; + if (req->flags & ~(PTP_PEROUT_DUTY_CYC...
af2b428f7992c07b0767c9a3c341b54d9069542e
Analyze and fix the following issue in the Linux kernel code: broadcom: fix supported flag check in periodic output function
Problem Details: In bcm_ptp_perout_locked, the driver rejects requests which have PTP_PEROUT_PHASE set. This appears to be an attempt to reject any unsupported flags. Unfortunately, this only checks one flag, but does not protect against PTP_PEROUT_ONE_SHOT, or any future flags which may be added. Fix the check to ens...
```diff diff --git a/drivers/net/phy/bcm-phy-ptp.c b/drivers/net/phy/bcm-phy-ptp.c index 208e8f561e06..eba8b5fb1365 100644 --- a/drivers/net/phy/bcm-phy-ptp.c +++ b/drivers/net/phy/bcm-phy-ptp.c @@ -597,7 +597,8 @@ static int bcm_ptp_perout_locked(struct bcm_ptp_private *priv, period = BCM_MAX_PERIOD_8NS; /* write ...
c0b4ddd30871c59043ed3592e6abeee55c3bf045
Analyze and fix the following issue in the Linux kernel code: net: lan743x: reject unsupported external timestamp requests
Problem Details: The lan743x_ptp_io_event_cap_en() function checks that the given request sets only one of PTP_RISING_EDGE or PTP_FALLING_EDGE, but not both. However, this driver does not check whether other flags (such as PTP_EXT_OFF) are set, nor whether any future unrecognized flags are set. Fix this by adding the...
```diff diff --git a/drivers/net/ethernet/microchip/lan743x_ptp.c b/drivers/net/ethernet/microchip/lan743x_ptp.c index 4a777b449ecd..0be44dcb3393 100644 --- a/drivers/net/ethernet/microchip/lan743x_ptp.c +++ b/drivers/net/ethernet/microchip/lan743x_ptp.c @@ -942,6 +942,12 @@ static int lan743x_ptp_io_extts(struct lan74...
51d58c0c7921d3c93c44099b90dc46720d095bde
Analyze and fix the following issue in the Linux kernel code: renesas: reject PTP_STRICT_FLAGS as unsupported
Problem Details: The ravb_ptp_extts() function checks the flags coming from the PTP_EXTTS_REQUEST ioctl, to ensure that future flags are not accepted on accident. This was updated to 'honor' the PTP_STRICT_FLAGS in commit 6138e687c7b6 ("ptp: Introduce strict checking of external time stamp options."). However, the dri...
```diff diff --git a/drivers/net/ethernet/renesas/ravb_ptp.c b/drivers/net/ethernet/renesas/ravb_ptp.c index 6e4ef7af27bf..b4365906669f 100644 --- a/drivers/net/ethernet/renesas/ravb_ptp.c +++ b/drivers/net/ethernet/renesas/ravb_ptp.c @@ -179,8 +179,7 @@ static int ravb_ptp_extts(struct ptp_clock_info *ptp, /* Reject...
5eada2aabf13dcc4574b0a281b963b8cc55a52cc
Analyze and fix the following issue in the Linux kernel code: igb: reject invalid external timestamp requests for 82580-based HW
Problem Details: The igb_ptp_feature_enable_82580 function correctly checks that unknown flags are not passed to the function. However, it does not actually check PTP_RISING_EDGE or PTP_FALLING_EDGE when configuring the external timestamp function. The data sheet for the 82580 product says: Upon a change in the inp...
```diff diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c index f94570556120..f323e1c1989f 100644 --- a/drivers/net/ethernet/intel/igb/igb_ptp.c +++ b/drivers/net/ethernet/intel/igb/igb_ptp.c @@ -509,6 +509,12 @@ static int igb_ptp_feature_enable_82580(struct ptp_clock_inf...
1a0df6c96ce52b3c9fa01b312be3f5ac5162c48b
Analyze and fix the following issue in the Linux kernel code: net: phy: marvell: Align set_loopback() implementation
Problem Details: Use genphy_loopback() to disable loopback like ksz9031_set_loopback(). This way disable loopback is implemented only once within genphy_loopback() and the set_loopback() implementations look similar. Also fix comment about msleep() in the out-of loopback case which is not executed in the out-of loopba...
```diff diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index f2ad675537d1..623292948fa7 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -2133,56 +2133,50 @@ static void marvell_get_stats_simple(struct phy_device *phydev, static int m88e1510_loopback(struct phy_device *ph...
f5b07010c13c77541e8ade167d05bef3b8a63739
Analyze and fix the following issue in the Linux kernel code: libperf: Don't remove -g when EXTRA_CFLAGS are used
Problem Details: When using EXTRA_CFLAGS, for example "EXTRA_CFLAGS=-DREFCNT_CHECKING=1", this construct stops setting -g which you'd expect would not be affected by adding extra flags. Additionally, EXTRA_CFLAGS should be the last thing to be appended so that it can be used to undo any defaults. And no condition is re...
```diff diff --git a/tools/lib/perf/Makefile b/tools/lib/perf/Makefile index 3a9b2140aa04..478fe57bf8ce 100644 --- a/tools/lib/perf/Makefile +++ b/tools/lib/perf/Makefile @@ -54,13 +54,6 @@ endif TEST_ARGS := $(if $(V),-v) -# Set compile option CFLAGS -ifdef EXTRA_CFLAGS - CFLAGS := $(EXTRA_CFLAGS) -else - CFLAG...
431db90a7303cb394c5a881b4479946f64052727
Analyze and fix the following issue in the Linux kernel code: perf pmu: Handle memory failure in tool_pmu__new()
Problem Details: On linux-next commit 72c6f57a4193 ("perf pmu: Dynamically allocate tool PMU") allocated PMU named "tool" dynamicly. However that allocation can fail and a NULL pointer is returned. That case is currently not handled and would result in an invalid address reference. Add a check for NULL pointer. Fixes:...
```diff diff --git a/tools/perf/util/pmus.c b/tools/perf/util/pmus.c index 9b5a63ecb249..b99292de7669 100644 --- a/tools/perf/util/pmus.c +++ b/tools/perf/util/pmus.c @@ -265,7 +265,8 @@ skip_pe_pmus: if ((to_read_types & PERF_TOOL_PMU_TYPE_TOOL_MASK) != 0 && (read_pmu_types & PERF_TOOL_PMU_TYPE_TOOL_MASK) == 0...
6d2dcd635204c023eb5328ad7d38b198a5558c9b
Analyze and fix the following issue in the Linux kernel code: perf: intel-tpebs: Fix incorrect usage of zfree()
Problem Details: zfree() requires an address otherwise it frees what's in name, rather than name itself. Pass the address of name to fix it. This was the only incorrect occurrence in Perf found using a search. Fixes: 8db5cabcf1b6 ("perf stat: Fork and launch 'perf record' when 'perf stat' needs to get retire latency ...
```diff diff --git a/tools/perf/util/intel-tpebs.c b/tools/perf/util/intel-tpebs.c index 50a3c3e07160..2c421b475b3b 100644 --- a/tools/perf/util/intel-tpebs.c +++ b/tools/perf/util/intel-tpebs.c @@ -254,7 +254,7 @@ int tpebs_start(struct evlist *evsel_list) new = zalloc(sizeof(*new)); if (!new) { ret = -1; - ...
58b8b5d142a8bd5cee3f5181b9d9088051a53a04
Analyze and fix the following issue in the Linux kernel code: perf cpumap: Increment reference count for online cpumap
Problem Details: Thomas Richter <tmricht@linux.ibm.com> reported a double put on the cpumap for the placeholder core PMU: https://lore.kernel.org/lkml/20250318095132.1502654-3-tmricht@linux.ibm.com/ Requiring the caller to get the cpumap is not how these things are usually done, switch cpu_map__online to do the get and...
```diff diff --git a/tools/perf/arch/arm/util/pmu.c b/tools/perf/arch/arm/util/pmu.c index 57dc94a6e38c..f70075c89aa0 100644 --- a/tools/perf/arch/arm/util/pmu.c +++ b/tools/perf/arch/arm/util/pmu.c @@ -18,7 +18,7 @@ void perf_pmu__arch_init(struct perf_pmu *pmu) { - struct perf_cpu_map *intersect; + struct perf_cp...
ebf0b332732dcc64239119e554faa946562b0b93
Analyze and fix the following issue in the Linux kernel code: perf dso: fix dso__is_kallsyms() check
Problem Details: Kernel modules for which we cannot find a file on-disk will have a dso->long_name that looks like "[module_name]". Prior to the commit listed in the fixes, the dso->kernel field would be zero (for user space), so dso__is_kallsyms() would return false. After the commit, kernel module DSOs are correctly ...
```diff diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h index 846b74510038..30f7f58e2a9c 100644 --- a/tools/perf/util/dso.h +++ b/tools/perf/util/dso.h @@ -812,7 +812,9 @@ static inline bool dso__is_kcore(const struct dso *dso) static inline bool dso__is_kallsyms(const struct dso *dso) { - return RC_CHK_...
559847f56769037e5b2e0474d3dbff985b98083d
Analyze and fix the following issue in the Linux kernel code: xsk: fix an integer overflow in xp_create_and_assign_umem()
Problem Details: Since the i and pool->chunk_size variables are of type 'u32', their product can wrap around and then be cast to 'u64'. This can lead to two different XDP buffers pointing to the same memory area. Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 94033cd8e7...
```diff diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c index 1f7975b49657..d158cb6dd391 100644 --- a/net/xdp/xsk_buff_pool.c +++ b/net/xdp/xsk_buff_pool.c @@ -105,7 +105,7 @@ struct xsk_buff_pool *xp_create_and_assign_umem(struct xdp_sock *xs, if (pool->unaligned) pool->free_heads[i] = xskb; e...
b52173065e0aad82a31863bb5f63ebe46f7eb657
Analyze and fix the following issue in the Linux kernel code: sched/debug: Remove CONFIG_SCHED_DEBUG
Problem Details: For more than a decade, CONFIG_SCHED_DEBUG=y has been enabled in all the major Linux distributions: /boot/config-6.11.0-19-generic:CONFIG_SCHED_DEBUG=y The reason is that while originally CONFIG_SCHED_DEBUG started out as a debugging feature, over the years (decades ...) it has grown various bits ...
```diff diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 1af972a92d06..a2ab693d008d 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1301,15 +1301,6 @@ endmenu # "Debug lockups and hangs" menu "Scheduler Debugging" -config SCHED_DEBUG - bool "Collect scheduler debugging info" - depends on DEBUG_K...
14d281db78b2e5af1bdce793910ce1ea74520d05
Analyze and fix the following issue in the Linux kernel code: sched/debug: Remove CONFIG_SCHED_DEBUG from self-test config files
Problem Details: We leave most of the defconfigs alone (there's over 70 of them), but let's remove CONFIG_SCHED_DEBUG from the scheduler self-test Kconfig files. Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Vincent Guittot <vincent.g...
```diff diff --git a/tools/testing/selftests/sched/config b/tools/testing/selftests/sched/config index e8b09aa7c0c4..1bb8bf6d7fd4 100644 --- a/tools/testing/selftests/sched/config +++ b/tools/testing/selftests/sched/config @@ -1 +1 @@ -CONFIG_SCHED_DEBUG=y +# empty diff --git a/tools/testing/selftests/sched_ext/config ...
1b68a6aba00efbee9804c11d85019646b2e2646f
Analyze and fix the following issue in the Linux kernel code: sched/debug, Documentation: Remove (most) CONFIG_SCHED_DEBUG references from documentation
Problem Details: Since it's enabled unconditionally now, remove all references to it. (Left out languages I cannot read.) Signed-off-by: Ingo Molnar <mingo@kernel.org> Tested-by: Shrikanth Hegde <sshegde@linux.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Vincent Guitto...
```diff diff --git a/Documentation/scheduler/sched-debug.rst b/Documentation/scheduler/sched-debug.rst index 4d3d24f2a439..b5a92a39eccd 100644 --- a/Documentation/scheduler/sched-debug.rst +++ b/Documentation/scheduler/sched-debug.rst @@ -2,7 +2,7 @@ Scheduler debugfs ================= -Booting a kernel with CONFIG...
dd5bdaf2b72da81d57f4f99e518af80002b6562e
Analyze and fix the following issue in the Linux kernel code: sched/debug: Make CONFIG_SCHED_DEBUG functionality unconditional
Problem Details: All the big Linux distros enable CONFIG_SCHED_DEBUG, because the various features it provides help not just with kernel development, but with system administration and user-space software development as well. Reflect this reality and enable this functionality unconditionally. Signed-off-by: Ingo Moln...
```diff diff --git a/fs/proc/base.c b/fs/proc/base.c index cd89e956c322..61526420d0ee 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1489,7 +1489,6 @@ static const struct file_operations proc_fail_nth_operations = { #endif -#ifdef CONFIG_SCHED_DEBUG /* * Print out various scheduling related per-task field...
57903f72f270a3deb9de408ac61001a3fd94bf2f
Analyze and fix the following issue in the Linux kernel code: sched/debug: Make 'const_debug' tunables unconditional __read_mostly
Problem Details: With CONFIG_SCHED_DEBUG becoming unconditional, remove the extra 'const_debug' indirection towards __read_mostly. Signed-off-by: Ingo Molnar <mingo@kernel.org> Tested-by: Shrikanth Hegde <sshegde@linux.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Vincen...
```diff diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 6f666b4f56b8..3589abc2f707 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -128,7 +128,7 @@ DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); */ #define SCHED_FEAT(name, enabled) \ (1UL << __SCHED_FEAT_##name) * enabled | -const_...
f7d2728cc032a23fccb5ecde69793a38eb30ba5c
Analyze and fix the following issue in the Linux kernel code: sched/debug: Change SCHED_WARN_ON() to WARN_ON_ONCE()
Problem Details: The scheduler has this special SCHED_WARN() facility that depends on CONFIG_SCHED_DEBUG. Since CONFIG_SCHED_DEBUG is getting removed, convert SCHED_WARN() to WARN_ON_ONCE(). Note that the warning output isn't 100% equivalent: #define SCHED_WARN_ON(x) WARN_ONCE(x, #x) Because SCHED_WARN_ON()...
```diff diff --git a/kernel/sched/core.c b/kernel/sched/core.c index affa99f56f65..6f666b4f56b8 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -801,7 +801,7 @@ void update_rq_clock(struct rq *rq) #ifdef CONFIG_SCHED_DEBUG if (sched_feat(WARN_DOUBLE_CLOCK)) - SCHED_WARN_ON(rq->clock_update_flags & R...
03c90afb21b45edb87533fa6f11c5f914d26298b
Analyze and fix the following issue in the Linux kernel code: block/blk-iocost: ensure 'ret' is set on error
Problem Details: In case blkg_conf_open_bdev_frozen() fails, ioc_qos_write() jumps to the error path without assigning a value to 'ret'. Ensure that it inherits the error from the passed back error value. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202503200454.QWpwKeJu...
```diff diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 3724b0308cd8..f798f2c9ca35 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -3229,8 +3229,10 @@ static ssize_t ioc_qos_write(struct kernfs_open_file *of, char *input, blkg_conf_init(&ctx, input); memflags = blkg_conf_open_bdev_frozen(&c...
d047e32b8d1b29d178074b5f4312372e991d5da2
Analyze and fix the following issue in the Linux kernel code: rseq/selftests: Fix namespace collision with rseq UAPI header
Problem Details: When the rseq UAPI header is included, 'union rseq' clashes with 'struct rseq'. It's not the case in the rseq selftests but it does break the KVM selftests that also include this file. Rename 'union rseq' to 'union rseq_tls' to fix this. Fixes: e6644c967d3c ("rseq/selftests: Ensure the rseq ABI TLS i...
```diff diff --git a/tools/testing/selftests/rseq/rseq.c b/tools/testing/selftests/rseq/rseq.c index 6d8997d815ef..663a9cef1952 100644 --- a/tools/testing/selftests/rseq/rseq.c +++ b/tools/testing/selftests/rseq/rseq.c @@ -75,13 +75,13 @@ static int rseq_ownership; * Use a union to ensure we allocate a TLS area of 10...
ab6893402aeeaea8500d6bc86efccc2143c14df1
Analyze and fix the following issue in the Linux kernel code: drm/amd/pm: Add debug bit for smu pool allocation
Problem Details: In certain cases, it's desirable to avoid PMFW log transactions to system memory. Add a mask bit to decide whether to allocate smu pool in device memory or system memory. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <a...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index f62456da0ba5..e3767555e441 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -139,6 +139,7 @@ enum AMDGPU_DEBUG_MASK { AMDGPU_DEBUG_ENABLE_RAS_ACA = BIT(4), ...
ca6575a32a37c1a3ebab904792bb415249481992
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/vcn: fix ref counting for ring based profile handling
Problem Details: We need to make sure the workload profile ref counts are balanced. This isn't currently the case because we can increment the count on submissions, but the decrement may be delayed as work comes in. Track when we enable the workload profile so the references are balanced. v2: switch to a mutex and a...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 173048c46fc3..44d3afad71d2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -4283,6 +4283,7 @@ int amdgpu_device_init(struct amdgpu_device *adev, ...
553673a3e1bc0abbb994d9884f772189c739e3a0
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/gfx: fix ref counting for ring based profile handling
Problem Details: We need to make sure the workload profile ref counts are balanced. This isn't currently the case because we can increment the count on submissions, but the decrement may be delayed as work comes in. Track when we enable the workload profile so the references are balanced. v2: switch to a mutex and a...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 35ace1368b9c..173048c46fc3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -4282,6 +4282,7 @@ int amdgpu_device_init(struct amdgpu_device *adev, ...
fed7efbb43628f51e16e1890be8c84d136b755bf
Analyze and fix the following issue in the Linux kernel code: drm/amdkfd: Fix bug in config_dequeue_wait_counts
Problem Details: For certain ASICs where dequeue_wait_count don't need to be initialized, pm_config_dequeue_wait_counts_v9 return without filling in the packet information. However, the calling function interprets this as a success and sends the uninitialized packet to firmware causing hang. Fix the above bug by not c...
```diff diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c index 3f574d82b5fc..271c567242ab 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c @@ -418,6 +418,10 @@ int pm_config_dequeue_wait_count...
0d9a95099dcb05b5f4719c830d15bf4fdcad0dc2
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: grab an additional reference on the gang fence v2
Problem Details: We keep the gang submission fence around in adev, make sure that it stays alive. v2: fix memory leak on retry Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index e63bcd5edab9..35ace1368b9c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -6913,18 +6913,26 @@ struct dma_fence *amdgpu_device_switch_gang(struc...
1794d7ab34d2221ac7eb921b171e75b856e10561
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7996: fix locking in mt7996_mac_sta_rc_work()
Problem Details: The 'continue' statements need to be under spinlock, since the spinlock needs to be held as a loop invariant. Fixes: 0762bdd30279 ("wifi: mt76: mt7996: rework mt7996_mac_sta_rc_work to support MLO") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c index a52b4e71b267..d89c06f47997 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c @@ -2334,7 +2334,6 @@ void mt7996_mac_sta_rc_work(str...
3d97da0ee6253d79add79254015623a2cdff9634
Analyze and fix the following issue in the Linux kernel code: net: macb: Add __nonstring annotations for unterminated strings
Problem Details: When a character array without a terminating NUL character has a static initializer, GCC 15's -Wunterminated-string-initialization will only warn if the array lacks the "nonstring" attribute[1]. Mark the arrays with __nonstring to correctly identify the char array as "not a C string" and thereby elimin...
```diff diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 2a3924f01bf4..c9a5c8beb2fa 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -1025,7 +1025,7 @@ struct gem_stats { * this register should contribute to. */ struct gem_sta...
c9cb135bc604ad6e457e06c19e0857c9cd0eef7f
Analyze and fix the following issue in the Linux kernel code: net: stmmac: dwc-qos-eth: use devm_kzalloc() for AXI data
Problem Details: Everywhere else in the driver uses devm_kzalloc() when allocating the AXI data, so there is no kfree() of this structure. However, dwc-qos-eth uses kzalloc(), which leads to this memory being leaked. Switch to use devm_kzalloc(). Fixes: d8256121a91a ("stmmac: adding new glue driver dwmac-dwc-qos-eth")...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c index bd4eb187f8c6..b5a7e05ab7a7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c @@ -46,7 +46,9 @@ sta...
cb83f4b965a66d85e9a03621ef3b22c044f4a033
Analyze and fix the following issue in the Linux kernel code: gpu: host1x: Do not assume that a NULL domain means no DMA IOMMU
Problem Details: Previously with tegra-smmu, even with CONFIG_IOMMU_DMA, the default domain could have been left as NULL. The NULL domain is specially recognized by host1x_iommu_attach() as meaning it is not the DMA domain and should be replaced with the special shared domain. This happened prior to the below commit b...
```diff diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index 46cae925b095..1f93e5e276c0 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c @@ -361,6 +361,10 @@ static bool host1x_wants_iommu(struct host1x *host1x) return true; } +/* + * Returns ERR_PTR on failure, NULL if the tr...
6dd132516f8e467f144f7871ff2708ce827417a1
Analyze and fix the following issue in the Linux kernel code: net: reorder dev_addr_sem lock
Problem Details: Lockdep complains about circular lock in 1 -> 2 -> 3 (see below). Change the lock ordering to be: - rtnl_lock - dev_addr_sem - netdev_ops (only for lower devices!) - team_lock (or other per-upper device lock) 1. rtnl_lock -> netdev_ops -> dev_addr_sem rtnl_setlink rtnl_lock do_setlink IFLA_ADD...
```diff diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 0db9fc0afe36..0c5b1f7f8f3a 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -4196,8 +4196,6 @@ int netif_set_mac_address(struct net_device *dev, struct sockaddr *sa, struct netlink_ext_ack *extack); int dev_...
8033d2aef51722fe74068b52553625ed91ea256c
Analyze and fix the following issue in the Linux kernel code: Revert "net: replace dev_addr_sem with netdev instance lock"
Problem Details: This reverts commit df43d8bf10316a7c3b1e47e3cc0057a54df4a5b8. Cc: Kohei Enju <enjuk@amazon.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Fixes: df43d8bf1031 ("net: replace dev_addr_sem with netdev instance lock") Signed-off-by: Stanislav Fomichev <sdf@fomichev.me> Link: https://patch.msgid.l...
```diff diff --git a/drivers/net/tap.c b/drivers/net/tap.c index 4382f5e323b0..d4ece538f1b2 100644 --- a/drivers/net/tap.c +++ b/drivers/net/tap.c @@ -1017,7 +1017,7 @@ static long tap_ioctl(struct file *file, unsigned int cmd, rtnl_unlock(); return -ENOLINK; } - ret = dev_set_mac_address(tap->dev, &sa, NUL...
756f88ff9c6ae3d059180813102610c39ea99c27
Analyze and fix the following issue in the Linux kernel code: tc-tests: Update tc police action tests for tc buffer size rounding fixes.
Problem Details: Before tc's recent change to fix rounding errors, several tests which specified a burst size of "1m" would translate back to being 1048574 bytes (2b less than 1Mb). sprint_size prints this as "1024Kb". With the tc fix, the burst size is instead correctly reported as 1048576 bytes (precisely 1Mb), whi...
```diff diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/police.json b/tools/testing/selftests/tc-testing/tc-tests/actions/police.json index dd8109768f8f..5596f4df0e9f 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/actions/police.json +++ b/tools/testing/selftests/tc-testing/tc-tests/actions/p...
9730763f4756e32520cb86778331465e8d063a8f
Analyze and fix the following issue in the Linux kernel code: block: correct locking order for protecting blk-wbt parameters
Problem Details: The commit '245618f8e45f ("block: protect wbt_lat_usec using q-> elevator_lock")' introduced q->elevator_lock to protect updates to blk-wbt parameters when writing to the sysfs attribute wbt_ lat_usec and the cgroup attribute io.cost.qos. However, both these attributes also acquire q->rq_qos_mutex, le...
```diff diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 2609f7294427..88ff27697380 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -815,6 +815,41 @@ int blkg_conf_open_bdev(struct blkg_conf_ctx *ctx) ctx->bdev = bdev; return 0; } +/* + * Similar to blkg_conf_open_bdev, but additionally freez...
89ed5fa3b5419f04452051fbcb6d3e5b801cdb1b
Analyze and fix the following issue in the Linux kernel code: block: release q->elevator_lock in ioc_qos_write
Problem Details: The ioc_qos_write method acquires q->elevator_lock to protect updates to blk-wbt parameters. Once these updates are complete, the lock should be released before returning from ioc_qos_write. However, in one code path, the release of q->elevator_lock was mistakenly omitted, potentially leading to a loc...
```diff diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 38e7bf3c3b4f..56e6fb51316d 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -3348,6 +3348,7 @@ static ssize_t ioc_qos_write(struct kernfs_open_file *of, char *input, wbt_enable_default(disk); blk_mq_unquiesce_queue(disk->queue); + mute...
acf10a8c0b3a36d5ff35f91585e9755ea0b62ac3
Analyze and fix the following issue in the Linux kernel code: selftests: drv-net: use defer in the ping test
Problem Details: Make sure the test cleans up after itself. The XDP off statements at the end of the test may not be reached. Fixes: 75cc19c8ff89 ("selftests: drv-net: add xdp cases for ping.py") Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link...
```diff diff --git a/tools/testing/selftests/drivers/net/ping.py b/tools/testing/selftests/drivers/net/ping.py index 93f4b411b378..fc69bfcc37c4 100755 --- a/tools/testing/selftests/drivers/net/ping.py +++ b/tools/testing/selftests/drivers/net/ping.py @@ -7,7 +7,7 @@ from lib.py import ksft_run, ksft_exit from lib.py i...
60ba5b3ed7278a5700c8d57c3f5486b6066f745c
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Add tests for rqspinlock
Problem Details: Introduce selftests that trigger AA, ABBA deadlocks, and test the edge case where the held locks table runs out of entries, since we then fallback to the timeout as the final line of defense. Also exercise verifier's AA detection where applicable. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.c...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/res_spin_lock.c b/tools/testing/selftests/bpf/prog_tests/res_spin_lock.c new file mode 100644 index 000000000000..115287ba441b --- /dev/null +++ b/tools/testing/selftests/bpf/prog_tests/res_spin_lock.c @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: GPL-2.0 +/* ...
97eb35f3ad42de1c932ef1f7e2f0044d4fca35f4
Analyze and fix the following issue in the Linux kernel code: bpf: Introduce rqspinlock kfuncs
Problem Details: Introduce four new kfuncs, bpf_res_spin_lock, and bpf_res_spin_unlock, and their irqsave/irqrestore variants, which wrap the rqspinlock APIs. bpf_res_spin_lock returns a conditional result, depending on whether the lock was acquired (NULL is returned when lock acquisition succeeds, non-NULL upon failur...
```diff diff --git a/include/asm-generic/rqspinlock.h b/include/asm-generic/rqspinlock.h index 23abd0b8d0f9..6d4244d643df 100644 --- a/include/asm-generic/rqspinlock.h +++ b/include/asm-generic/rqspinlock.h @@ -23,6 +23,13 @@ struct rqspinlock { }; }; +/* Even though this is same as struct rqspinlock, we need to e...
f2ac0e5d1c4dcc55d6510dcaefb8f45661a9a1fb
Analyze and fix the following issue in the Linux kernel code: bpf: Convert percpu_freelist.c to rqspinlock
Problem Details: Convert the percpu_freelist.c code to use rqspinlock, and remove the extralist fallback and trylock-based acquisitions to avoid deadlocks. Key thing to note is the retained while (true) loop to search through other CPUs when failing to push a node due to locking errors. This retains the behavior of th...
```diff diff --git a/kernel/bpf/percpu_freelist.c b/kernel/bpf/percpu_freelist.c index 034cf87b54e9..632762b57299 100644 --- a/kernel/bpf/percpu_freelist.c +++ b/kernel/bpf/percpu_freelist.c @@ -14,11 +14,9 @@ int pcpu_freelist_init(struct pcpu_freelist *s) for_each_possible_cpu(cpu) { struct pcpu_freelist_head *h...
ecbd8047526d3e9681043c287dea7bc67ef33eb4
Analyze and fix the following issue in the Linux kernel code: rqspinlock: Add basic support for CONFIG_PARAVIRT
Problem Details: We ripped out PV and virtualization related bits from rqspinlock in an earlier commit, however, a fair lock performs poorly within a virtual machine when the lock holder is preempted. As such, retain the virt_spin_lock fallback to test and set lock, but with timeout and deadlock detection. We can do th...
```diff diff --git a/arch/x86/include/asm/rqspinlock.h b/arch/x86/include/asm/rqspinlock.h new file mode 100644 index 000000000000..24a885449ee6 --- /dev/null +++ b/arch/x86/include/asm/rqspinlock.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_X86_RQSPINLOCK_H +#define _ASM_X86_RQSPINLOCK_H + ...
31158ad02ddbed2b0672c9701a0a2f3e5b3bc01a
Analyze and fix the following issue in the Linux kernel code: rqspinlock: Add deadlock detection and recovery
Problem Details: While the timeout logic provides guarantees for the waiter's forward progress, the time until a stalling waiter unblocks can still be long. The default timeout of 1/4 sec can be excessively long for some use cases. Additionally, custom timeouts may exacerbate recovery time. Introduce logic to detect ...
```diff diff --git a/include/asm-generic/rqspinlock.h b/include/asm-generic/rqspinlock.h index 9bd11cb7acd6..34c3dcb4299e 100644 --- a/include/asm-generic/rqspinlock.h +++ b/include/asm-generic/rqspinlock.h @@ -11,6 +11,7 @@ #include <linux/types.h> #include <vdso/time64.h> +#include <linux/percpu.h> struct qspi...
2d117e67f318303f6ab699a5511d1fac3f170545
Analyze and fix the following issue in the Linux kernel code: RISC-V: KVM: Teardown riscv specific bits after kvm_exit
Problem Details: During a module removal, kvm_exit invokes arch specific disable call which disables AIA. However, we invoke aia_exit before kvm_exit resulting in the following warning. KVM kernel module can't be inserted afterwards due to inconsistent state of IRQ. [25469.031389] percpu IRQ 31 still enabled on CPU0! ...
```diff diff --git a/arch/riscv/kvm/main.c b/arch/riscv/kvm/main.c index 1fa8be5ee509..4b24705dc63a 100644 --- a/arch/riscv/kvm/main.c +++ b/arch/riscv/kvm/main.c @@ -172,8 +172,8 @@ module_init(riscv_kvm_init); static void __exit riscv_kvm_exit(void) { - kvm_riscv_teardown(); - kvm_exit(); + + kvm_riscv_teardown...
2744ec472de31141ad354907ff98843dd6040917
Analyze and fix the following issue in the Linux kernel code: riscv: Fix set up of vector cpu hotplug callback
Problem Details: Whether or not we have RISCV_PROBE_VECTOR_UNALIGNED_ACCESS we need to set up a cpu hotplug callback to check if we have vector at all, since, when we don't have vector, we need to set vector_misaligned_access to unsupported rather than leave it the default of unknown. Fixes: e7c9d66e313b ("RISC-V: Rep...
```diff diff --git a/arch/riscv/kernel/unaligned_access_speed.c b/arch/riscv/kernel/unaligned_access_speed.c index c9d3237649bb..d9d4ca1fadc7 100644 --- a/arch/riscv/kernel/unaligned_access_speed.c +++ b/arch/riscv/kernel/unaligned_access_speed.c @@ -356,6 +356,20 @@ static void check_vector_unaligned_access(struct wor...
05ee21f0fcb8ca29bf42bd6cbce109f2e49c167f
Analyze and fix the following issue in the Linux kernel code: riscv: Fix set up of cpu hotplug callbacks
Problem Details: CPU hotplug callbacks should be set up even if we detected all current cpus emulate misaligned accesses, since we want to ensure our expectations of all cpus emulating is maintained. Fixes: 6e5ce7f2eae3 ("riscv: Decouple emulated unaligned accesses from access speed") Fixes: e7c9d66e313b ("RISC-V: Rep...
```diff diff --git a/arch/riscv/kernel/unaligned_access_speed.c b/arch/riscv/kernel/unaligned_access_speed.c index 780f1c5f512a..c9d3237649bb 100644 --- a/arch/riscv/kernel/unaligned_access_speed.c +++ b/arch/riscv/kernel/unaligned_access_speed.c @@ -247,13 +247,6 @@ static void __init check_unaligned_access_speed_all_...
e6d0adf2eb5bb3244cb21a7a15899aa058bd384f
Analyze and fix the following issue in the Linux kernel code: riscv: Fix check_unaligned_access_all_cpus
Problem Details: check_vector_unaligned_access_emulated_all_cpus(), like its name suggests, will return true when all cpus emulate unaligned vector accesses. If the function returned false it may have been because vector isn't supported at all (!has_vector()) or because at least one cpu doesn't emulate unaligned vector...
```diff diff --git a/arch/riscv/kernel/traps_misaligned.c b/arch/riscv/kernel/traps_misaligned.c index aacbd9d7196e..4354c87c0376 100644 --- a/arch/riscv/kernel/traps_misaligned.c +++ b/arch/riscv/kernel/traps_misaligned.c @@ -609,12 +609,6 @@ bool __init check_vector_unaligned_access_emulated_all_cpus(void) { int c...
5af72a818612332a11171b16f27a62ec0a0f91d7
Analyze and fix the following issue in the Linux kernel code: riscv: Fix riscv_online_cpu_vec
Problem Details: We shouldn't probe when we already know vector is unsupported and we should probe when we see we don't yet know whether it's supported. Furthermore, we should ensure we've set the access type to unsupported when we don't have vector at all. Fixes: e7c9d66e313b ("RISC-V: Report vector unaligned access ...
```diff diff --git a/arch/riscv/kernel/unaligned_access_speed.c b/arch/riscv/kernel/unaligned_access_speed.c index b7a8ff7ba6df..161964cf2abc 100644 --- a/arch/riscv/kernel/unaligned_access_speed.c +++ b/arch/riscv/kernel/unaligned_access_speed.c @@ -367,10 +367,12 @@ static void check_vector_unaligned_access(struct wo...
a00e022be5315c5a1f47521a1cc6d3b71c8e9c44
Analyze and fix the following issue in the Linux kernel code: riscv: Annotate unaligned access init functions
Problem Details: Several functions used in unaligned access probing are only run at init time. Annotate them appropriately. Fixes: f413aae96cda ("riscv: Set unaligned access speed at compile time") Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Signed-off-by: Andrew Jones <ajones@ventanamicro.com> Link: https:/...
```diff diff --git a/arch/riscv/include/asm/cpufeature.h b/arch/riscv/include/asm/cpufeature.h index 569140d6e639..19defdc2002d 100644 --- a/arch/riscv/include/asm/cpufeature.h +++ b/arch/riscv/include/asm/cpufeature.h @@ -63,7 +63,7 @@ void __init riscv_user_isa_enable(void); #define __RISCV_ISA_EXT_SUPERSET_VALIDATE...
880d851a7fe1bbb6d78ec59087f7cdba46292c36
Analyze and fix the following issue in the Linux kernel code: Documentation: vgaarbiter: Fix grammar
Problem Details: Correct grammar issues: - Fix "co-exist" subject-verb agreement - Correct plural form of "server" in context of more than one legacy devices - Use passive mood for intro sentence of libpciaccess section Signed-off-by: Pranav Tyagi <pranav.tyagi03@gmail.com> Reviewed-by: Bagas Sanjaya <bagasdotme@gm...
```diff diff --git a/Documentation/gpu/vgaarbiter.rst b/Documentation/gpu/vgaarbiter.rst index bde3c0afb059..d1e953712cc2 100644 --- a/Documentation/gpu/vgaarbiter.rst +++ b/Documentation/gpu/vgaarbiter.rst @@ -11,9 +11,9 @@ Section 7, Legacy Devices. The Resource Access Control (RAC) module inside the X server [0] ...
06e70003d88218675c566584dd76867fcb39706d
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt792x: re-register CHANCTX_STA_CSA only for the mt7921 series
Problem Details: CSA is currently not supported on mt7925, so CSA is only registered for the mt7921 series Cc: stable@vger.kernel.org Fixes: 8aa2f59260eb ("wifi: mt76: mt7921: introduce CSA support") Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Link: https://patch.msgid.link/20250313054044.2638837-1-ming...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt792x_core.c b/drivers/net/wireless/mediatek/mt76/mt792x_core.c index 8799627f6292..0f7806f6338d 100644 --- a/drivers/net/wireless/mediatek/mt76/mt792x_core.c +++ b/drivers/net/wireless/mediatek/mt76/mt792x_core.c @@ -665,7 +665,8 @@ int mt792x_init_wiphy(struct ...
5b5f1ca9ce73ab6c35e5cd3348f8432ba190d7f4
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: scan: fix setting tx_info fields
Problem Details: ieee80211_tx_prepare_skb initializes the skb cb, so fields need to be set afterwards. Link: https://patch.msgid.link/20250311103646.43346-8-nbd@nbd.name Signed-off-by: Felix Fietkau <nbd@nbd.name>
```diff diff --git a/drivers/net/wireless/mediatek/mt76/scan.c b/drivers/net/wireless/mediatek/mt76/scan.c index 1c4f9deaaada..9b20ccbeb8cf 100644 --- a/drivers/net/wireless/mediatek/mt76/scan.c +++ b/drivers/net/wireless/mediatek/mt76/scan.c @@ -52,11 +52,6 @@ mt76_scan_send_probe(struct mt76_dev *dev, struct cfg80211...
86db2c5d4ed390b97a5b455a97e2cd9c4f3eff2b
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7996: implement driver specific get_txpower function
Problem Details: Fixes reporting tx power for vifs that don't have a channel context assigned. Report the tx power of a phy that is covered by the vif's radio mask. Link: https://patch.msgid.link/20250311103646.43346-7-nbd@nbd.name Signed-off-by: Felix Fietkau <nbd@nbd.name>
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/main.c b/drivers/net/wireless/mediatek/mt76/mt7996/main.c index 886b6ef3462b..b01cc7ef4799 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c @@ -602,6 +602,33 @@ static void mt7996_configure...
0c5a89ceddc1728a40cb3313948401dd70e3c649
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: only mark tx-status-failed frames as ACKed on mt76x0/2
Problem Details: The interrupt status polling is unreliable, which can cause status events to get lost. On all newer chips, txs-timeout is an indication that the packet was either never sent, or never acked. Fixes issues with inactivity polling. Link: https://patch.msgid.link/20250311103646.43346-6-nbd@nbd.name Signed...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index c16a6743ad64..b461273c3306 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -492,6 +492,7 @@ struct mt76_hw_cap { #define MT_DRV_RX_DMA_HDR BIT(3) ...