id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
c6399b893043a5bb634de8677362f96684f1c0c8
Analyze and fix the following issue in the Linux kernel code: riscv: hibernation: Remove duplicate call of suspend_restore_csrs
Problem Details: The suspend_restore_csrs is called in both __hibernate_cpu_resume and the `else` of subsequent swsusp_arch_suspend. Removing the first call makes both suspend_{save,restore}_csrs left in swsusp_arch_suspend for clean code. Fixes: c0317210012e ("RISC-V: Add arch functions to support hibernation/suspen...
```diff diff --git a/arch/riscv/kernel/hibernate-asm.S b/arch/riscv/kernel/hibernate-asm.S index 5c76671c7e15..d698dd7df637 100644 --- a/arch/riscv/kernel/hibernate-asm.S +++ b/arch/riscv/kernel/hibernate-asm.S @@ -28,7 +28,6 @@ ENTRY(__hibernate_cpu_resume) REG_L a0, hibernate_cpu_context - suspend_restore_csrs ...
5a0702aac020b2e81f778e3477095d8ed39ce523
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: add eht_capa debugfs field
Problem Details: Output looks like this: [root@ct523c-0b29 ~]# cat /debug/ieee80211/wiphy6/netdev\:wlan6/stations/50\:28\:4a\:bd\:f4\:a7/eht_capa EHT supported MAC-CAP: 0x82 0x00 PHY-CAP: 0x0c 0x00 0x00 0x00 0x00 0x48 0x00 0x00 0x00 OM-CONTROL MAX-MPDU-LEN: 11454 242-TONE-RU-GT20MHZ NDP-4-EHT-LFT-32-GI BEAMF...
```diff diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index f1914bf39f0e..5a97fb248c85 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c @@ -1035,6 +1035,190 @@ out: } LINK_STA_OPS(he_capa); +static ssize_t link_sta_eht_capa_read(struct file *file, char __user *userbuf,...
a5052c85b9def55cf1c6d13bbed0ae07ffb1c6a1
Analyze and fix the following issue in the Linux kernel code: samples: pfsm: add CC_CAN_LINK dependency
Problem Details: When no libc for the target architecture is available, cross-compiling the same cannot work: samples/pfsm/pfsm-wakeup.c:12:10: fatal error: fcntl.h: No such file or directory Fixes: 9e66fb5244953 ("samples: Add userspace example for TI TPS6594 PFSM") Reported-by: Guenter Roeck <linux@roeck-us.net> Si...
```diff diff --git a/samples/Kconfig b/samples/Kconfig index 3edf73a3dc9b..bf49ed0d7362 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -256,6 +256,7 @@ config SAMPLE_INTEL_MEI config SAMPLE_TPS6594_PFSM bool "Build example program working with TPS6594 PFSM driver" depends on HEADERS_INSTALL + depends on CC_...
af2e19d82a116bc622eea84c9faadd5f7e20bec4
Analyze and fix the following issue in the Linux kernel code: misc: fastrpc: check return value of devm_kasprintf()
Problem Details: devm_kasprintf() returns a pointer to dynamically allocated memory. Pointer could be NULL in case allocation fails. Check pointer validity. Identified with coccinelle (kmerr.cocci script). Fixes: 3abe3ab3cdab ("misc: fastrpc: add secure domain support") Signed-off-by: Claudiu Beznea <claudiu.beznea@mi...
```diff diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 37f32d20fcd0..9666d28037e1 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -2225,6 +2225,9 @@ static int fastrpc_device_register(struct device *dev, struct fastrpc_channel_ct fdev->miscdev.fops = &fastrpc_fops; fdev->misc...
e794203e9d2d610faf6c5926345091193b202af5
Analyze and fix the following issue in the Linux kernel code: btrfs: make btrfs_compressed_bioset static
Problem Details: The 'btrfs_compressed_bioset' struct isn't exported outside of the fs/btrfs/compression.c file, so make it static to fix the following sparse warning: fs/btrfs/compression.c:40:16: warning: symbol 'btrfs_compressed_bioset' was not declared. Should it be static? Reviewed-by: Christoph Hellwig <hch@lst...
```diff diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index f1004259c3d3..8818ed5c390f 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -37,7 +37,7 @@ #include "file-item.h" #include "super.h" -struct bio_set btrfs_compressed_bioset; +static struct bio_set btrfs_compressed_bioset; ...
042aeecc02c83500ad5a4de1e40d2efdfed49a07
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: Remove struct drm_driver.gem_prime_mmap
Problem Details: The callback struct drm_driver.gem_prime_mmap as been removed in commit 0adec22702d4 ("drm: Remove struct drm_driver.gem_prime_mmap"). Do not assign to it. The assigned function, drm_gem_prime_mmap(), is now the default for the operation, so there is no change in functionality. Signed-off-by: Thomas Z...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 43613569801b..07e16ad465d0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2879,7 +2879,6 @@ const struct drm_driver amdgpu_partition_driver = { .prime_ha...
5fe251112646d8626818ea90f7af325bab243efa
Analyze and fix the following issue in the Linux kernel code: HID: logitech-hidpp: add HIDPP_QUIRK_DELAYED_INIT for the T651.
Problem Details: commit 498ba2069035 ("HID: logitech-hidpp: Don't restart communication if not necessary") put restarting communication behind that flag, and this was apparently necessary on the T651, but the flag was not set for it. Fixes: 498ba2069035 ("HID: logitech-hidpp: Don't restart communication if not necessa...
```diff diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 2ff007244d5e..dfe8e09a18de 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -4553,7 +4553,7 @@ static const struct hid_device_id hidpp_devices[] = { { /* wireless touchpad T651 */ ...
7257d930aadcd62d1c7971ab14f3b1126356abdc
Analyze and fix the following issue in the Linux kernel code: regulator: pca9450: Fix LDO3OUT and LDO4OUT MASK
Problem Details: L3_OUT and L4_OUT Bit fields range from Bit 0:4 and thus the mask should be 0x1F instead of 0x0F. Fixes: 0935ff5f1f0a ("regulator: pca9450: add pca9450 pmic driver") Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Link: https://lore.kernel....
```diff diff --git a/include/linux/regulator/pca9450.h b/include/linux/regulator/pca9450.h index 3c01c2bf84f5..505c908dbb81 100644 --- a/include/linux/regulator/pca9450.h +++ b/include/linux/regulator/pca9450.h @@ -196,11 +196,11 @@ enum { /* PCA9450_REG_LDO3_VOLT bits */ #define LDO3_EN_MASK 0xC0 -#define LDO3OU...
d7fce52fdf96663ddc2eb21afecff3775588612a
Analyze and fix the following issue in the Linux kernel code: ipvs: align inner_mac_header for encapsulation
Problem Details: When using encapsulation the original packet's headers are copied to the inner headers. This preserves the space for an inner mac header, which is not used by the inner payloads for the encapsulation types supported by IPVS. If a packet is using GUE or GRE encapsulation and needs to be segmented, flow ...
```diff diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c index feb1d7fcb09f..a80b960223e1 100644 --- a/net/netfilter/ipvs/ip_vs_xmit.c +++ b/net/netfilter/ipvs/ip_vs_xmit.c @@ -1207,6 +1207,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, skb->transport_header = skb->ne...
639949a7031e04c59ec91614eceb9543e9120f43
Analyze and fix the following issue in the Linux kernel code: tty: serial: imx: fix rs485 rx after tx
Problem Details: Since commit 79d0224f6bf2 ("tty: serial: imx: Handle RS485 DE signal active high") RS485 reception no longer works after a transmission. The following scenario shows the problem: 1) Open a port in RS485 mode 2) Receive data from remote (OK) 3) Transmit data to remote (OK) 4) Receive data from remo...
```diff diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index b2bf3cb449f4..7341d060f85c 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -369,6 +369,16 @@ static void imx_uart_soft_reset(struct imx_port *sport) sport->idle_counter = 0; } +static void imx_uart_disable_loopba...
55f90c3f83c5d26ce6b1a6a01a4f435860376be4
Analyze and fix the following issue in the Linux kernel code: usb: cdns2: Fix spelling mistake in a trace message "Wakupe" -> "Wakeup"
Problem Details: There is a spelling mistake in a trace message. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20230615144052.2254528-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
```diff diff --git a/drivers/usb/gadget/udc/cdns2/cdns2-debug.h b/drivers/usb/gadget/udc/cdns2/cdns2-debug.h index fd22ae949008..be9ae0d28a40 100644 --- a/drivers/usb/gadget/udc/cdns2/cdns2-debug.h +++ b/drivers/usb/gadget/udc/cdns2/cdns2-debug.h @@ -36,7 +36,7 @@ static inline const char *cdns2_decode_usb_irq(char *st...
ee400a1be11527e1ea58b716b338b9fb6665b8d6
Analyze and fix the following issue in the Linux kernel code: usb: gadget: function: printer: Replace strlcpy with strscpy
Problem Details: strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). Direct r...
```diff diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c index 28db3e336e7d..b91425611969 100644 --- a/drivers/usb/gadget/function/f_printer.c +++ b/drivers/usb/gadget/function/f_printer.c @@ -1211,8 +1211,8 @@ static ssize_t f_printer_opts_pnp_string_show(struct config_ite...
1e35f074399dece73d5df11847d4a0d7a6f49434
Analyze and fix the following issue in the Linux kernel code: usb: typec: tcpm: fix cc role at port reset
Problem Details: In the current implementation, the tcpm set CC1/CC2 role to open when it do port reset would cause the VBUS removed by the Type-C partner. This sets CC1/CC2 according to the default state of port to fix it. Signed-off-by: Frank Wang <frank.wang@rock-chips.com> Reviewed-by: Guenter Roeck <linux@roeck-...
```diff diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 3c6b0c8e2d3a..9f6aaa3e70ca 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -4885,7 +4885,8 @@ static void run_state_machine(struct tcpm_port *port) break; case PORT_RESET: tcpm_reset_port(p...
819da022dd007398d0c42ebcd8dbb1b681acea53
Analyze and fix the following issue in the Linux kernel code: afs: Fix waiting for writeback then skipping folio
Problem Details: Commit acc8d8588cb7 converted afs_writepages_region() to write back a folio batch. The function waits for writeback to a folio, but then proceeds to the rest of the batch without trying to write that folio again. This patch fixes has it attempt to write the folio again. [DH: Also remove an 'else' that...
```diff diff --git a/fs/afs/write.c b/fs/afs/write.c index fd433024070e..8750b99c3f56 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -731,6 +731,7 @@ static int afs_writepages_region(struct address_space *mapping, * (changing page->mapping to NULL), or even swizzled * back from swapper_space to tmpfs fil...
a2b6f2ab3e144f8e23666aafeba0e4d9ea4b7975
Analyze and fix the following issue in the Linux kernel code: afs: Fix dangling folio ref counts in writeback
Problem Details: Commit acc8d8588cb7 converted afs_writepages_region() to write back a folio batch. If writeback needs rescheduling, the function exits without dropping the references to the folios in fbatch. This patch fixes that. [DH: Moved the added line before the _leave()] Fixes: acc8d8588cb7 ("afs: convert afs_...
```diff diff --git a/fs/afs/write.c b/fs/afs/write.c index c822d6006033..fd433024070e 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -763,6 +763,7 @@ static int afs_writepages_region(struct address_space *mapping, if (wbc->sync_mode == WB_SYNC_NONE) { if (skips >= 5 || need_resched()) { *_next = ...
ff7a1790fbf92f1bdd0966d3f0da3ea808ede876
Analyze and fix the following issue in the Linux kernel code: gpiolib: Fix irq_domain resource tracking for gpiochip_irqchip_add_domain()
Problem Details: Up until commit 6a45b0e2589f ("gpiolib: Introduce gpiochip_irqchip_add_domain()") all irq_domains were allocated by gpiolib itself and thus gpiolib also takes care of freeing it. With gpiochip_irqchip_add_domain() a user of gpiolib can associate an irq_domain with the gpio_chip. This irq_domain is not...
```diff diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 9ecf93cbd801..5be8ad61523e 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1745,7 +1745,7 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gc) } /* Remove all IRQ mappings and delete the domain */ - if (gc->irq...
5dfc6a8ae297800e1edebc76163b0868d5314a4e
Analyze and fix the following issue in the Linux kernel code: staging: rtl8192e: Add missing entry CFG80211 in Kconfig
Problem Details: Add missing entry CFG80211 in Kconfig to ensure that CFG80211 is available when selecting hardware rtl8192e. Fixes: d88b46ce5ab8 ("staging: rtl8192e: Add cfg80211.h and remove defined variables") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202306180620....
```diff diff --git a/drivers/staging/rtl8192e/rtl8192e/Kconfig b/drivers/staging/rtl8192e/rtl8192e/Kconfig index eae8167f79dd..f8f774a16295 100644 --- a/drivers/staging/rtl8192e/rtl8192e/Kconfig +++ b/drivers/staging/rtl8192e/rtl8192e/Kconfig @@ -3,6 +3,7 @@ config RTL8192E tristate "RealTek RTL8192E Wireless LAN NIC...
c07ce33a1ddd5a2e74ddcfc8cfcf7f94c3ee2347
Analyze and fix the following issue in the Linux kernel code: gpio: synq: remove unused zynq_gpio_irq_reqres/zynq_gpio_irq_relres
Problem Details: The driver now uses the generic request/release callbacks, so the custom ones are no longer called. When building with -Woverride-init, gcc produces a warning about the duplicate entries: In file included from drivers/gpio/gpio-zynq.c:10: include/linux/gpio/driver.h:621:43: error: initialized field ov...
```diff diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index c334e46033ba..0a7264aabe48 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -575,26 +575,6 @@ static int zynq_gpio_set_wake(struct irq_data *data, unsigned int on) return 0; } -static int zynq_gpio_irq_reqres(stru...
7ec2e4499e378768a985cd4679144713edb37035
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: dvm: fix -Wunused-const-variable gcc warning
Problem Details: Fix the following gcc 13.1 warning observed with W=1: drivers/net/wireless/intel/iwlwifi/dvm/rs.c:207:39: warning: ‘iwl_rate_mcs’ defined but not used [-Wunused-const-variable=] This table is actually used in 'rs_sta_dbgfs_scale_table_read()' only if CONFIG_MAC80211_DEBUGFS is enabled, so the whole t...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/rs.c b/drivers/net/wireless/intel/iwlwifi/dvm/rs.c index 4b1f006c105b..f4a6f76cf193 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/rs.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/rs.c @@ -203,23 +203,6 @@ static const u16 expected_tpt_mimo3_40MHz[4][IWL...
3a89311387cde27da8e290458b2d037133c1f7b5
Analyze and fix the following issue in the Linux kernel code: drm/i915: Fix a NULL vs IS_ERR() bug
Problem Details: The mmap_offset_attach() function returns error pointers, it doesn't return NULL. Fixes: eaee1c085863 ("drm/i915: Add a function to mmap framebuffer obj") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com> Reviewed-by: Andi Shyti <andi.shyti@linux.in...
```diff diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c index 4e7a838ab7bd..aa4d842d4c5a 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c @@ -1085,8 +1085,8 @@ int i915_gem_fb_mmap(struct drm_i915_gem_object *obj, struc...
337207408f74a8374beacf232ec1e08742c1d98f
Analyze and fix the following issue in the Linux kernel code: spi: spi-geni-qcom: correctly handle -EPROBE_DEFER from dma_request_chan()
Problem Details: Now spi_geni_grab_gpi_chan() errors are correctly reported, the -EPROBE_DEFER error should be returned from probe in case the GPI dma driver is built as module and/or not probed yet. Fixes: b59c122484ec ("spi: spi-geni-qcom: Add support for GPI dma") Fixes: 6532582c353f ("spi: spi-geni-qcom: fix error...
```diff diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c index e423efcf016f..08672a961fbb 100644 --- a/drivers/spi/spi-geni-qcom.c +++ b/drivers/spi/spi-geni-qcom.c @@ -646,6 +646,8 @@ static int spi_geni_init(struct spi_geni_master *mas) geni_se_select_mode(se, GENI_GPI_DMA); dev_dbg(mas-...
160fe8f6fdb13da6111677be6263e5d65e875987
Analyze and fix the following issue in the Linux kernel code: btrfs: add handling for RAID1C23/DUP to btrfs_reduce_alloc_profile
Problem Details: Callers of `btrfs_reduce_alloc_profile` expect it to return exactly one allocation profile flag, and failing to do so may ultimately result in a WARN_ON and remount-ro when allocating new blocks, like the below transaction abort on 6.1. `btrfs_reduce_alloc_profile` has two ways of determining the prof...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 49e92226f766..6753524b146c 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -95,14 +95,21 @@ static u64 btrfs_reduce_alloc_profile(struct btrfs_fs_info *fs_info, u64 flags) } allowed &= flags; - if (allowed & BTRFS_BLOCK...
ede600e497b1461d06d22a7d17703d9096868bc3
Analyze and fix the following issue in the Linux kernel code: btrfs: fix extent buffer leak after tree mod log failure at split_node()
Problem Details: At split_node(), if we fail to log the tree mod log copy operation, we return without unlocking the split extent buffer we just allocated and without decrementing the reference we own on it. Fix this by unlocking it and decrementing the ref count before returning. Fixes: 5de865eebb83 ("Btrfs: fix tree...
```diff diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 7f7f13965fe9..8496535828de 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -3053,6 +3053,8 @@ static noinline int split_node(struct btrfs_trans_handle *trans, ret = btrfs_tree_mod_log_eb_copy(split, c, 0, mid, c_nritems - mid); if (ret) { + b...
d09c51521f22f9cbdfb1cf63e5c456077c622c84
Analyze and fix the following issue in the Linux kernel code: btrfs: add missing error handling when logging operation while COWing extent buffer
Problem Details: When COWing an extent buffer that is not the root node, we need to log in the tree mod log that we replaced a pointer in the parent node, otherwise a tree mod log user doing a search on the b+tree can return incorrect results (that miss something). We are doing the call to btrfs_tree_mod_log_insert_key...
```diff diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 385524224037..7f7f13965fe9 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -595,8 +595,14 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans, add_root_to_dirty_list(root); } else { WARN_ON(trans->transid != btrfs_heade...
7e27180994383b7c741ad87749db01e4989a02ba
Analyze and fix the following issue in the Linux kernel code: btrfs: reinsert BGs failed to reclaim
Problem Details: The reclaim process can temporarily fail. For example, if the space is getting tight, it fails to make the block group read-only. If there are no further writes on that block group, the block group will never get back to the reclaim list, and the BG never gets reclaimed. In a certain workload, we can l...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 9d9f09f25f8f..49e92226f766 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -1833,6 +1833,8 @@ void btrfs_reclaim_bgs_work(struct work_struct *work) } next: + if (ret) + btrfs_mark_bg_to_reclaim(bg); btrfs_put_bloc...
93463ff7b54626f8276c0bd3d3f968fbf8d5d380
Analyze and fix the following issue in the Linux kernel code: btrfs: bail out reclaim process if filesystem is read-only
Problem Details: When a filesystem is read-only, we cannot reclaim a block group as it cannot rewrite the data. Just bail out in that case. Note that it can drop block groups in this case. As we did sb_start_write(), read-only filesystem means we got a fatal error and forced read-only. There is no chance to reclaim th...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 616507596671..9d9f09f25f8f 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -1794,8 +1794,15 @@ void btrfs_reclaim_bgs_work(struct work_struct *work) } spin_unlock(&bg->lock); - /* Get out fast, in case we're unmounti...
a9f189716cf15913c453299d72f69c51a9b0f86b
Analyze and fix the following issue in the Linux kernel code: btrfs: move out now unused BG from the reclaim list
Problem Details: An unused block group is easy to remove to free up space and should be reclaimed fast. Such block group can often already be a target of the reclaim process. As we check list_empty(&bg->bg_list), we keep it in the reclaim list. That block group is never reclaimed until the file system is filled e.g. up...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 18305f5c74c9..616507596671 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -1633,11 +1633,14 @@ void btrfs_mark_bg_unused(struct btrfs_block_group *bg) { struct btrfs_fs_info *fs_info = bg->fs_info; + trace_btrfs_add_unu...
3ed01616bad6c7e3de196676b542ae3df8058592
Analyze and fix the following issue in the Linux kernel code: btrfs: delete unused BGs while reclaiming BGs
Problem Details: The reclaiming process only starts after the filesystem volumes are allocated to a certain level (75% by default). Thus, the list of reclaiming target block groups can build up so huge at the time the reclaim process kicks in. On a test run, there were over 1000 BGs in the reclaim list. As the reclaim...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 618ba7670e66..18305f5c74c9 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -1824,10 +1824,24 @@ void btrfs_reclaim_bgs_work(struct work_struct *work) next: btrfs_put_block_group(bg); + + mutex_unlock(&fs_info->reclaim_...
c731cd0b6d255e4855a7cac9f276864032ab2387
Analyze and fix the following issue in the Linux kernel code: btrfs: fix file_offset for REQ_BTRFS_ONE_ORDERED bios that get split
Problem Details: If a bio gets split, it needs to have a proper file_offset for checksum validation and repair to work properly. Based on feedback from Josef, commit 852eee62d31a ("btrfs: allow btrfs_submit_bio to split bios") skipped this adjustment for ONE_ORDERED bios. But if we actually ever need to split a ONE_O...
```diff diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c index ead288fa24db..846deed98fd0 100644 --- a/fs/btrfs/bio.c +++ b/fs/btrfs/bio.c @@ -81,8 +81,7 @@ static struct btrfs_bio *btrfs_split_bio(struct btrfs_fs_info *fs_info, btrfs_bio_init(bbio, fs_info, NULL, orig_bbio); bbio->inode = orig_bbio->inode; bbio->fil...
7027f87108ce3d23ea542e1a9a79056530db4a87
Analyze and fix the following issue in the Linux kernel code: btrfs: don't treat zoned writeback as being from an async helper thread
Problem Details: When extent_write_locked_range was originally added, it was only used writing back compressed pages from an async helper thread. But it is now also used for writing back pages on zoned devices, where it is called directly from the ->writepage context. In this case we want to be able to pass on the wr...
```diff diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 1da247e753b0..f4d3c56b2900 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2210,7 +2210,8 @@ retry: * already been ran (aka, ordered extent inserted) and all pages are still * locked. */ -int extent_write_locked_range(struct i...
3e92499e3b004baffb479d61e191b41b604ece9a
Analyze and fix the following issue in the Linux kernel code: btrfs: don't check PageError in __extent_writepage
Problem Details: __extent_writepage currenly sets PageError whenever any error happens, and the also checks for PageError to decide if to call error handling. This leads to very unclear responsibility for cleaning up on errors. In the VM and generic writeback helpers the basic idea is that once I/O is fired off all err...
```diff diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 178e8230c28a..33e5f0a31c21 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -1557,38 +1557,7 @@ done: set_page_writeback(page); end_page_writeback(page); } - /* - * Here we used to have a check for PageError() and then set @r...
02474880e8fdd8533f21da4264a7ebfce8196be7
Analyze and fix the following issue in the Linux kernel code: ASoC: max98388: fix error code in probe()
Problem Details: This seems like a copy and paste bug. Return the correct variable. It should be "ret" instead of PTR_ERR(max98388->regmap). Fixes: 6a8e1d46f062 ("ASoC: max98388: add amplifier driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/d44c8388-b12b-4045-95de-0d4b...
```diff diff --git a/sound/soc/codecs/max98388.c b/sound/soc/codecs/max98388.c index 1fd50e56ecae..cde5e85946cb 100644 --- a/sound/soc/codecs/max98388.c +++ b/sound/soc/codecs/max98388.c @@ -960,7 +960,7 @@ static int max98388_i2c_probe(struct i2c_client *i2c) ret = regmap_read(max98388->regmap, MAX98388_R22FF_...
2c14f0ffdd30bd3d321ad5fe76fcf701746e1df6
Analyze and fix the following issue in the Linux kernel code: btrfs: fix fsverify read error handling in end_page_read
Problem Details: Also clear the uptodate bit to make sure the page isn't seen as uptodate in the page cache if fsverity verification fails. Fixes: 146054090b08 ("btrfs: initial fsverity support") CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Christoph Hellwig <hch@ls...
```diff diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 8e42ce48b52e..a943a6622489 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -497,12 +497,8 @@ static void end_page_read(struct page *page, bool uptodate, u64 start, u32 len) ASSERT(page_offset(page) <= start && start + len ...
36614a3beba33a05ad78d4dcb9aa1d00e8a7d01f
Analyze and fix the following issue in the Linux kernel code: btrfs: fix range_end calculation in extent_write_locked_range
Problem Details: The range_end field in struct writeback_control is inclusive, just like the end parameter passed to extent_write_locked_range. Not doing this could cause extra writeout, which is harmless but suboptimal. Fixes: 771ed689d2cd ("Btrfs: Optimize compressed writeback and reads") CC: stable@vger.kernel.org...
```diff diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index d5b3b15f7ab2..0726c82db309 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2310,7 +2310,7 @@ int extent_write_locked_range(struct inode *inode, u64 start, u64 end) struct writeback_control wbc_writepages = { .sync_mode = WB_SYN...
5cead5422a0e3d13b0bcee986c0f5c4ebb94100b
Analyze and fix the following issue in the Linux kernel code: btrfs: insert tree mod log move in push_node_left
Problem Details: There is a fairly unlikely race condition in tree mod log rewind that can result in a kernel panic which has the following trace: [530.569] BTRFS critical (device sda3): unable to find logical 0 length 4096 [530.585] BTRFS critical (device sda3): unable to find logical 0 length 4096 [530.602] BU...
```diff diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 2f2071d64c52..385524224037 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -2785,8 +2785,8 @@ static int push_node_left(struct btrfs_trans_handle *trans, if (push_items < src_nritems) { /* - * Don't call btrfs_tree_mod_log_insert_move() her...
8ab546bb30bdf975e5ca6024ec6c4f7d324cb11a
Analyze and fix the following issue in the Linux kernel code: btrfs: disable allocation warnings for compression workspaces
Problem Details: The workspaces for compression are typically much larger than a page and for high zstd levels in the range of megabytes. There's a fallback to vmalloc but this can still fail (see the report). Some of the workspaces are preallocated at module load time so we have a safe fallback, otherwise when a new ...
```diff diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c index 3a095b9c6373..d3fcfc628a4f 100644 --- a/fs/btrfs/lzo.c +++ b/fs/btrfs/lzo.c @@ -88,9 +88,9 @@ struct list_head *lzo_alloc_workspace(unsigned int level) if (!workspace) return ERR_PTR(-ENOMEM); - workspace->mem = kvmalloc(LZO1X_MEM_COMPRESS, GFP_KERNEL); ...
efcfcbc6a36195c42d98e0ee697baba36da94dc8
Analyze and fix the following issue in the Linux kernel code: btrfs: add xxhash to fast checksum implementations
Problem Details: The implementation of XXHASH is now CPU only but still fast enough to be considered for the synchronous checksumming, like non-generic crc32c. A userspace benchmark comparing it to various implementations (patched hash-speedtest from btrfs-progs): Block size: 4096 Iterations: 1000000 Im...
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 4328c6b1120e..7513388b0567 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2011,6 +2011,9 @@ static int btrfs_init_csum_hash(struct btrfs_fs_info *fs_info, u16 csum_type) if (!strstr(crypto_shash_driver_name(csum_shash), "generic")) ...
816f589b8d43f7c258b0c10a5ce29daf01614651
Analyze and fix the following issue in the Linux kernel code: btrfs: atomically insert the new extent in btrfs_split_ordered_extent
Problem Details: Currently there is a small race window in btrfs_split_ordered_extent, where the reduced old extent can be looked up on the per-inode rbtree or the per-root list while the newly split out one isn't visible yet. Fix this by open coding btrfs_alloc_ordered_extent in btrfs_split_ordered_extent, and holdin...
```diff diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index ea1c2ec10573..0dc2bd0bd675 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c @@ -1135,15 +1135,17 @@ bool btrfs_try_lock_ordered_range(struct btrfs_inode *inode, u64 start, u64 end, struct btrfs_ordered_extent *btrfs_split_or...
315dd5cc75ddccb6ebd863366b7a7d0488057637
Analyze and fix the following issue in the Linux kernel code: btrfs: reorder some members of struct btrfs_delayed_ref_head
Problem Details: Currently struct delayed_ref_head has its 'bytenr' and 'href_node' members in different cache lines (even on a release, non-debug, kernel). This is not optimal because when iterating the red black tree of delayed ref heads for inserting a new delayed ref head (htree_insert()) we have to pull in 2 cache...
```diff diff --git a/fs/btrfs/delayed-ref.h b/fs/btrfs/delayed-ref.h index b54261fe509b..9b28e800a604 100644 --- a/fs/btrfs/delayed-ref.h +++ b/fs/btrfs/delayed-ref.h @@ -70,20 +70,26 @@ struct btrfs_delayed_extent_op { struct btrfs_delayed_ref_head { u64 bytenr; u64 num_bytes; - refcount_t refs; + /* + * For ins...
b831306b3b7d9202b300f7f6ec32f5be2b4926a3
Analyze and fix the following issue in the Linux kernel code: btrfs: print assertion failure report and stack trace from the same line
Problem Details: Assertions reports are split into two parts, the exact file and location of the condition and then the stack trace printed from btrfs_assertfail(). This means all the stack traces report the same line and this is what's typically reported by various tools, making it harder to distinguish the reports. ...
```diff diff --git a/fs/btrfs/messages.c b/fs/btrfs/messages.c index 310a05cf95ef..23fc11af498a 100644 --- a/fs/btrfs/messages.c +++ b/fs/btrfs/messages.c @@ -252,14 +252,6 @@ void __cold _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, } #endif -#ifdef CONFIG_BTRFS_ASSERT -void __cold __noreturn...
75258f20fb70ce9e1fa4fa0cb27c0bdee05b2701
Analyze and fix the following issue in the Linux kernel code: btrfs: subpage: dump extra subpage bitmaps for debug
Problem Details: There is a bug report that assert_eb_page_uptodate() gets triggered for free space tree metadata. Without proper dump for the subpage bitmaps it's much harder to debug. Thus this patch would dump all the subpage bitmaps (split them into their own bitmaps) for a easier debugging. The output would loo...
```diff diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 3c7773995d63..87ee376b3cc8 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -4262,8 +4262,9 @@ static void assert_eb_page_uptodate(const struct extent_buffer *eb, return; if (fs_info->nodesize < PAGE_SIZE) { - WARN_ON(!btrfs_s...
85724171b302914bb8999b9df091fd4616a36eb7
Analyze and fix the following issue in the Linux kernel code: btrfs: fix the btrfs_get_global_root return value
Problem Details: btrfs_grab_root returns either the root or NULL, and the callers of btrfs_get_global_root expect it to return the same. But all the more recently added roots instead return an ERR_PTR, so fix this. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst....
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 6e0d4f99ab04..4d347995fcaa 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1183,19 +1183,13 @@ static struct btrfs_root *btrfs_get_global_root(struct btrfs_fs_info *fs_info, if (objectid == BTRFS_CSUM_TREE_OBJECTID) return btrfs_grab_r...
d85512d54e15c3b8f17dbab44b3d41c1d956902a
Analyze and fix the following issue in the Linux kernel code: btrfs: add and fix comments in btrfs_fs_devices
Problem Details: Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
```diff diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 24f30542ef7c..16fc640cabd3 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -330,34 +330,31 @@ struct btrfs_fs_devices { */ struct btrfs_device *latest_dev; - /* all of the devices in the FS, protected by a mutex - * so we can safely ...
8fba13f02c85b90deeba65a398f55d4b43a79595
Analyze and fix the following issue in the Linux kernel code: ASoC: loongson: fix error codes in loongson_card_parse_acpi()
Problem Details: The acpi_node_get_property_reference() function returns kernel error codes and not ACPI error codes. So, although it does not affect the compiled code, using the ACPI_FAILURE() macro is wrong. Secondly, if the is_acpi_device_node() function returns false, then we should return -ENOENT instead of retu...
```diff diff --git a/sound/soc/loongson/loongson_card.c b/sound/soc/loongson/loongson_card.c index 965eaf4e9109..08df05cb4328 100644 --- a/sound/soc/loongson/loongson_card.c +++ b/sound/soc/loongson/loongson_card.c @@ -81,9 +81,9 @@ static int loongson_card_parse_acpi(struct loongson_card_data *data) /* fixup platfor...
2f76e1d6ca524a888d29aafe29f2ad2003857971
Analyze and fix the following issue in the Linux kernel code: ASoC: imx-audmix: check return value of devm_kasprintf()
Problem Details: devm_kasprintf() returns a pointer to dynamically allocated memory. Pointer could be NULL in case allocation fails. Check pointer validity. Identified with coccinelle (kmerr.cocci script). Fixes: b86ef5367761 ("ASoC: fsl: Add Audio Mixer machine driver") Signed-off-by: Claudiu Beznea <claudiu.beznea@m...
```diff diff --git a/sound/soc/fsl/imx-audmix.c b/sound/soc/fsl/imx-audmix.c index c93616e50f4d..0b58df56f4da 100644 --- a/sound/soc/fsl/imx-audmix.c +++ b/sound/soc/fsl/imx-audmix.c @@ -227,6 +227,8 @@ static int imx_audmix_probe(struct platform_device *pdev) dai_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s%...
243984b3b99199678b6ec74787f8fed60c58042d
Analyze and fix the following issue in the Linux kernel code: btrfs: subpage: fix error handling in end_bio_subpage_eb_writepage
Problem Details: Call btrfs_page_clear_uptodate instead of ClearPageUptodate to properly manage the uptodate bit for the subpage case. Reported-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: D...
```diff diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 9827403ce2fb..a75e05c4f496 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -1915,7 +1915,8 @@ static void end_bio_subpage_eb_writepage(struct btrfs_bio *bbio) if (bio->bi_status || test_bit(EXTENT_BUFFER_WRITE_ERR, &eb-...
618d1d7da587b44e60922103ee2dc36949641d4d
Analyze and fix the following issue in the Linux kernel code: btrfs: fix comment referring to no longer existing btrfs_clean_tree_block()
Problem Details: There's a comment at btrfs_init_new_buffer() that refers to a function named btrfs_clean_tree_block(), however the function was renamed to btrfs_clear_buffer_dirty() in commit 190a83391bc4 ("btrfs: rename btrfs_clean_tree_block to btrfs_clear_buffer_dirty"). So update the comment to refer to the curren...
```diff diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 99b9ab5ccf93..5de5b577e7fd 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -4797,7 +4797,7 @@ btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root, !test_bit(BTRFS_ROOT_RESET_LOCKDEP_CLASS, &r...
b9cb105e737f32b9cc18c4f47edabdb0ae66d569
Analyze and fix the following issue in the Linux kernel code: btrfs: scrub: remove more unused functions
Problem Details: These functions are defined in the scrub.c file, but last callers were removed in e9255d6c4054 ("btrfs: scrub: remove the old scrub recheck code"). fs/btrfs/scrub.c:553:20: warning: unused function 'scrub_stripe_index_and_offset'. fs/btrfs/scrub.c:543:19: warning: unused function 'scrub_nr_raid_mirror...
```diff diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 265db0c15a4c..d7a14458c4a7 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -552,48 +552,6 @@ out: btrfs_free_path(path); } -static inline int scrub_nr_raid_mirrors(struct btrfs_io_context *bioc) -{ - if (bioc->map_type & BTRFS_BLOCK_GROUP_RAID5...
b7f9945a1479a97a7aa2cc2b9d36e72f33fcb174
Analyze and fix the following issue in the Linux kernel code: btrfs: handle tree backref walk error properly
Problem Details: [BUG] Smatch reports the following errors related to commit ("btrfs: output affected files when relocation fails"): fs/btrfs/inode.c:283 print_data_reloc_error() error: uninitialized symbol 'ref_level'. [CAUSE] That part of code is mostly copied from scrub, but unfortunately scrub code from the beg...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index da7e5bf2f6db..333736712bd9 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -276,17 +276,25 @@ static void print_data_reloc_error(const struct btrfs_inode *inode, u64 file_off u64 ref_root; u8 ref_level; - do { + while (true) { ret = tr...
f18cc97845aa4ae0e795c088c979fe1642b3b8e5
Analyze and fix the following issue in the Linux kernel code: btrfs: fix dirty_metadata_bytes for redirtied buffers
Problem Details: dirty_metadata_bytes is decremented in both places that clear the dirty bit in a buffer, but only incremented in btrfs_mark_buffer_dirty, which means that a buffer that is redirtied using btrfs_redirty_list_add won't be added to dirty_metadata_bytes, but it will be subtracted when written out, leading ...
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 83518ed71bfd..112c99dde57f 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -4621,7 +4621,6 @@ void btrfs_mark_buffer_dirty(struct extent_buffer *buf) { struct btrfs_fs_info *fs_info = buf->fs_info; u64 transid = btrfs_header_generation(...
a7b4e6c7aa66632d776cf2b991ff2def076e34b8
Analyze and fix the following issue in the Linux kernel code: btrfs: add btrfs_tree_block_status definitions to tree-checker.h
Problem Details: We use this in btrfs-progs to determine if we can fix different types of corruptions. We don't care about this in the kernel, however it would be good to share this code between the kernel and btrfs-progs, so add the status definitions so we can start converting the tree-checker code over to using the...
```diff diff --git a/fs/btrfs/tree-checker.h b/fs/btrfs/tree-checker.h index 48321e8d91bb..78ee2896423d 100644 --- a/fs/btrfs/tree-checker.h +++ b/fs/btrfs/tree-checker.h @@ -40,6 +40,19 @@ struct btrfs_tree_parent_check { u8 level; }; +enum btrfs_tree_block_status { + BTRFS_TREE_BLOCK_CLEAN, + BTRFS_TREE_BLOCK_IN...
b9a9a85059cde9bcc66effe0da9f1b6fb342a700
Analyze and fix the following issue in the Linux kernel code: btrfs: output affected files when relocation fails
Problem Details: [PROBLEM] When relocation fails (mostly due to checksum mismatch), we only got very cryptic error messages like: BTRFS info (device dm-4): relocating block group 13631488 flags data BTRFS warning (device dm-4): csum failed root -9 ino 257 off 0 csum 0x373e1ae3 expected csum 0x98757625 mirror 1 B...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 675b20c4d3c9..da7e5bf2f6db 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -70,6 +70,7 @@ #include "verity.h" #include "super.h" #include "orphan.h" +#include "backref.h" struct btrfs_iget_args { u64 ino; @@ -100,6 +101,18 @@ struct btrfs_re...
1f1ef7e5bbe2de125da413e238915f6047ea4ba2
Analyze and fix the following issue in the Linux kernel code: ASoC: intel: sof_sdw: Fixup typo in device link checking
Problem Details: The loop checking for multiple different devices on a single sdw link contains a typo accidentally using i twice instead of j. Correct to the correct index variable. Fixes: dc5a3e60a4b5 ("ASoC: Intel: sof_sdw: append codec type to dai link name") Signed-off-by: Charles Keepax <ckeepax@opensource.cirru...
```diff diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 6faf4a43eaf5..144f082c63fd 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1347,7 +1347,7 @@ static int sof_card_dai_links_create(struct device *dev, if ((SDW_PART_ID(adr_link->ad...
b67cad33176e472df6d16a24ee7624299bdcd5d5
Analyze and fix the following issue in the Linux kernel code: ARM: dts: BCM5301X: Add cells sizes to PCIe nodes
Problem Details: This fixes: arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: pcie@12000: '#address-cells' is a required property From schema: /lib/python3.10/site-packages/dtschema/schemas/pci/pci-bus.yaml arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: pcie@12000: '#size-cells' is a required property From sc...
```diff diff --git a/arch/arm/boot/dts/bcm-ns.dtsi b/arch/arm/boot/dts/bcm-ns.dtsi index 53472d376a2c..dae9c47ace76 100644 --- a/arch/arm/boot/dts/bcm-ns.dtsi +++ b/arch/arm/boot/dts/bcm-ns.dtsi @@ -176,14 +176,23 @@ pcie0: pcie@12000 { reg = <0x00012000 0x1000>; + + #address-cells = <3>; + #size-cells = <...
413db499730248431c1005b392e8ed82c4fa19bf
Analyze and fix the following issue in the Linux kernel code: mmc: usdhi60rol0: fix deferred probing
Problem Details: The driver overrides the error codes returned by platform_get_irq_byname() to -ENODEV, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating error codes upstream. Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_ge...
```diff diff --git a/drivers/mmc/host/usdhi6rol0.c b/drivers/mmc/host/usdhi6rol0.c index 2f59917b105e..2e17903658fc 100644 --- a/drivers/mmc/host/usdhi6rol0.c +++ b/drivers/mmc/host/usdhi6rol0.c @@ -1757,8 +1757,10 @@ static int usdhi6_probe(struct platform_device *pdev) irq_cd = platform_get_irq_byname(pdev, "card d...
c2df53c5806cfd746dae08e07bc8c4ad247c3b70
Analyze and fix the following issue in the Linux kernel code: mmc: sunxi: fix deferred probing
Problem Details: The driver overrides the error codes and IRQ0 returned by platform_get_irq() to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the error codes upstream. Since commit ce753ad1549c ("platform: finally disallow IR...
```diff diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index 3db9f32d6a7b..69dcb8805e05 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -1350,8 +1350,8 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host, return ret; host->irq = platform_...
5b067d7f855c61df7f8e2e8ccbcee133c282415e
Analyze and fix the following issue in the Linux kernel code: mmc: sh_mmcif: fix deferred probing
Problem Details: The driver overrides the error codes returned by platform_get_irq() to -ENXIO, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the error codes upstream. Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq...
```diff diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 0fd4c9d644dd..5cf53348372a 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c @@ -1400,7 +1400,7 @@ static int sh_mmcif_probe(struct platform_device *pdev) irq[0] = platform_get_irq(pdev, 0); irq[1] = platfo...
8d0caeedcd05a721f3cc2537b0ea212ec4027307
Analyze and fix the following issue in the Linux kernel code: mmc: sdhci-spear: fix deferred probing
Problem Details: The driver overrides the error codes and IRQ0 returned by platform_get_irq() to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the error codes upstream. Since commit ce753ad1549c ("platform: finally disallow IR...
```diff diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c index d463e2fd5b1a..c79035727b20 100644 --- a/drivers/mmc/host/sdhci-spear.c +++ b/drivers/mmc/host/sdhci-spear.c @@ -65,8 +65,8 @@ static int sdhci_probe(struct platform_device *pdev) host->hw_name = "sdhci"; host->ops = &sdhci_pl...
b465dea5e1540c7d7b5211adaf94926980d3014b
Analyze and fix the following issue in the Linux kernel code: mmc: sdhci-acpi: fix deferred probing
Problem Details: The driver overrides the error codes returned by platform_get_irq() to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the error codes upstream. Fixes: 1b7ba57ecc86 ("mmc: sdhci-acpi: Handle return value of plat...
```diff diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index 8f0e639236b1..edf2e6c14dc6 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -829,7 +829,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev) host->ops = &sdhci_acpi_ops_dflt; host->irq...
3c482e1e830d79b9be8afb900a965135c01f7893
Analyze and fix the following issue in the Linux kernel code: mmc: owl: fix deferred probing
Problem Details: The driver overrides the error codes returned by platform_get_irq() to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the error codes upstream. Fixes: ff65ffe46d28 ("mmc: Add Actions Semi Owl SoCs SD/MMC driver...
```diff diff --git a/drivers/mmc/host/owl-mmc.c b/drivers/mmc/host/owl-mmc.c index 6f9d31a886ba..1bf22b08b373 100644 --- a/drivers/mmc/host/owl-mmc.c +++ b/drivers/mmc/host/owl-mmc.c @@ -637,7 +637,7 @@ static int owl_mmc_probe(struct platform_device *pdev) owl_host->irq = platform_get_irq(pdev, 0); if (owl_host-...
fb51b74a57859b707c3e8055ed0c25a7ca4f6a29
Analyze and fix the following issue in the Linux kernel code: mmc: omap_hsmmc: fix deferred probing
Problem Details: The driver overrides the error codes returned by platform_get_irq() to -ENXIO, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the error codes upstream. Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq...
```diff diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 517dde777413..1e0f2d7774bd 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1791,9 +1791,11 @@ static int omap_hsmmc_probe(struct platform_device *pdev) } res = platform_get_resource(pdev, IO...
aedf4ba1ad00aaa94c1b66c73ecaae95e2564b95
Analyze and fix the following issue in the Linux kernel code: mmc: omap: fix deferred probing
Problem Details: The driver overrides the error codes returned by platform_get_irq() to -ENXIO, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the error codes upstream. Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq...
```diff diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index ce78edfb402b..86454f1182bb 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -1343,7 +1343,7 @@ static int mmc_omap_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq < 0) - return -ENXIO; +...
8d84064da0d4672e74f984e8710f27881137472c
Analyze and fix the following issue in the Linux kernel code: mmc: mvsdio: fix deferred probing
Problem Details: The driver overrides the error codes returned by platform_get_irq() to -ENXIO, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the error codes upstream. Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq...
```diff diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c index 629efbe639c4..b4f6a0a2fcb5 100644 --- a/drivers/mmc/host/mvsdio.c +++ b/drivers/mmc/host/mvsdio.c @@ -704,7 +704,7 @@ static int mvsd_probe(struct platform_device *pdev) } irq = platform_get_irq(pdev, 0); if (irq < 0) - return -ENXI...
0c4dc0f054891a2cbde0426b0c0fdf232d89f47f
Analyze and fix the following issue in the Linux kernel code: mmc: mtk-sd: fix deferred probing
Problem Details: The driver overrides the error codes returned by platform_get_irq() to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the error codes upstream. Fixes: 208489032bdd ("mmc: mediatek: Add Mediatek MMC driver") Sig...
```diff diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index edade0e54a0c..9785ec91654f 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -2680,7 +2680,7 @@ static int msdc_drv_probe(struct platform_device *pdev) host->irq = platform_get_irq(pdev, 0); if (host->irq < 0)...
b8ada54fa1b83f3b6480d4cced71354301750153
Analyze and fix the following issue in the Linux kernel code: mmc: meson-gx: fix deferred probing
Problem Details: The driver overrides the error codes and IRQ0 returned by platform_get_irq() to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the error codes upstream. Since commit ce753ad1549c ("platform: finally disallow IR...
```diff diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index f90b0fd8d8b0..ee9a25b900ae 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -1186,8 +1186,8 @@ static int meson_mmc_probe(struct platform_device *pdev) return PTR_ERR(host->regs); hos...
71150ac12558bcd9d75e6e24cf7c872c2efd80f3
Analyze and fix the following issue in the Linux kernel code: mmc: bcm2835: fix deferred probing
Problem Details: The driver overrides the error codes and IRQ0 returned by platform_get_irq() to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the error codes upstream. Since commit ce753ad1549c ("platform: finally disallow IR...
```diff diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c index 8648f7e63ca1..eea208856ce0 100644 --- a/drivers/mmc/host/bcm2835.c +++ b/drivers/mmc/host/bcm2835.c @@ -1403,8 +1403,8 @@ static int bcm2835_probe(struct platform_device *pdev) host->max_clk = clk_get_rate(clk); host->irq = platfor...
f334ad47683606b682b4166b800d8b372d315436
Analyze and fix the following issue in the Linux kernel code: mmc: litex_mmc: set PROBE_PREFER_ASYNCHRONOUS
Problem Details: mmc host drivers should have enabled the asynchronous probe option, but it seems like we didn't set it for litex_mmc when introducing litex mmc support, so let's set it now. Tested with linux-on-litex-vexriscv on sipeed tang nano 20K fpga. Signed-off-by: Jisheng Zhang <jszhang@kernel.org> Acked-by: G...
```diff diff --git a/drivers/mmc/host/litex_mmc.c b/drivers/mmc/host/litex_mmc.c index 39c6707fdfdb..9af6b0902efe 100644 --- a/drivers/mmc/host/litex_mmc.c +++ b/drivers/mmc/host/litex_mmc.c @@ -649,6 +649,7 @@ static struct platform_driver litex_mmc_driver = { .driver = { .name = "litex-mmc", .of_match_table =...
4711c6ab585ea627560a4878917aeaa1178878c2
Analyze and fix the following issue in the Linux kernel code: mmc: mmci: Break out a helper function
Problem Details: These four lines clearing, masking and resetting the state of the busy detect state machine is repeated five times in the code so break this out to a small helper so things are easier to read. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230405-pl180-busyde...
```diff diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 6bd8b367bb8f..8a661ea1a2d1 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -654,6 +654,17 @@ static u32 ux500v2_get_dctrl_cfg(struct mmci_host *host) return MCI_DPSM_ENABLE | (host->data->blksz << 16); } +static void...
ddb5a92da5f32779958303716429d50a46c3177d
Analyze and fix the following issue in the Linux kernel code: mmc: mmci: Use a switch statement machine
Problem Details: As is custom, use a big switch statement to transition between the edges of the state machine inside the ux500 ->busy_complete callback. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230405-pl180-busydetect-fix-v7-8-69a7164f2a61@linaro.org Signed-off-by: Ulf...
```diff diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index f59c6eb5258b..6bd8b367bb8f 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -686,6 +686,12 @@ static bool ux500_busy_complete(struct mmci_host *host, u32 status, u32 err_msk) goto out_ret_state; } + /* + * The stat...
e85fecc386b98db890b869780573b33af49a7a7c
Analyze and fix the following issue in the Linux kernel code: mmc: mmci: Use state machine state as exit condition
Problem Details: Return true if and only if we reached the state MMCI_BUSY_DONE in the ux500 ->busy_complete() callback. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230405-pl180-busydetect-fix-v7-7-69a7164f2a61@linaro.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
```diff diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 4c78783e5e1a..f59c6eb5258b 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -683,7 +683,7 @@ static bool ux500_busy_complete(struct mmci_host *host, u32 status, u32 err_msk) ~host->variant->busy_detect_mask, base...
7892497f1f2d38b786cd80980c9f340988f662b5
Analyze and fix the following issue in the Linux kernel code: mmc: mmci: Retry the busy start condition
Problem Details: This makes the ux500 ->busy_complete() callback re-read the status register 10 times while waiting for the busy signal to assert in the status register. If this does not happen, we bail out regarding the command completed already, i.e. before we managed to start to check the busy status. There is a c...
```diff diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 4ab0c622dff3..4c78783e5e1a 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -674,6 +674,7 @@ static u32 ux500v2_get_dctrl_cfg(struct mmci_host *host) static bool ux500_busy_complete(struct mmci_host *host, u32 status, u32...
7be5ac5f7a4890422920d6d91f94fff5d114d076
Analyze and fix the following issue in the Linux kernel code: mmc: mmci: Make busy complete state machine explicit
Problem Details: This refactors the ->busy_complete() callback currently only used by Ux500 and STM32 to handle busy detection on hardware where one and the same IRQ is fired whether we get a start or an end signal on busy detect. The code is currently using the cached status from the command IRQ in ->busy_status as a...
```diff diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 9f92f39fec14..4ab0c622dff3 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -680,6 +680,7 @@ static bool ux500_busy_complete(struct mmci_host *host, u32 status, u32 err_msk) writel(host->variant->busy_detect_mask, base ...
e1a2485cc367cd0efe6821e2d8deef863c4ba250
Analyze and fix the following issue in the Linux kernel code: mmc: mmci: Break out error check in busy detect
Problem Details: The busy detect callback for Ux500 checks for an error in the status in the first if() clause. The only practical reason is that if an error occurs, the if()-clause is not executed, and the code falls through to the last if()-clause if (host->busy_status) which will clear and disable the irq. Make this...
```diff diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 93981046eb88..9f92f39fec14 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -675,6 +675,15 @@ static bool ux500_busy_complete(struct mmci_host *host, u32 status, u32 err_msk) { void __iomem *base = host->base; + if (s...
8a6a9e79720a51f40835a8a7dc94cf02a58f0600
Analyze and fix the following issue in the Linux kernel code: mmc: mmci: Stash status while waiting for busy
Problem Details: Some interesting flags can arrive while we are waiting for the first busy detect IRQ so OR then onto the stashed flags so they are not missed. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230405-pl180-busydetect-fix-v7-3-69a7164f2a61@linaro.org Signed-off-b...
```diff diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index a3713e9a0ef4..93981046eb88 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -713,6 +713,7 @@ static bool ux500_busy_complete(struct mmci_host *host, u32 status, u32 err_msk) */ if (host->busy_status && (status &...
479d8e61f6244286e629e157ea831e8c4f783826
Analyze and fix the following issue in the Linux kernel code: mmc: mmci: Unwind big if() clause
Problem Details: This does two things: firsr replace the hard-to-read long if-expression: if (!host->busy_status && !(status & err_msk) && (readl(base + MMCISTATUS) & host->variant->busy_detect_flag)) { With the more readable: if (!host->busy_status && !(status & err_msk)) { status = readl(base + MMCI...
```diff diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 267f88d9daec..a3713e9a0ef4 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -654,6 +654,23 @@ static u32 ux500v2_get_dctrl_cfg(struct mmci_host *host) return MCI_DPSM_ENABLE | (host->data->blksz << 16); } +/* + * ux50...
2673493fdfe78a1a8df1f802755cc2448ca98df6
Analyze and fix the following issue in the Linux kernel code: mmc: mmci: Clear busy_status when starting command
Problem Details: If we are starting a command which can generate a busy response, then clear the variable host->busy_status if the variant is using a ->busy_complete callback. We are lucky that the member is zero by default and hopefully always gets cleared in the ->busy_complete callback even on errors, but it's just...
```diff diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index f724bd0d2a61..267f88d9daec 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1238,6 +1238,7 @@ mmci_start_command(struct mmci_host *host, struct mmc_command *cmd, u32 c) c |= host->variant->cmdreg_srsp; } + host->b...
8dcc91c446687727f88997a2e177cdab740ef092
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: stop parsing after allocation failure
Problem Details: The error handling code would break out of the loop incorrectly, causing the rest of the message to be misinterpreted. Fix this by also jumping out of the surrounding while loop, which will trigger the error detection code. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Signed-off-by: Gregory ...
```diff diff --git a/net/wireless/scan.c b/net/wireless/scan.c index df868662e1e0..91671698aaec 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -707,7 +707,7 @@ static int cfg80211_parse_colocated_ap(const struct cfg80211_bss_ies *ies, GFP_ATOMIC); if (!entry) - break; + goto error; ...
1784fbc2ed9c888ea4e895f30a53207ed7ee8208
Analyze and fix the following issue in the Linux kernel code: ovl: port to new mount api
Problem Details: We recently ported util-linux to the new mount api. Now the mount(8) tool will by default use the new mount api. While trying hard to fall back to the old mount api gracefully there are still cases where we run into issues that are difficult to handle nicely. Now with mount(8) and libmount supporting ...
```diff diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index dbd9151dc073..cc389701dd6d 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -16,6 +16,7 @@ #include <linux/posix_acl_xattr.h> #include <linux/exportfs.h> #include <linux/file.h> +#include <linux/fs_context.h> #include <linux/fs_pa...
4251566ebc1cf95ae26a1e5a24cdac1ac25e942f
Analyze and fix the following issue in the Linux kernel code: EDAC/amd64: Cache and use GPU node map
Problem Details: AMD systems have historically provided an "AMD Node ID" that is a unique identifier for each die in a multi-die package. This was associated with a unique instance of the AMD Northbridge on a legacy system. And now it is associated with a unique instance of the AMD Data Fabric on modern systems. Each i...
```diff diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 28155b01f144..c52834db5c98 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -975,6 +975,74 @@ static int sys_addr_to_csrow(struct mem_ctl_info *mci, u64 sys_addr) return csrow; } +/* + * See AMD PPR DF::LclNod...
b07d5cc93e1b28df47a72c519d09d0a836043613
Analyze and fix the following issue in the Linux kernel code: ovl: update of dentry revalidate flags after copy up
Problem Details: After copy up, we may need to update d_flags if upper dentry is on a remote fs and lower dentries are not. Add helpers to allow incremental update of the revalidate flags. Fixes: bccece1ead36 ("ovl: allow remote upper") Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Amir Goldstei...
```diff diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c index f658cc8ea492..95dce240ba17 100644 --- a/fs/overlayfs/copy_up.c +++ b/fs/overlayfs/copy_up.c @@ -575,6 +575,7 @@ static int ovl_link_up(struct ovl_copy_up_ctx *c) /* Restore timestamps on parent (best effort) */ ovl_set_timestamps(ofs, up...
f4e19e595cc2e76a8a58413eb19d3d9c51328b53
Analyze and fix the following issue in the Linux kernel code: ovl: fix null pointer dereference in ovl_get_acl_rcu()
Problem Details: Following process: P1 P2 path_openat link_path_walk may_lookup inode_permission(rcu) ovl_permission acl_permission_check check_acl get_cached_acl_rcu ovl_get_inode_acl realinode = ovl_inode_real(ovl_inode) drop...
```diff diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index ca56b1328a2c..e7e888dea634 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -558,20 +558,20 @@ struct posix_acl *do_ovl_get_acl(struct mnt_idmap *idmap, struct inode *inode, int type, bool rcu, bool noperm) { - struct ino...
1a73f5b8f079fd42a544c1600beface50c63af7c
Analyze and fix the following issue in the Linux kernel code: ovl: fix null pointer dereference in ovl_permission()
Problem Details: Following process: P1 P2 path_lookupat link_path_walk inode_permission ovl_permission ovl_i_path_real(inode, &realpath) path->dentry = ovl_i_dentry_upper(inode) drop_cache __dentry_kill(ovl_dentry) iput(...
```diff diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 541cf3717fc2..ca56b1328a2c 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -288,8 +288,8 @@ int ovl_permission(struct mnt_idmap *idmap, int err; /* Careful in RCU walk mode */ - ovl_i_path_real(inode, &realpath); - if (!realpat...
b2dd05f107b11966e26fe52a313b418364cf497b
Analyze and fix the following issue in the Linux kernel code: ovl: let helper ovl_i_path_real() return the realinode
Problem Details: Let helper ovl_i_path_real() return the realinode to prepare for checking non-null realinode in RCU walking path. [msz] Use d_inode_rcu() since we are depending on the consitency between dentry and inode being non-NULL in an RCU setting. Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-of...
```diff diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h index 4d0b278f5630..7398de332527 100644 --- a/fs/overlayfs/overlayfs.h +++ b/fs/overlayfs/overlayfs.h @@ -382,7 +382,7 @@ enum ovl_path_type ovl_path_type(struct dentry *dentry); void ovl_path_upper(struct dentry *dentry, struct path *path); voi...
065563b20a664a6575dc158688dfb0e121c25b38
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211/nl80211: Add support to indicate STA MLD setup links removal
Problem Details: STA MLD setup links may get removed if AP MLD remove the corresponding affiliated APs with Multi-Link reconfiguration as described in P802.11be_D3.0, section 35.3.6.2.2 Removing affiliated APs. Currently, there is no support to notify such operation to cfg80211 and userspace. Add support for the drive...
```diff diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 9972de114d73..3a736f9286b0 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -9205,4 +9205,17 @@ static inline int cfg80211_color_change_notify(struct net_device *dev) bool cfg80211_valid_disable_subchannel_bitmap(u16 *bitmap,...
dc92e54c30c4bc9d30e674a445dfe1afdca991cf
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: use structs for TBTT information access
Problem Details: Make the data access a bit nicer overall by using structs. There is a small change here to also accept a TBTT information length of eight bytes as we do not require the 20 MHz PSD information. This also fixes a bug reading the short SSID on big endian machines. Signed-off-by: Benjamin Berg <benjamin....
```diff diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 5a27c232afdb..e145af7448a3 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -4483,9 +4483,6 @@ static inline bool for_each_element_completed(const struct element *element, #define IEEE80211_AP_INFO_TBTT_HDR_COUNT ...
ce6e1f600b0cfc563a7d607de702262a58cd835d
Analyze and fix the following issue in the Linux kernel code: wifi: ieee80211: Fix the common size calculation for reconfiguration ML
Problem Details: The common information length is found in the first octet of the common information. Fixes: 0f48b8b88aa9 ("wifi: ieee80211: add definitions for multi-link element") Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org...
```diff diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index aeedd49e5101..97edc3b404dd 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -4617,15 +4617,12 @@ static inline u8 ieee80211_mle_common_size(const u8 *data) case IEEE80211_ML_CONTROL_TYPE_BASIC: case IEEE80211_M...
e8c2af660ba0790afd14d5cbc2fd05c6dc85e207
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: fix regulatory disconnect with OCB/NAN
Problem Details: Since regulatory disconnect was added, OCB and NAN interface types were added, which made it completely unusable for any driver that allowed OCB/NAN. Add OCB/NAN (though NAN doesn't do anything, we don't have any info) and also remove all the logic that opts out, so it won't be broken again if/when new...
```diff diff --git a/include/net/regulatory.h b/include/net/regulatory.h index 896191f420d5..b2cb4a9eb04d 100644 --- a/include/net/regulatory.h +++ b/include/net/regulatory.h @@ -140,17 +140,6 @@ struct regulatory_request { * otherwise initiating radiation is not allowed. This will enable the * relaxation...
b22552fcaf1970360005c805d7fba4046cf2ab4a
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: fix regulatory disconnect for non-MLO
Problem Details: The multi-link loop here broke disconnect when multi-link operation (MLO) isn't active for a given interface, since in that case valid_links is 0 (indicating no links, i.e. no MLO.) Fix this by taking that into account properly and skipping the link only if there are valid_links in the first place. C...
```diff diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 26f11e4746c0..f5ea1f373ab7 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -2352,7 +2352,7 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) if (!wdev->valid_links && link > 0) break; - if (!(wdev->...
39432f8a3752a87a53fd8d5e51824a43aaae5cab
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: drop incorrect nontransmitted BSS update code
Problem Details: The removed code ran for any BSS that was not included in the MBSSID element in order to update it. However, instead of using the correct inheritance rules, it would simply copy the elements from the transmitting AP. The result is that we would report incorrect elements in this case. After some discus...
```diff diff --git a/net/wireless/scan.c b/net/wireless/scan.c index b9eb91f485f8..75e6e032bb3a 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -2312,118 +2312,6 @@ cfg80211_inform_bss_data(struct wiphy *wiphy, } EXPORT_SYMBOL(cfg80211_inform_bss_data); -static void -cfg80211_parse_mbssid_frame_data(s...
dfd9aa3e7a456d57b18021d66472ab7ff8373ab7
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: rewrite merging of inherited elements
Problem Details: The cfg80211_gen_new_ie function merges the IEs using inheritance rules. Rewrite this function to fix issues around inheritance rules. In particular, vendor elements do not require any special handling, as they are either all inherited or overridden by the subprofile. Also, add fragmentation handling a...
```diff diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 2212e6d24204..b9eb91f485f8 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -259,117 +259,152 @@ bool cfg80211_is_element_inherited(const struct element *elem, } EXPORT_SYMBOL(cfg80211_is_element_inherited); -static size_t cfg80211_ge...
c2edd3013266801d9c8595433c6eea462511f872
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: move regulatory_hint_found_beacon to be earlier
Problem Details: These calls do not require any locking, so move them in preparation for the next patches. A minor change/bugfix is to not hint a beacon for nontransmitted BSSes Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kerne...
```diff diff --git a/net/wireless/scan.c b/net/wireless/scan.c index ce2104dc05c6..19e7014f8bc3 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -1971,6 +1971,18 @@ cfg80211_inform_single_bss_data(struct wiphy *wiphy, tmp.pub.max_bssid_indicator = non_tx_data->max_bssid_indicator; } else { ts = jif...
40e38c8dfce1cf543c8bd06e2c1c03a36bc22fe4
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: feed the link_id to cfg80211_ch_switch_started_notify
Problem Details: For now, fix this only in station mode. We'll need to fix the AP mode later. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230616094948.41e662ba1d68.I8faae5acb45c58cfeeb6bc6247aedbdaf9249d32...
```diff diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 171ba9d237c2..1fc66f09cbb8 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1981,8 +1981,9 @@ ieee80211_sta_process_chanswitch(struct ieee80211_link_data *link, IEEE80211_QUEUE_STOP_REASON_CSA); mutex_unlock(&local->mtx); - c...
78a7ea370d5f0eb6f3e774e7f6afece1c3a6860f
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: handle TDLS negotiation with MLO
Problem Details: Userspace can now select the link to use for TDLS management frames (indicating e.g. which BSSID should be used), use the link_id received from cfg80211 to build the frames. Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: ht...
```diff diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index 6575b2801676..a920e2a7a978 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c @@ -39,9 +39,10 @@ void ieee80211_tdls_peer_del_work(struct work_struct *wk) mutex_unlock(&local->mtx); } -static void ieee80211_tdls_add_ext_capab(struct ieee8...
71e7552c90db2a2767f5c17c7ec72296b0d92061
Analyze and fix the following issue in the Linux kernel code: wifi: wext-core: Fix -Wstringop-overflow warning in ioctl_standard_iw_point()
Problem Details: -Wstringop-overflow is legitimately warning us about extra_size pontentially being zero at some point, hence potenially ending up _allocating_ zero bytes of memory for extra pointer and then trying to access such object in a call to copy_from_user(). Fix this by adding a sanity check to ensure we neve...
```diff diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c index a125fd1fa134..a161c64d1765 100644 --- a/net/wireless/wext-core.c +++ b/net/wireless/wext-core.c @@ -815,6 +815,12 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd, } } + /* Sanity-check to ensure we never e...
823a970831c73ca2910da1f5c827c9ce4efa0c02
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: fix max number of fw active links
Problem Details: The max active links that are supported by the FW is hard coded. This is wrong since this value is HW-dependent. Fix this by determining according to the actual HW. Also remove a redundant check that the number of active links doesn't exceeds the maximum. Signed-off-by: Miri Korenblit <miriam.rachel....
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c index 563396dfd3cd..69ebd844de2a 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c @@ -118,24 +118,6 @@ int iwl_mvm_link_changed(struct iwl_mvm ...
6e21e7b8cd897193cee3c2649640efceb3004ba5
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: Remove "Missing iftype sband data/EHT cap" spam
Problem Details: In mesh mode, ieee80211_chandef_he_6ghz_oper() is called by mesh_matches_local() for every received mesh beacon. On a 6 GHz mesh of a HE-only phy, this spams that the hardware does not have EHT capabilities, even if the received mesh beacon does not have an EHT element. Unlike HE, not supporting EHT ...
```diff diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 2fc07717bcad..ab60a530198b 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -3880,10 +3880,8 @@ bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_sub_if_data *sdata, } eht_cap = ieee80211_get_eht_iftype_cap(sband, iftype); - if (...
1902f1953b8ba100ee8705cb8a6f1a9795550eca
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: pcie: fix NULL pointer dereference in iwl_pcie_irq_rx_msix_handler()
Problem Details: rxq can be NULL only when trans_pcie->rxq is NULL and entry->entry is zero. For the case when entry->entry is not equal to 0, rxq won't be NULL even if trans_pcie->rxq is NULL. Modify checker to check for trans_pcie->rxq. Fixes: abc599efa67b ("iwlwifi: pcie: don't crash when rx queues aren't allocated...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c index 4ee4886babcb..da1a27b1d8b6 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c @@ -1636,14 +1636,14 @@ irqreturn_t iwl_pcie_irq_rx_msix_handler(...
33acbe6aa459feb8c765944e2e78a7b0338108e2
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mvm: store WMM params per link
Problem Details: We have the data structure set up to store the parameters per link, but weren't using them. Fix that and store them in the right link. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230614123446.332c...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c index 954ea9ac8e5b..61c1ec46a2fb 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c @@ -470,19 +470,24 @@ void iwl_mvm_set_fw_qos...
df6791e74fe7baafe3c9ec1eabfd45a5b0b62595
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mvm: check link during TX
Problem Details: Again, during some (botched) FW restart scenarios we can end up with a NULL link in the driver but mac80211 thinking all is still going OK. If we try to TX at the same time, we can crash there. Fix that by checking for a NULL link during TX. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signe...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c index c0001ee3d9fd..6f34208a6307 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause ...
38e721009d302f39ad5c744560a3f96ecbae6bfc
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mvm: add a NULL pointer check
Problem Details: We've observed that in some botched firmware restart scenarios when the firmware crashes again while we're reconfiguring, we can hit NULL pointer crashes here. The underlying issue is the botched restart which we need to fix separately, but until we can do that, don't crash hard here. Signed-off-by: J...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c index 059ede6f7b65..954ea9ac8e5b 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: ...