id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
8d38abdf6c182225c5c0a81451fa51b7b36a635d
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7996: fix SER reset trigger on WED reset
Problem Details: The firmware needs a specific trigger when WED is being reset due to an ethernet reset condition. This helps prevent further L1 SER failure. Signed-off-by: Rex Lu <rex.lu@mediatek.com> Link: https://patch.msgid.link/20250311103646.43346-2-nbd@nbd.name Signed-off-by: Felix Fietkau <nbd@nbd.name>
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h index bd1ba00e1bc6..5fdc47dad28c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h @@ -896,7 +896,8 @@ enum { UNI_CMD_SER_SET_RECOVER_...
b4ea6fdfc08375aae59c7e7059653b9877171fe4
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7925: remove unused acpi function for clc
Problem Details: The code for handling ACPI configuration in CLC was copied from the mt7921 driver but is not utilized in the mt7925 implementation. So removes the unused functionality to clean up the codebase. Cc: stable@vger.kernel.org Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 c...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 30f88a9dcded..e61da76b2097 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -3187,7 +3187,6 @@ __mt7925_mcu_set_clc(struct mt7...
276a568832577c81ec90b62dc506bbdc3781ca46
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7925: update the power-saving flow
Problem Details: After joining MLO, ensure that all links are setup before enabling power-saving. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Cc: stable@vger.kernel.org Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Teste...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/init.c b/drivers/net/wireless/mediatek/mt76/mt7925/init.c index f41ca4248497..a2bb36dab231 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/init.c @@ -244,6 +244,7 @@ int mt7925_register_device(st...
cb1353ef34735ec1e5d9efa1fe966f05ff1dc1e1
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7925: integrate *mlo_sta_cmd and *sta_cmd
Problem Details: Integrate *mlo_sta_cmd and *sta_cmd for the MLO firmware. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Cc: stable@vger.kernel.org Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Tested-by: Caleb Jorden <cjo...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index d970243d64ff..17baa653dab1 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -1814,49 +1814,6 @@ mt7925_mcu_sta_mld_tlv(struct ...
0ebb60da8416c1d8e84c7e511a5687ce76a9467a
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7925: adjust rm BSS flow to prevent next connection failure
Problem Details: Removing BSS without removing STAREC first will cause firmware abnormal and next connection fail. Fixes: 816161051a03 ("wifi: mt76: mt7925: Cleanup MLO settings post-disconnection") Cc: stable@vger.kernel.org Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@media...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index dd886b39f550..2f6c687d0a05 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -1155,7 +1155,12 @@ static void mt7925_mac_lin...
7dcea6fe33ee3d7cbb65baee0dd7adc76d1c9ddc
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7925: fix the wrong simultaneous cap for MLO
Problem Details: The mt7925 chip is only support a single radio, so the maximum number of simultaneous should be 0. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Cc: stable@vger.kernel.org Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@m...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index 676882f3928e..dd886b39f550 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -256,7 +256,7 @@ int mt7925_init_mlo_caps(stru...
4bada9b0a29c185d45cc9512509edd6069fbfa79
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7925: fix the wrong link_idx when a p2p_device is present
Problem Details: When the p2p device and MLO station are running concurrently, the p2p device will occupy the wrong link_idx when the MLO secondary link is added. Fixes: 9e4c3a007f01 ("wifi: mt76: connac: Extend mt76_connac_mcu_uni_add_dev for MLO") Cc: stable@vger.kernel.org Co-developed-by: Sean Wang <sean.wang@medi...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index 132148f7b107..05651efb549e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -769,6 +769,7 @@ struct mt76_testmode_data { struct mt76_vif_link { u...
766ea2cf5a398c7eed519b12c6c6cf1631143ea2
Analyze and fix the following issue in the Linux kernel code: Revert "wifi: mt76: mt7925: Update mt7925_mcu_uni_[tx,rx]_ba for MLO"
Problem Details: For MLO, mac80211 will send the BA action for each link to the driver, so the driver does not need to handle it itself. Therefore, revert this patch. Fixes: eb2a9a12c609 ("wifi: mt76: mt7925: Update mt7925_mcu_uni_[tx,rx]_ba for MLO") Cc: stable@vger.kernel.org Signed-off-by: Ming Yen Hsieh <mingyen.h...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index ad47a4b153da..47a6040381a0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -1289,22 +1289,22 @@ mt7925_ampdu_action(struc...
adc3fd2a2277b7cc0b61692463771bf9bd298036
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7921: fix kernel panic due to null pointer dereference
Problem Details: Address a kernel panic caused by a null pointer dereference in the `mt792x_rx_get_wcid` function. The issue arises because the `deflink` structure is not properly initialized with the `sta` context. This patch ensures that the `deflink` structure is correctly linked to the `sta` context, preventing the...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c index 13e58c328aff..78b77a54d195 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c @@ -811,6 +811,7 @@ int mt7921_mac_sta_add(struct...
bf39813599b0375a3eebbbc6837f728554b3883a
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7925: Simplify HIF suspend handling to avoid suspend fail
Problem Details: System suspend failures may occur due to inappropriate handling of traffic not idle event by the WiFi driver. The WiFi firmware's traffic not idle indication does not need to be tied to suspend. Fix the flow to ensuring the system can suspend properly. Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index eee65cf48203..7885d71b7a77 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -348,14 +348,10 @@ mt7925_mcu_handle_hif_ctrl_basi...
4bc1da524b502999da28d287de4286c986a1af57
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: Add check for devm_kstrdup()
Problem Details: Add check for the return value of devm_kstrdup() in mt76_get_of_data_from_mtd() to catch potential exception. Fixes: e7a6a044f9b9 ("mt76: testmode: move mtd part to mt76_dev") Cc: stable@vger.kernel.org Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com> Link: https://patch.msgid.link/20250219033645....
```diff diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c index 0bc66cc19acd..443517d06c9f 100644 --- a/drivers/net/wireless/mediatek/mt76/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/eeprom.c @@ -95,6 +95,10 @@ int mt76_get_of_data_from_mtd(struct mt76_dev *dev...
6458d760a0c0afd2fda11e83ed3e1125a252432f
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7925: fix country count limitation for CLC
Problem Details: Due to the increase in the number of power tables for 6Ghz on CLC, the variable nr_country is no longer sufficient to represent the total quantity. Therefore, we have switched to calculating the length of clc buf to obtain the correct power table. Cc: stable@vger.kernel.org Fixes: c948b5da6bbe ("wifi:...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 4bbbcfd5cdd4..10272af24dd1 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -3164,13 +3164,14 @@ __mt7925_mcu_set_clc(struct m...
8ae45b1f699bbc27ea8647093f794f671e77410b
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7925: ensure wow pattern command align fw format
Problem Details: Align the format of "struct mt7925_wow_pattern_tlv" with firmware to ensure proper functionality. Cc: stable@vger.kernel.org Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips") Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Link: https://patch.msgid.link...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h index 1e47d2c61b54..6bf1623e542e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h @@ -566,8 +566,8 @@ struct mt7925_wow_pattern_tlv { ...
77b749520cac06d000d9923f79ffa632cdea6113
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7915: fix possible integer overflows in mt7915_muru_stats_show()
Problem Details: Assuming sums of values stored in variables such as sub_total_cnt and total_ppdu_cnt are big enough to warrant their u64 type, it makes sense to ensure that their calculation takes into account possible integer overflow issues. Play it safe and fix the problem by casting right hand expressions to u64 ...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c index 578013884e43..4fec7d000a63 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c @@ -303,9 +303,9 @@ static int mt7915...
2d5630b0c9466ac6549495828aa7dce7424a272a
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7925: fix fails to enter low power mode in suspend state
Problem Details: The mt7925 sometimes fails to enter low power mode during suspend. This is caused by the chip firmware sending an additional ACK event to the host after processing the suspend command. Due to timing issues, this event may not reach the host, causing the chip to get stuck. To resolve this, the ACK flag ...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 5f40c3c1ffa1..4bbbcfd5cdd4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -3272,6 +3272,9 @@ int mt7925_mcu_fill_message(str...
b26816b4e3202b837eb772db143d832d8ca255db
Analyze and fix the following issue in the Linux kernel code: iomap: fix inline data on buffered read
Problem Details: Previously, iomap_readpage_iter() returning 0 would break out of the loops of iomap_readahead_iter(), which is what iomap_read_inline_data() relies on. However, commit d9dc477ff6a2 ("iomap: advance the iter directly on buffered read") changes this behavior without calling iomap_iter_advance(), which c...
```diff diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index d52cfdc299c4..814b7f679486 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -372,9 +372,14 @@ static int iomap_readpage_iter(struct iomap_iter *iter, struct iomap_folio_state *ifs; size_t poff, plen; sector_t sector; + i...
d55011469b41d9da6c06cb1c4a4da7a87fe155bc
Analyze and fix the following issue in the Linux kernel code: fuse: fix possible deadlock if rings are never initialized
Problem Details: When mounting a user-space filesystem using io_uring, the initialization of the rings is done separately in the server side. If for some reason (e.g. a server bug) this step is not performed it will be impossible to unmount the filesystem if there are already requests waiting. This issue is easily re...
```diff diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 2c3a4d09e500..51e31df4c546 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -77,7 +77,7 @@ void fuse_set_initialized(struct fuse_conn *fc) static bool fuse_block_alloc(struct fuse_conn *fc, bool for_background) { return !fc->initialized || (for_background &&...
ed336066202c02f0b0e47d0cf08fd8f40a42351f
Analyze and fix the following issue in the Linux kernel code: ASoC: ops: Add control to register value helper
Problem Details: Add a helper function to convert from control values to register values that can replace a lot of the duplicated code in the various put handlers. This also fixes a small issue in snd_soc_put_volsw where the value is converted to a control value before doing the invert, but the invert is done against ...
```diff diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index af4e67817317..888afdd23f84 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -126,6 +126,20 @@ static int soc_mixer_reg_to_ctl(struct soc_mixer_control *mc, unsigned int reg_v return val & mask; } +static unsigned int soc_mixer_ctl_to...
7a24b876ad8cdd56457e881d384a038922b508c3
Analyze and fix the following issue in the Linux kernel code: ASoC: ops-test: Add some basic kunit tests for soc-ops
Problem Details: Add some basic kunit tests for some of the ASoC control put and get helpers. This will assist in doing some refactoring. Note that presently some tests fail, but the rest of the series will fix these up. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20250...
```diff diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig index 5efba76abb31..8b7d51266f81 100644 --- a/sound/soc/Kconfig +++ b/sound/soc/Kconfig @@ -81,6 +81,13 @@ config SND_SOC_UTILS_KUNIT_TEST help If you want to perform tests on ALSA SoC utils library say Y here. +config SND_SOC_OPS_KUNIT_TEST + tristate ...
176fda56d72a267731f82aa4a3aeca430394f10e
Analyze and fix the following issue in the Linux kernel code: spi: Fix reference count leak in slave_show()
Problem Details: Fix a reference count leak in slave_show() by properly putting the device reference obtained from device_find_any_child(). Fixes: 6c364062bfed ("spi: core: Add support for registering SPI slave controllers") Fixes: c21b0837983d ("spi: Use device_find_any_child() instead of custom approach") Signed-off...
```diff diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index a7a4647717d4..ff07c87dbadc 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2954,9 +2954,13 @@ static ssize_t slave_show(struct device *dev, struct device_attribute *attr, struct spi_controller *ctlr = container_of(dev, struct spi_controller, ...
fbc0283fbeae27b88448c90305e738991457fee2
Analyze and fix the following issue in the Linux kernel code: 9p/trans_fd: mark concurrent read and writes to p9_conn->err
Problem Details: Writes for the error value of a connection are spinlock-protected inside p9_conn_cancel, but lockless reads are present elsewhere to avoid performing unnecessary work after an error has been met. Mark the write and lockless reads to make KCSAN happy. Mark the write as exclusive following the recommend...
```diff diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index 2fea50bf047a..339ec4e54778 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -192,12 +192,13 @@ static void p9_conn_cancel(struct p9_conn *m, int err) spin_lock(&m->req_lock); - if (m->err) { + if (READ_ONCE(m->err)) { spin_unlock(&m->req...
d0259a856afca31d699b706ed5e2adf11086c73b
Analyze and fix the following issue in the Linux kernel code: 9p/net: fix improper handling of bogus negative read/write replies
Problem Details: In p9_client_write() and p9_client_read_once(), if the server incorrectly replies with success but a negative write/read count then we would consider written (negative) <= rsize (positive) because both variables were signed. Make variables unsigned to avoid this problem. The reproducer linked below n...
```diff diff --git a/net/9p/client.c b/net/9p/client.c index 09f8ced9f8bb..52a5497cfca7 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -1548,7 +1548,8 @@ p9_client_read_once(struct p9_fid *fid, u64 offset, struct iov_iter *to, struct p9_client *clnt = fid->clnt; struct p9_req_t *req; int count = iov_iter_c...
67a5ba8f742f247bc83e46dd2313c142b1383276
Analyze and fix the following issue in the Linux kernel code: riscv: fgraph: Fix stack layout to match __arch_ftrace_regs argument of ftrace_return_to_handler
Problem Details: Naresh Kamboju reported a "Bad frame pointer" kernel warning while running LTP trace ftrace_stress_test.sh in riscv. We can reproduce the same issue with the following command: ``` $ cd /sys/kernel/debug/tracing $ echo 'f:myprobe do_nanosleep%return args1=$retval' > dynamic_events $ echo 1 > events/fp...
```diff diff --git a/arch/riscv/kernel/mcount.S b/arch/riscv/kernel/mcount.S index 068168046e0e..da4a4000e57e 100644 --- a/arch/riscv/kernel/mcount.S +++ b/arch/riscv/kernel/mcount.S @@ -12,8 +12,6 @@ #include <asm/asm-offsets.h> #include <asm/ftrace.h> -#define ABI_SIZE_ON_STACK 80 - .text .macro SAVE_ABI_ST...
3834a759afb817e23a7a2f09c2c9911b0ce5c588
Analyze and fix the following issue in the Linux kernel code: mmc: omap: Fix memory leak in mmc_omap_new_slot
Problem Details: Add err_free_host label to properly pair mmc_alloc_host() with mmc_free_host() in GPIO error paths. The allocated host memory was leaked when GPIO lookups failed. Fixes: e519f0bb64ef ("ARM/mmc: Convert old mmci-omap to GPIO descriptors") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Cc: stable@vger...
```diff diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 62252ad4e20d..3cdb2fc44965 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -1272,19 +1272,25 @@ static int mmc_omap_new_slot(struct mmc_omap_host *host, int id) /* Check for some optional GPIO controls */ slot->vsd = ...
4676741a3464b300b486e70585c3c9b692be1632
Analyze and fix the following issue in the Linux kernel code: memstick: rtsx_usb_ms: Fix slab-use-after-free in rtsx_usb_ms_drv_remove
Problem Details: This fixes the following crash: ================================================================== BUG: KASAN: slab-use-after-free in rtsx_usb_ms_poll_card+0x159/0x200 [rtsx_usb_ms] Read of size 8 at addr ffff888136335380 by task kworker/6:0/140241 CPU: 6 UID: 0 PID: 140241 Comm: kworker/6:0 Kdump: l...
```diff diff --git a/drivers/memstick/host/rtsx_usb_ms.c b/drivers/memstick/host/rtsx_usb_ms.c index 6eb892fd4d34..3878136227e4 100644 --- a/drivers/memstick/host/rtsx_usb_ms.c +++ b/drivers/memstick/host/rtsx_usb_ms.c @@ -813,6 +813,7 @@ static void rtsx_usb_ms_drv_remove(struct platform_device *pdev) host->eject ...
ede057759b8363e2a0e6b1560ed6e131fbe443bd
Analyze and fix the following issue in the Linux kernel code: mmc: renesas_sdhi: fix error code in renesas_sdhi_probe()
Problem Details: If devm_regulator_register() fails then propagate the error code. Don't return success. Fixes: fae80a99dc03 ("mmc: renesas_sdhi: Add support for RZ/G3E SoC") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <gee...
```diff diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c index 396fa2816a15..fa6526be3638 100644 --- a/drivers/mmc/host/renesas_sdhi_core.c +++ b/drivers/mmc/host/renesas_sdhi_core.c @@ -1178,6 +1178,7 @@ int renesas_sdhi_probe(struct platform_device *pdev, of_node_put(rcfg.of...
49d162635151d0dd04935070d7cf67137ab863aa
Analyze and fix the following issue in the Linux kernel code: mmc: sdhci-omap: Disable MMC_CAP_AGGRESSIVE_PM for eMMC/SD
Problem Details: We have received reports about cards can become corrupt related to the aggressive PM support. Let's make a partial revert of the change that enabled the feature. Reported-by: David Owens <daowens01@gmail.com> Reported-by: Romain Naour <romain.naour@smile.fr> Reported-by: Robert Nelson <robertcnelson@g...
```diff diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index 54d795205fb4..26a9a8b5682a 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -1339,8 +1339,8 @@ static int sdhci_omap_probe(struct platform_device *pdev) /* R1B responses is required to properly ma...
b96dabdba9b95f71ded50a1c094ee244408b2a8e
Analyze and fix the following issue in the Linux kernel code: drm/xe: Fix exporting xe buffers multiple times
Problem Details: The `struct ttm_resource->placement` contains TTM_PL_FLAG_* flags, but it was incorrectly tested for XE_PL_* flags. This caused xe_dma_buf_pin() to always fail when invoked for the second time. Fix this by checking the `mem_type` field instead. Fixes: 7764222d54b7 ("drm/xe: Disallow pinning dma-bufs i...
```diff diff --git a/drivers/gpu/drm/xe/xe_bo.h b/drivers/gpu/drm/xe/xe_bo.h index bda3fdd408da..ec3e4446d027 100644 --- a/drivers/gpu/drm/xe/xe_bo.h +++ b/drivers/gpu/drm/xe/xe_bo.h @@ -405,7 +405,6 @@ long xe_bo_shrink(struct ttm_operation_ctx *ctx, struct ttm_buffer_object *bo, const struct xe_bo_shrink_flags f...
faa6f77b0dfae95b7270084bb2cc7fe30d687761
Analyze and fix the following issue in the Linux kernel code: x86/locking/atomic: Improve performance by using asm_inline() for atomic locking instructions
Problem Details: According to: https://gcc.gnu.org/onlinedocs/gcc/Size-of-an-asm.html the usage of asm pseudo directives in the asm template can confuse the compiler to wrongly estimate the size of the generated code. The LOCK_PREFIX macro expands to several asm pseudo directives, so its usage in atomic locking in...
```diff diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h index 55b4d24356ea..75743f1dfd4e 100644 --- a/arch/x86/include/asm/atomic.h +++ b/arch/x86/include/asm/atomic.h @@ -30,14 +30,14 @@ static __always_inline void arch_atomic_set(atomic_t *v, int i) static __always_inline void arch_atomi...
91d5451d97ce35cbd510277fa3b7abf9caa4e34d
Analyze and fix the following issue in the Linux kernel code: x86/stackprotector/64: Only export __ref_stack_chk_guard on CONFIG_SMP
Problem Details: The __ref_stack_chk_guard symbol doesn't exist on UP: <stdin>:4:15: error: ‘__ref_stack_chk_guard’ undeclared here (not in a function) Fix the #ifdef around the entry.S export. Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Brian Gerst <brgerst@gmail.com> Cc: Ard Biesheuvel <ardb@kernel.org> Cc...
```diff diff --git a/arch/x86/entry/entry.S b/arch/x86/entry/entry.S index 088f91f76edb..d3caa31240ed 100644 --- a/arch/x86/entry/entry.S +++ b/arch/x86/entry/entry.S @@ -64,6 +64,6 @@ THUNK warn_thunk_thunk, __warn_thunk * entirely in the C code, and use an alias emitted by the linker script * instead. */ -#ifde...
3f5dbafc2d4651020f45309ca85120b6a8162fd9
Analyze and fix the following issue in the Linux kernel code: x86/head/64: Avoid Clang < 17 stack protector in startup code
Problem Details: Clang versions before 17 will not honour -fdirect-access-external-data for the load of the stack cookie emitted into each function's prologue and epilogue, and will emit a GOT based reference instead, e.g., 4c 8b 2d 00 00 00 00 mov 0x0(%rip),%r13 18a: R_X86_64_REX_GOTPCRELX __ref...
```diff diff --git a/arch/x86/include/asm/init.h b/arch/x86/include/asm/init.h index 0e82ebc5d1e1..8b1b1abcef15 100644 --- a/arch/x86/include/asm/init.h +++ b/arch/x86/include/asm/init.h @@ -2,7 +2,11 @@ #ifndef _ASM_X86_INIT_H #define _ASM_X86_INIT_H +#if defined(CONFIG_CC_IS_CLANG) && CONFIG_CLANG_VERSION < 17000...
15b7ddcf66fb7ac371279be23b3b6008dad3e36c
Analyze and fix the following issue in the Linux kernel code: x86/cpu/intel: Fix fast string initialization for extended Families
Problem Details: X86_FEATURE_REP_GOOD is a linux defined feature flag to track whether fast string operations should be used for copy_page(). It is also used as a second alternative for clear_page() if enhanced fast string operations (ERMS) are not available. X86_FEATURE_ERMS is an Intel-specific hardware-defined feat...
```diff diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index ae20f450f6e0..2181304dc7d3 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -289,12 +289,19 @@ static void early_init_intel(struct cpuinfo_x86 *c) clear_cpu_cap(c, X86_FEATURE_PAT); /* - * If fast s...
7a2ad752746bfb13e89a83984ecc52a48bae4969
Analyze and fix the following issue in the Linux kernel code: x86/smpboot: Fix INIT delay assignment for extended Intel Families
Problem Details: Some old crusty CPUs need an extra delay that slows down booting. See the comment above 'init_udelay' for details. Newer CPUs don't need the delay. Right now, for Intel, Family 6 and only Family 6 skips the delay. That leaves out both the Family 15 (Pentium 4s) and brand new Family 18/19 models. The ...
```diff diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 5e586f54793b..d6cf1e23c2a3 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -656,9 +656,9 @@ static void __init smp_set_init_udelay(void) return; /* if modern processor, use no delay */ - if (((boot_cpu_data...
337959860dbb02120a029dcd169a26ae596c92ee
Analyze and fix the following issue in the Linux kernel code: x86/acpi/cstate: Improve Intel Family model checks
Problem Details: Update the Intel Family checks to consistently use Family 15 instead of Family 0xF. Also, get rid of one of last usages of x86_model by using the new VFM checks. Update the incorrect comment since the check has changed since the initial commit: ee1ca48fae7e ("ACPI: Disable ARB_DISABLE on platforms ...
```diff diff --git a/arch/x86/include/asm/intel-family.h b/arch/x86/include/asm/intel-family.h index 4296c8e132b9..51ea36656edd 100644 --- a/arch/x86/include/asm/intel-family.h +++ b/arch/x86/include/asm/intel-family.h @@ -187,6 +187,9 @@ #define INTEL_XEON_PHI_KNL IFM(6, 0x57) /* Knights Landing */ #define INTEL_XE...
7e67f3617228318da655dc87bc705f9c5f7bb101
Analyze and fix the following issue in the Linux kernel code: x86/cpu/intel: Fix the MOVSL alignment preference for extended Families
Problem Details: The alignment preference for 32-bit MOVSL based bulk memory move has been 8-byte for a long time. However this preference is only set for Family 6 and 15 processors. Use the same preference for upcoming Family numbers 18 and 19. Also, use a simpler VFM based check instead of switching based on Family ...
```diff diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 291c82816797..99b4c4074827 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -440,23 +440,16 @@ static void intel_workarounds(struct cpuinfo_x86 *c) (c->x86_stepping < 0x6 || c->x86_stepping == 0xb)) ...
680d9b2a56681bc63eb7d2109700536d494b6c8c
Analyze and fix the following issue in the Linux kernel code: x86/apic: Fix 32-bit APIC initialization for extended Intel Families
Problem Details: APIC detection is currently limited to a few specific Families and will not match the upcoming Families >=18. Extend the check to include all Families 6 or greater. Also convert it to a VFM check to make it simpler. Signed-off-by: Sohil Mehta <sohil.mehta@intel.com> Signed-off-by: Ingo Molnar <mingo@...
```diff diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index ddca8da6d468..62584a347931 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -2011,8 +2011,8 @@ static bool __init detect_init_APIC(void) case X86_VENDOR_HYGON: break; case X86_VENDOR_INTEL: - if (bo...
21832247f2df4f636b0f2ae6939819e8dd2ed35f
Analyze and fix the following issue in the Linux kernel code: x86/syscall/x32: Move x32 syscall table
Problem Details: Since commit: 2e958a8a510d ("x86/entry/x32: Rename __x32_compat_sys_* to __x64_compat_sys_*") the ABI prefix for x32 syscalls is the same as native 64-bit syscalls. Move the x32 syscall table to syscall_64.c No functional changes. Signed-off-by: Brian Gerst <brgerst@gmail.com> Signed-off-by: Ing...
```diff diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile index 5fd28abfd5a0..e870f8aa936c 100644 --- a/arch/x86/entry/Makefile +++ b/arch/x86/entry/Makefile @@ -27,4 +27,3 @@ CFLAGS_REMOVE_entry_fred.o += -pg $(CC_FLAGS_FTRACE) obj-$(CONFIG_X86_FRED) += entry_64_fred.o entry_fred.o obj-$(CONFIG_IA32_...
d55f31e29047f2f987286d55928ae75775111fe7
Analyze and fix the following issue in the Linux kernel code: x86/entry: Add __init to ia32_emulation_override_cmdline()
Problem Details: ia32_emulation_override_cmdline() is an early_param() arg and these are only needed at boot time. In fact, all other early_param() functions in arch/x86 seem to have '__init' annotation and ia32_emulation_override_cmdline() is the only exception. Fixes: a11e097504ac ("x86: Make IA32_EMULATION boot tim...
```diff diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c index 14db5b85114c..3514bf2978ee 100644 --- a/arch/x86/entry/common.c +++ b/arch/x86/entry/common.c @@ -142,7 +142,7 @@ static __always_inline int syscall_32_enter(struct pt_regs *regs) #ifdef CONFIG_IA32_EMULATION bool __ia32_enabled __ro_after_i...
7b9b54e23a677efdc76220903afa4262069a5dc7
Analyze and fix the following issue in the Linux kernel code: x86/cpu: Fix the description of X86_MATCH_VFM_STEPS()
Problem Details: The comments needs to reflect an implementation change. No functional change. Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20250311-add-cpu-type-v8-1-e85...
```diff diff --git a/arch/x86/include/asm/cpu_device_id.h b/arch/x86/include/asm/cpu_device_id.h index ba32e0f44cba..9ebc263832ff 100644 --- a/arch/x86/include/asm/cpu_device_id.h +++ b/arch/x86/include/asm/cpu_device_id.h @@ -209,9 +209,11 @@ #define __X86_STEPPINGS(mins, maxs) GENMASK(maxs, mins) /** - * X86_M...
f666c92090a41ac5524dade63ff96b3adcf8c2ab
Analyze and fix the following issue in the Linux kernel code: x86/mm/ident_map: Fix theoretical virtual address overflow to zero
Problem Details: The current calculation of the 'next' virtual address in the page table initialization functions in arch/x86/mm/ident_map.c doesn't protect against wrapping to zero. This is a theoretical issue that cannot happen currently, the problematic case is possible only if the user sets a high enough x86_mappi...
```diff diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c index 5ab7bd2f1983..bd5d101c5c37 100644 --- a/arch/x86/mm/ident_map.c +++ b/arch/x86/mm/ident_map.c @@ -101,9 +101,7 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page, pmd_t *pmd; bool use_gbpage; - next = (addr & ...
4afeb0ed1753ebcad93ee3b45427ce85e9c8ec40
Analyze and fix the following issue in the Linux kernel code: x86/mm: Enable broadcast TLB invalidation for multi-threaded processes
Problem Details: There is not enough room in the 12-bit ASID address space to hand out broadcast ASIDs to every process. Only hand out broadcast ASIDs to processes when they are observed to be simultaneously running on 4 or more CPUs. This also allows single threaded process to continue using the cheaper, local TLB in...
```diff diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h index e6c3be06dd21..7cad283d502d 100644 --- a/arch/x86/include/asm/tlbflush.h +++ b/arch/x86/include/asm/tlbflush.h @@ -280,6 +280,11 @@ static inline void mm_assign_global_asid(struct mm_struct *mm, u16 asid) smp_store_release(&mm...
3178d2b048365fe2c078cd53f85f2abf1487733b
Analyze and fix the following issue in the Linux kernel code: phy: fix xa_alloc_cyclic() error handling
Problem Details: xa_alloc_cyclic() can return 1, which isn't an error. To prevent situation when the caller of this function will treat it as no error do a check only for negative here. Fixes: 384968786909 ("net: phy: Introduce ethernet link topology representation") Signed-off-by: Michal Swiatkowski <michal.swiatkows...
```diff diff --git a/drivers/net/phy/phy_link_topology.c b/drivers/net/phy/phy_link_topology.c index 4a5d73002a1a..0e9e987f37dd 100644 --- a/drivers/net/phy/phy_link_topology.c +++ b/drivers/net/phy/phy_link_topology.c @@ -73,7 +73,7 @@ int phy_link_topo_add_phy(struct net_device *dev, xa_limit_32b, &topo->n...
3614bf90130d60f191a5fe218d04f6251c678e13
Analyze and fix the following issue in the Linux kernel code: dpll: fix xa_alloc_cyclic() error handling
Problem Details: In case of returning 1 from xa_alloc_cyclic() (wrapping) ERR_PTR(1) will be returned, which will cause IS_ERR() to be false. Which can lead to dereference not allocated pointer (pin). Fix it by checking if err is lower than zero. This wasn't found in real usecase, only noticed. Credit to Pierre. Fix...
```diff diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c index 32019dc33cca..1877201d1aa9 100644 --- a/drivers/dpll/dpll_core.c +++ b/drivers/dpll/dpll_core.c @@ -505,7 +505,7 @@ dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct module *module, xa_init_flags(&pin->parent_refs, XA_FLAGS_ALLOC); ret = ...
f3b97b7d4bf316c3991e5634c9f4847c2df35478
Analyze and fix the following issue in the Linux kernel code: devlink: fix xa_alloc_cyclic() error handling
Problem Details: In case of returning 1 from xa_alloc_cyclic() (wrapping) ERR_PTR(1) will be returned, which will cause IS_ERR() to be false. Which can lead to dereference not allocated pointer (rel). Fix it by checking if err is lower than zero. This wasn't found in real usecase, only noticed. Credit to Pierre. Fix...
```diff diff --git a/net/devlink/core.c b/net/devlink/core.c index f49cd83f1955..7203c39532fc 100644 --- a/net/devlink/core.c +++ b/net/devlink/core.c @@ -117,7 +117,7 @@ static struct devlink_rel *devlink_rel_alloc(void) err = xa_alloc_cyclic(&devlink_rels, &rel->index, rel, xa_limit_32b, &next, GFP_KERN...
b73c3ccdca95c237750c981054997c71d33e09d7
Analyze and fix the following issue in the Linux kernel code: MIPS: cm: Fix warning if MIPS_CM is disabled
Problem Details: Commit e27fbe16af5c ("MIPS: cm: Detect CM quirks from device tree") introduced arch/mips/include/asm/mips-cm.h:119:13: error: ‘mips_cm_update_property’ defined but not used [-Werror=unused-function] Fix this by making empty function implementation inline Fixes: e27fbe16af5c ("MIPS: cm: Detect CM qu...
```diff diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h index 3bfe0633b576..407f253bb4a1 100644 --- a/arch/mips/include/asm/mips-cm.h +++ b/arch/mips/include/asm/mips-cm.h @@ -116,7 +116,7 @@ static inline bool mips_cm_present(void) #ifdef CONFIG_MIPS_CM extern void mips_cm_update_prope...
ae2b6c6850561926a2a18c3b725b0917f11bc7e6
Analyze and fix the following issue in the Linux kernel code: MIPS: Fix Macro name
Problem Details: Add missing underscore in PCI_CFGA_BUS macro definition for consistency. Link: https://bugzilla.kernel.org/show_bug.cgi?id=219744 Signed-off-by: Abhishek Tamboli <abhishektamboli9@gmail.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
```diff diff --git a/arch/mips/include/asm/mach-rc32434/pci.h b/arch/mips/include/asm/mach-rc32434/pci.h index 3eb767c8a4ee..e17ce82d02ba 100644 --- a/arch/mips/include/asm/mach-rc32434/pci.h +++ b/arch/mips/include/asm/mach-rc32434/pci.h @@ -167,7 +167,7 @@ struct pci_msu { #define PCI_CFGA_DEV 0x0000f800 #define P...
07c574eb53d4cc9aa7b985bc8bfcb302e5dc4694
Analyze and fix the following issue in the Linux kernel code: netfs: Fix netfs_unbuffered_read() to return ssize_t rather than int
Problem Details: Fix netfs_unbuffered_read() to return an ssize_t rather than an int as netfs_wait_for_read() returns ssize_t and this gets implicitly truncated. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://lore.kernel.org/r/20250314164201.1993231-5-dhowells@redhat.com Acked-by: "Paulo Alcantara (R...
```diff diff --git a/fs/netfs/direct_read.c b/fs/netfs/direct_read.c index 0bf3c2f5a710..5e3f0aeb51f3 100644 --- a/fs/netfs/direct_read.c +++ b/fs/netfs/direct_read.c @@ -125,9 +125,9 @@ static int netfs_dispatch_unbuffered_reads(struct netfs_io_request *rreq) * Perform a read to an application buffer, bypassing the ...
15e9aaf9fc494d1a7280bf1184b4b5830c095209
Analyze and fix the following issue in the Linux kernel code: netfs: Fix rolling_buffer_load_from_ra() to not clear mark bits
Problem Details: rolling_buffer_load_from_ra() looms large in the perf report because it loops around doing an atomic clear for each of the three mark bits per folio. However, this is both inefficient (it would be better to build a mask and atomically AND them out) and unnecessary as they shouldn't be set. Fix this b...
```diff diff --git a/fs/netfs/rolling_buffer.c b/fs/netfs/rolling_buffer.c index 75d97af14b4a..207b6a326651 100644 --- a/fs/netfs/rolling_buffer.c +++ b/fs/netfs/rolling_buffer.c @@ -146,10 +146,6 @@ ssize_t rolling_buffer_load_from_ra(struct rolling_buffer *roll, /* Store the counter after setting the slot. */ s...
344b7ef248f420ed4ba3a3539cb0a0fc18df9a6c
Analyze and fix the following issue in the Linux kernel code: netfs: Call `invalidate_cache` only if implemented
Problem Details: Many filesystems such as NFS and Ceph do not implement the `invalidate_cache` method. On those filesystems, if writing to the cache (`NETFS_WRITE_TO_CACHE`) fails for some reason, the kernel crashes like this: BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor instructi...
```diff diff --git a/fs/netfs/write_collect.c b/fs/netfs/write_collect.c index 294f67795f79..3fca59e6475d 100644 --- a/fs/netfs/write_collect.c +++ b/fs/netfs/write_collect.c @@ -400,7 +400,8 @@ void netfs_write_collection_worker(struct work_struct *work) trace_netfs_rreq(wreq, netfs_rreq_trace_write_done); if (w...
f298e37655288272fad3766b82db0c3c03facbf9
Analyze and fix the following issue in the Linux kernel code: netfs: Fix collection of results during pause when collection offloaded
Problem Details: A netfs read request can run in one of two modes: for synchronous reads writes, the app thread does the collection of results and for asynchronous reads, this is offloaded to a worker thread. This is controlled by the NETFS_RREQ_OFFLOAD_COLLECTION flag. Now, if a subrequest incurs an error, the NETFS...
```diff diff --git a/fs/netfs/read_collect.c b/fs/netfs/read_collect.c index 636cc5a98ef5..23c75755ad4e 100644 --- a/fs/netfs/read_collect.c +++ b/fs/netfs/read_collect.c @@ -682,14 +682,16 @@ void netfs_wait_for_pause(struct netfs_io_request *rreq) trace_netfs_rreq(rreq, netfs_rreq_trace_wait_queue); prepare_to_...
37826f0a8c2f6b6add5179003b8597e32a445362
Analyze and fix the following issue in the Linux kernel code: IB/mad: Check available slots before posting receive WRs
Problem Details: The ib_post_receive_mads() function handles posting receive work requests (WRs) to MAD QPs and is called in two cases: 1) When a MAD port is opened. 2) When a receive WQE is consumed upon receiving a new MAD. Whereas, if MADs arrive during the port open phase, a race condition might cause an extra WR ...
```diff diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index 1fd54d5c4dd8..73f3a0b9a54b 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c @@ -2671,11 +2671,11 @@ static int ib_mad_post_receive_mads(struct ib_mad_qp_info *qp_info, struct ib_mad_private *m...
0c55174524227a174c1a367889cd704212d15b45
Analyze and fix the following issue in the Linux kernel code: RDMA/mana_ib: Fix integer overflow during queue creation
Problem Details: Check queue size during CQ creation for users to prevent overflow of u32. Fixes: bec127e45d9f ("RDMA/mana_ib: create kernel-level CQs") Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com> Link: https://patch.msgid.link/1742312744-14370-1-git-send-email-kotaranov@linux.microsoft.com Reviewed-by...
```diff diff --git a/drivers/infiniband/hw/mana/cq.c b/drivers/infiniband/hw/mana/cq.c index 5c325ef4ac56..0fc4e2679218 100644 --- a/drivers/infiniband/hw/mana/cq.c +++ b/drivers/infiniband/hw/mana/cq.c @@ -39,7 +39,8 @@ int mana_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr, is_rnic_cq = !!(...
d9ecc77193cad25402ff5517fb26fb22b4db0e10
Analyze and fix the following issue in the Linux kernel code: fuse: fix uring race condition for null dereference of fc
Problem Details: There is a race condition leading to a kernel crash from a null dereference when attemping to access fc->lock in fuse_uring_create_queue(). fc may be NULL in the case where another thread is creating the uring in fuse_uring_create() and has set fc->ring but has not yet set ring->fc when fuse_uring_crea...
```diff diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index ebd2931b4f2a..82bf458fa9db 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -208,11 +208,11 @@ static struct fuse_ring *fuse_uring_create(struct fuse_conn *fc) init_waitqueue_head(&ring->stop_waitq); - fc->ring = ring; ring->nr_qu...
0307d16f3610eb29ad0b7529846de7d62fed60ca
Analyze and fix the following issue in the Linux kernel code: afs: Fix afs_atcell_get_link() to check if ws_cell is unset first
Problem Details: Fix afs_atcell_get_link() to check if the workstation cell is unset before doing the RCU pathwalk bit where we dereference that. Fixes: 823869e1e616 ("afs: Fix afs_atcell_get_link() to handle RCU pathwalk") Reported-by: syzbot+76a6f18e3af82e84f264@syzkaller.appspotmail.com Signed-off-by: David Howells...
```diff diff --git a/fs/afs/dynroot.c b/fs/afs/dynroot.c index 008698d706ca..7d997f7a8028 100644 --- a/fs/afs/dynroot.c +++ b/fs/afs/dynroot.c @@ -314,6 +314,9 @@ static const char *afs_atcell_get_link(struct dentry *dentry, struct inode *inod const char *name; bool dotted = vnode->fid.vnode == 3; + if (!rcu_acce...
f42c09e614f1bda96f5690be8d0bb273234febbc
Analyze and fix the following issue in the Linux kernel code: drm/vmwgfx: Fix dumb buffer leak
Problem Details: Dumb buffers were not being freed because the GEM reference that was acquired in gb_surface_define was not dropped like it is in the 2D case. Dropping this ref uncovered a few additional issues with freeing the resources associated with dirty tracking in vmw_bo_free/release. Additionally the TTM objec...
```diff diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c index 8832e4de86f1..6d48aacf6d01 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c @@ -51,11 +51,13 @@ static void vmw_bo_release(struct vmw_bo *vbo) mutex_lock(&res->dev_priv->cmdbuf_...
82ac75237379041db3a63e5d354a58966a69ec84
Analyze and fix the following issue in the Linux kernel code: docs/zh_CN: fix spelling mistake
Problem Details: The word watermark was misspelled as "watemark". Signed-off-by: Peng Jiang <jiang.peng9@zte.com.cn> Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn> Signed-off-by: Alex Shi <alexs@kernel.org> Link: https://lore.kernel.org/r/20250317100811126QvOaWRPxSgm2ttU5faitl@zte.com.cn
```diff diff --git a/Documentation/translations/zh_CN/mm/balance.rst b/Documentation/translations/zh_CN/mm/balance.rst index 6fd79209c307..f877c0cfa39a 100644 --- a/Documentation/translations/zh_CN/mm/balance.rst +++ b/Documentation/translations/zh_CN/mm/balance.rst @@ -64,7 +64,7 @@ kswapd并不真正需要平衡高内存区,因为中断上下文并不请求 如果从...
399e0aae5aab30f911098a0430204e9034ff78bb
Analyze and fix the following issue in the Linux kernel code: xfrm: Remove unnecessary NULL check in xfrm_lookup_with_ifid()
Problem Details: This NULL check is unnecessary and can be removed. It confuses Smatch static analysis tool because it makes Smatch think that xfrm_lookup_with_ifid() can return a mix of NULL pointers and errors so it creates a lot of false positives. Remove it. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org...
```diff diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 6551e588fe52..30970d40a454 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -3294,7 +3294,7 @@ no_transform: ok: xfrm_pols_put(pols, drop_pols); - if (dst && dst->xfrm && + if (dst->xfrm && (dst->xfrm->props.mode ==...
f4edc66e48a694b3e6d164cc71f059de542dfaec
Analyze and fix the following issue in the Linux kernel code: bpf: Only fails the busy counter check in bpf_cgrp_storage_get if it creates storage
Problem Details: The current cgrp storage has a percpu counter, bpf_cgrp_storage_busy, to detect potential deadlock at a spin_lock that the local storage acquires during new storage creation. There are false positives. It turns out to be too noisy in production. For example, a bpf prog may be doing a bpf_cgrp_storage_...
```diff diff --git a/kernel/bpf/bpf_cgrp_storage.c b/kernel/bpf/bpf_cgrp_storage.c index 54ff2a85d4c0..148da8f7ff36 100644 --- a/kernel/bpf/bpf_cgrp_storage.c +++ b/kernel/bpf/bpf_cgrp_storage.c @@ -161,6 +161,7 @@ BPF_CALL_5(bpf_cgrp_storage_get, struct bpf_map *, map, struct cgroup *, cgroup, void *, value, u64,...
223038731489c0ed6bdd3498ad187d4286536ce3
Analyze and fix the following issue in the Linux kernel code: drm/i915: Fix harmful driver register/unregister asymmetry
Problem Details: Starting with commit ec3e00b4ee27 ("drm/i915: stop registering if drm_dev_register() fails"), we return from i915_driver_register() immediately if drm_dev_register() fails, skipping remaining registration steps, and continue only with remaining probe steps. However, the _unregister() counterpart calle...
```diff diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c index 10d1d4f3c11c..cba56cf73b96 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -622,11 +622,12 @@ static void i915_driver_hw_remove(struct drm_i915_private *dev_priv) * Perform an...
4cce01dc3ecdf5fb9ae75723aea7873ef52e4005
Analyze and fix the following issue in the Linux kernel code: drm/i915: Fix PXP cleanup missing from probe error rewind
Problem Details: Commit f67986b0119c04 ("drm/i915/pxp: Promote pxp subsystem to top-level of i915") added PXP initialization to driver probe path, but didn't add a respective PXP cleanup on probe error. That lack of cleanup seems harmless as long as PXP is still unused and idle when a probe failure occurs and error re...
```diff diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c index e0dde7c0fa9c..10d1d4f3c11c 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -845,6 +845,7 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent) return...
2ae485e3d11d34cb70fcfebf149f5f4fce97f089
Analyze and fix the following issue in the Linux kernel code: drm/i915: Downgrade device register error if injected
Problem Details: Commit 8f460e2c78f2 ("drm/i915: Demidlayer driver loading") which introduced manual device registration also added a message that is submitted on device registration failure as an error. If that failure is triggered by error injection test, that's an expected error, but CI still reports it as a bug. ...
```diff diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c index 6507dcfe4bf5..e0dde7c0fa9c 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -635,8 +635,8 @@ static void i915_driver_register(struct drm_i915_private *dev_priv) /* Reveal our...
b6aa4b8b3ebf502898a8164bd7d1aa7d5870c1b9
Analyze and fix the following issue in the Linux kernel code: drm/i915/gt: Fix SPDX license format
Problem Details: Header files need to declare the SPDX under /* ... */ style comments at the beginning of the file. Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com> Reviewed-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com> Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com> Link: https://patchwork.fr...
```diff diff --git a/drivers/gpu/drm/i915/gt/intel_wopcm.h b/drivers/gpu/drm/i915/gt/intel_wopcm.h index 17d6aa86008a..d2038b6de5e7 100644 --- a/drivers/gpu/drm/i915/gt/intel_wopcm.h +++ b/drivers/gpu/drm/i915/gt/intel_wopcm.h @@ -1,6 +1,5 @@ +/* SPDX-License-Identifier: MIT */ /* - * SPDX-License-Identifier: MIT - * ...
18056a48669a040bef491e63b25896561ee14d90
Analyze and fix the following issue in the Linux kernel code: PCI: vmd: Make vmd_dev::cfg_lock a raw_spinlock_t type
Problem Details: The access to the PCI config space via pci_ops::read and pci_ops::write is a low-level hardware access. The functions can be accessed with disabled interrupts even on PREEMPT_RT. The pci_lock is a raw_spinlock_t for this purpose. A spinlock_t becomes a sleeping lock on PREEMPT_RT, so it cannot be acqu...
```diff diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c index 9d9596947350..94ceec50a2b9 100644 --- a/drivers/pci/controller/vmd.c +++ b/drivers/pci/controller/vmd.c @@ -125,7 +125,7 @@ struct vmd_irq_list { struct vmd_dev { struct pci_dev *dev; - spinlock_t cfg_lock; + raw_spinlock_t c...
455943aa187fd93358ccd00c894934061153ec0c
Analyze and fix the following issue in the Linux kernel code: rust: platform: impl Send + Sync for platform::Device
Problem Details: Commit 4d320e30ee04 ("rust: platform: fix unrestricted &mut platform::Device") changed the definition of platform::Device and discarded the implicitly derived Send and Sync traits. This isn't required by upstream code yet, and hence did not cause any issues. However, it is relied on by upcoming driver...
```diff diff --git a/rust/kernel/platform.rs b/rust/kernel/platform.rs index c77c9f2e9aea..2811ca53d8b6 100644 --- a/rust/kernel/platform.rs +++ b/rust/kernel/platform.rs @@ -233,3 +233,10 @@ impl AsRef<device::Device> for Device { unsafe { device::Device::as_ref(dev) } } } + +// SAFETY: A `Device` is al...
e2942bb4e62938fcef1481c9c1470b661087cdb7
Analyze and fix the following issue in the Linux kernel code: rust: pci: impl Send + Sync for pci::Device
Problem Details: Commit 7b948a2af6b5 ("rust: pci: fix unrestricted &mut pci::Device") changed the definition of pci::Device and discarded the implicitly derived Send and Sync traits. This isn't required by upstream code yet, and hence did not cause any issues. However, it is relied on by upcoming drivers, hence add it...
```diff diff --git a/rust/kernel/pci.rs b/rust/kernel/pci.rs index 0ac6cef74f81..0d09ae34a64d 100644 --- a/rust/kernel/pci.rs +++ b/rust/kernel/pci.rs @@ -465,3 +465,10 @@ impl AsRef<device::Device> for Device { unsafe { device::Device::as_ref(dev) } } } + +// SAFETY: A `Device` is always reference-count...
89aaeaf84231157288035b366cb6300c1c6cac64
Analyze and fix the following issue in the Linux kernel code: perf python: Check if there is space to copy all the event
Problem Details: The pyrf_event__new() method copies the event obtained from the perf ring buffer to a structure that will then be turned into a python object for further consumption, so it copies perf_event.header.size bytes to its 'event' member: $ pahole -C pyrf_event /tmp/build/perf-tools-next/python/perf.cpytho...
```diff diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 6a03341e1788..f3c05da25b4a 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -476,6 +476,11 @@ static PyObject *pyrf_event__new(const union perf_event *event) event->header.type == PERF_RECORD_SWITCH_CPU_WIDE)) ...
f3fed3ae34d606819d87a63d970cc3092a5be7ab
Analyze and fix the following issue in the Linux kernel code: perf python: Don't keep a raw_data pointer to consumed ring buffer space
Problem Details: When processing tracepoints the perf python binding was parsing the event before calling perf_mmap__consume(&md->core) in pyrf_evlist__read_on_cpu(). But part of this event parsing was to set the perf_sample->raw_data pointer to the payload of the event, which then could be overwritten by other event ...
```diff diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 31a877a8eb8f..6a03341e1788 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -1019,11 +1019,9 @@ static PyObject *pyrf_evlist__read_on_cpu(struct pyrf_evlist *pevlist, pevent->evsel = evsel; - err = evsel__parse...
3de5a2bf5b4847f7a59a184568f969f8fe05d57f
Analyze and fix the following issue in the Linux kernel code: perf python: Decrement the refcount of just created event on failure
Problem Details: To avoid a leak if we have the python object but then something happens and we need to return the operation, decrement the offset of the newly created object. Fixes: 377f698db12150a1 ("perf python: Add struct evsel into struct pyrf_event") Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Revi...
```diff diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index f9491b669976..31a877a8eb8f 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -1012,6 +1012,7 @@ static PyObject *pyrf_evlist__read_on_cpu(struct pyrf_evlist *pevlist, evsel = evlist__event2evsel(evlist, event); ...
1376c195e8ad327bb9f2d32e0acc5ac39e7cb30a
Analyze and fix the following issue in the Linux kernel code: perf python: Fixup description of sample.id event member
Problem Details: Some old cut'n'paste error, its "ip", so the description should be "event ip", not "event type". Fixes: 877108e42b1b9ba6 ("perf tools: Initial python binding") Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Reviewed-by: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/r/2025031...
```diff diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 69ec2ad60d98..6c5bb5e88939 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -49,7 +49,7 @@ struct pyrf_event { }; #define sample_members \ - sample_member_def(sample_ip, ip, T_ULONGLONG, "event type"), \ + sampl...
ac4e3b09c90480e17939f432da37a5328bad76ab
Analyze and fix the following issue in the Linux kernel code: mips: fix PCI_IOBASE definition
Problem Details: After my previous patch, the ioport_map() function changed from the lib/iomap.c version to the asm-generic/io.h version, which requires a correct PCI_IOBASE definition. Unfortunately the types are also different, so add the correct definition for ioport_map() in asm/io.h and change the machine specifi...
```diff diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 1fe56d1870a6..78c6573f91f2 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -544,12 +544,16 @@ extern void (*_dma_cache_inv)(unsigned long start, unsigned long size); void __ioread64_copy(void *to, const voi...
3d36dd1161ca3158f600d6dbeab8b645e56d1d92
Analyze and fix the following issue in the Linux kernel code: i2c: cadence: Simplify using devm_clk_get_enabled()
Problem Details: Clock handling can be very simplified with using devm_clk_get_enabled() as was done by commit 8d2aaf4382b7 ("gpio: zynq: Simplify using devm_clk_get_enabled()"). And also fix issue in connection to incorrect sequence when err_clk_dis label is called. When reset_control_deassert() fails it jumps to err_...
```diff diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c index b64026fbca66..51dc7728d133 100644 --- a/drivers/i2c/busses/i2c-cadence.c +++ b/drivers/i2c/busses/i2c-cadence.c @@ -1541,7 +1541,7 @@ static int cdns_i2c_probe(struct platform_device *pdev) snprintf(id->adap.name, sizeof(id...
be7113d2e2a6f20cbee99c98d261a1fd6fd7b549
Analyze and fix the following issue in the Linux kernel code: i2c: pxa: fix call balance of i2c->clk handling routines
Problem Details: If the clock i2c->clk was not enabled in i2c_pxa_probe(), it should not be disabled in any path. Found by Linux Verification Center (linuxtesting.org) with Klever. Signed-off-by: Vitalii Mordan <mordan@ispras.ru> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/202502...
```diff diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index cb6988482673..4415a29f749b 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -1503,7 +1503,10 @@ static int i2c_pxa_probe(struct platform_device *dev) i2c->adap.name); } - clk_prepare_enable(i2c...
d60073294cc3b46b73d6de247e0e5ae8684a6241
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Fix incorrect fw_state address in dmub_srv
Problem Details: [WHY] The fw_state in dmub_srv was assigned with wrong address. The address was pointed to the firmware region. [HOW] Fix the firmware state by using DMUB_DEBUG_FW_STATE_OFFSET in dmub_cmd.h. Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Signed-off-by: Lo-an Chen <lo-an.chen@amd.com>...
```diff diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c index 15ea216e903d..6157886f4802 100644 --- a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c @@ -704,7 +704,7 @@ enum dmub_status dmub_srv_hw_init...
acbf16a6ae775b4db86f537448cc466288aa307e
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Use HW lock mgr for PSR1 when only one eDP
Problem Details: [WHY] DMUB locking is important to make sure that registers aren't accessed while in PSR. Previously it was enabled but caused a deadlock in situations with multiple eDP panels. [HOW] Detect if multiple eDP panels are in use to decide whether to use lock. Refactor the function so that the first check...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c index bf636b28e3e1..6e2fce329d73 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c @@ -69,5 +69,16 @@ bool shoul...
35f0f9f421390f66cb062f4d79f4924af5f55b04
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Fix message for support_edp0_on_dp1
Problem Details: [WHY] The info message was wrong when support_edp0_on_dp1 is enabled [HOW] Use correct info message for support_edp0_on_dp1 Fixes: f6d17270d18a ("drm/amd/display: add a quirk to enable eDP0 on DP1") Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Yilin Chen <Yilin.Chen@amd.com...
```diff diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 74ad0d1240fe..39df45f652b3 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1745,7 +1745,7 @@ static void retrieve_dm...
542c3bb836733a1325874310d54d25b4907ed10e
Analyze and fix the following issue in the Linux kernel code: drm/amdkfd: Fix user queue validation on Gfx7/8
Problem Details: To workaround queue full h/w issue on Gfx7/8, when application create AQL queue, the ring buffer bo allocate size is queue_size/2 and map queue_size ring buffer to GPU in 2 pieces using 2 attachments, each attachment map size is queue_size/2, with same ring_bo backing memory. For Gfx7/8, user queue bu...
```diff diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_queue.c b/drivers/gpu/drm/amd/amdkfd/kfd_queue.c index 24396a2c77bd..4afff7094caf 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_queue.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_queue.c @@ -233,6 +233,7 @@ void kfd_queue_buffer_put(struct amdgpu_bo **bo) int kfd_queue_acqui...
35b6162bb790555ad56b7f0d120e307b8334d778
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: Restore uncached behaviour on GFX12
Problem Details: Always use MTYPE_UC if UNCACHED flag is specified. This makes kernarg region uncached and it restores usermode cache disable debug flag functionality. Do not set MTYPE_UC for COHERENT flag, on GFX12 coherence is handled by shader code. Signed-off-by: David Belanger <david.belanger@amd.com> Reviewed-...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c index 0fb88e6d5d54..c3c144a4f45e 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c @@ -501,9 +501,6 @@ static void gmc_v12_0_get_vm_pte(struct amdgpu_device *adev, ui...
86730b5261d4d8dae3f5b97709d40d694ecf1ddf
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/gfx12: correct cleanup of 'me' field with gfx_v12_0_me_fini()
Problem Details: In gfx_v12_0_cp_gfx_load_me_microcode_rs64(), gfx_v12_0_pfp_fini() is incorrectly used to free 'me' field of 'gfx', since gfx_v12_0_pfp_fini() can only release 'pfp' field of 'gfx'. The release function of 'me' field should be gfx_v12_0_me_fini(). Fixes: 52cb80c12e8a ("drm/amdgpu: Add gfx v12_0 ip blo...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c index 2523221a2519..48ff00427882 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c @@ -2437,7 +2437,7 @@ static int gfx_v12_0_cp_gfx_load_me_microcode_rs64(struct amdgpu_de...
424648c3838133f93a34fdfe4f9d5597551e7b3b
Analyze and fix the following issue in the Linux kernel code: drm/amdkfd: Fix instruction hazard in gfx12 trap handler
Problem Details: VALU instructions with SGPR source need wait states to avoid hazard with SALU using different SGPR. v2: Eliminate some hazards to reduce code explosion Signed-off-by: Jay Cornwall <jay.cornwall@amd.com> Reviewed-by: Lancelot Six <lancelot.six@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com...
```diff diff --git a/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h b/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h index 651660958e5b..0320163b6e74 100644 --- a/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h +++ b/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h @@ -3644,7 +3644,7 @@ static const uint32_t cwsr_trap_gfx...
ec33964d9d88488fa954a03d476a8b811efc6e85
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: Fix JPEG video caps max size for navi1x and raven
Problem Details: 8192x8192 is the maximum supported resolution. Signed-off-by: David Rosca <david.rosca@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Ruijing Dong <ruijing.dong@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 6e0d2fde3ae8fdb5b47e103...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c index db68b965257b..95c609317a8d 100644 --- a/drivers/gpu/drm/amd/amdgpu/nv.c +++ b/drivers/gpu/drm/amd/amdgpu/nv.c @@ -83,7 +83,7 @@ static const struct amdgpu_video_codec_info nv_video_codecs_decode_array[] = { {codec_info_build(...
f0105e173103c9d30a2bb959f7399437d536c848
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: Fix MPEG2, MPEG4 and VC1 video caps max size
Problem Details: 1920x1088 is the maximum supported resolution. Signed-off-by: David Rosca <david.rosca@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Ruijing Dong <ruijing.dong@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 1a0807feb97082bff2b1342...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c index 47db483c3516..db68b965257b 100644 --- a/drivers/gpu/drm/amd/amdgpu/nv.c +++ b/drivers/gpu/drm/amd/amdgpu/nv.c @@ -78,10 +78,10 @@ static const struct amdgpu_video_codecs nv_video_codecs_encode = { /* Navi1x */ static const ...
dd8689b52a24807c2d5ce0a17cb26dc87f75235c
Analyze and fix the following issue in the Linux kernel code: drm/radeon: fix uninitialized size issue in radeon_vce_cs_parse()
Problem Details: On the off chance that command stream passed from userspace via ioctl() call to radeon_vce_cs_parse() is weirdly crafted and first command to execute is to encode (case 0x03000001), the function in question will attempt to call radeon_vce_cs_reloc() with size argument that has not been properly initial...
```diff diff --git a/drivers/gpu/drm/radeon/radeon_vce.c b/drivers/gpu/drm/radeon/radeon_vce.c index d1871af967d4..2355a78e1b69 100644 --- a/drivers/gpu/drm/radeon/radeon_vce.c +++ b/drivers/gpu/drm/radeon/radeon_vce.c @@ -557,7 +557,7 @@ int radeon_vce_cs_parse(struct radeon_cs_parser *p) { int session_idx = -1; ...
1a7646d784513dcf0e8b16c1d9124ef54b4ec5e0
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: x1e001de-devkit: fix USB retimer reset polarity
Problem Details: The ps8830 retimer reset is active low. Fix up the retimer nodes which were based on an early version of the driver which inverted the polarity. Fixes: 019e1ee32fec ("arm64: dts: qcom: x1e001de-devkit: Enable external DP support") Cc: Sibi Sankar <quic_sibis@quicinc.com> Signed-off-by: Johan Hovold <...
```diff diff --git a/arch/arm64/boot/dts/qcom/x1e001de-devkit.dts b/arch/arm64/boot/dts/qcom/x1e001de-devkit.dts index b133302bf846..74911861a3bf 100644 --- a/arch/arm64/boot/dts/qcom/x1e001de-devkit.dts +++ b/arch/arm64/boot/dts/qcom/x1e001de-devkit.dts @@ -787,7 +787,7 @@ vddat-supply = <&vreg_rtmr2_1p15>; vddi...
35fec1089ebb5617f85884d3fa6a699ce6337a75
Analyze and fix the following issue in the Linux kernel code: btrfs: zoned: fix zone finishing with missing devices
Problem Details: If do_zone_finish() is called with a filesystem that has missing devices (e.g. a RAID file system mounted in degraded mode) it is accessing the btrfs_device::zone_info pointer, which will not be set if the device in question is missing. Check if the device is present (by checking if it has a valid blo...
```diff diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index 9faf1e097196..fb8b8b29c169 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -2275,6 +2275,9 @@ static int do_zone_finish(struct btrfs_block_group *block_group, bool fully_writ struct btrfs_zoned_device_info *zinfo = device->zone_info; unsigned ...
2bbc4a45e5eb6b868357c1045bf6f38f6ba576e0
Analyze and fix the following issue in the Linux kernel code: btrfs: zoned: fix zone activation with missing devices
Problem Details: If btrfs_zone_activate() is called with a filesystem that has missing devices (e.g. a RAID file system mounted in degraded mode) it is accessing the btrfs_device::zone_info pointer, which will not be set if the device in question is missing. Check if the device is present (by checking if it has a vali...
```diff diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index 4956baf8220a..9faf1e097196 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -2111,6 +2111,9 @@ bool btrfs_zone_activate(struct btrfs_block_group *block_group) physical = map->stripes[i].physical; zinfo = device->zone_info; + if (!device->bde...
9db9c7dd5b4e1d3205137a094805980082c37716
Analyze and fix the following issue in the Linux kernel code: btrfs: don't clobber ret in btrfs_validate_super()
Problem Details: Commit 2a9bb78cfd36 ("btrfs: validate system chunk array at btrfs_validate_super()") introduces a call to validate_sys_chunk_array() in btrfs_validate_super(), which clobbers the value of ret set earlier. This has the effect of negating the validity checks done earlier, making it so btrfs could potenti...
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 1fae31f781d8..1a916716cefe 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2562,6 +2562,9 @@ int btrfs_validate_super(const struct btrfs_fs_info *fs_info, ret = -EINVAL; } + if (ret) + return ret; + ret = validate_sys_chunk_array(...
19e60b2a95f5d6b77d972c7bec35a11e70fd118c
Analyze and fix the following issue in the Linux kernel code: btrfs: add extra warning if delayed iput is added when it's not allowed
Problem Details: Since I have triggered the ASSERT() on the delayed iput too many times, now is the time to add some extra debug warnings for delayed iput. All delayed iputs should be queued after all ordered extents finish their IO and all involved workqueues are flushed. Thus after the btrfs_run_delayed_iputs() ins...
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 03d349edb61b..1fae31f781d8 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -4397,6 +4397,8 @@ void __cold close_ctree(struct btrfs_fs_info *fs_info) /* Ordered extents for free space inodes. */ btrfs_flush_workqueue(fs_info->endio_freesp...
009ca358486ded9b4822eddb924009b6848d7271
Analyze and fix the following issue in the Linux kernel code: btrfs: tests: fix chunk map leak after failure to add it to the tree
Problem Details: If we fail to add the chunk map to the fs mapping tree we exit test_rmap_block() without freeing the chunk map. Fix this by adding a call to btrfs_free_chunk_map() before exiting the test function if the call to btrfs_add_chunk_map() failed. Fixes: 7dc66abb5a47 ("btrfs: use a dedicated data structure ...
```diff diff --git a/fs/btrfs/tests/extent-map-tests.c b/fs/btrfs/tests/extent-map-tests.c index 56e61ac1cc64..609bb6c9c087 100644 --- a/fs/btrfs/tests/extent-map-tests.c +++ b/fs/btrfs/tests/extent-map-tests.c @@ -1045,6 +1045,7 @@ static int test_rmap_block(struct btrfs_fs_info *fs_info, ret = btrfs_add_chunk_map(f...
7cbce3cb4c5cfffd8b08f148e2136afc1ec1ba94
Analyze and fix the following issue in the Linux kernel code: btrfs: explicitly ref count block_group on new_bgs list
Problem Details: All other users of the bg_list list_head increment the refcount when adding to a list and decrement it when deleting from the list. Just for the sake of uniformity and to try to avoid refcounting bugs, do it for this list as well. This does not fix any known ref-counting bug, as the reference belongs ...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index f3a22b660fd3..221df35da49b 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -2801,6 +2801,7 @@ next: spin_lock(&fs_info->unused_bgs_lock); list_del_init(&block_group->bg_list); clear_bit(BLOCK_GROUP_FLAG_NEW, &block_g...
2d8e5168d48a91e7a802d3003e72afb4304bebfa
Analyze and fix the following issue in the Linux kernel code: btrfs: fix block group refcount race in btrfs_create_pending_block_groups()
Problem Details: Block group creation is done in two phases, which results in a slightly unintuitive property: a block group can be allocated/deallocated from after btrfs_make_block_group() adds it to the space_info with btrfs_add_bg_to_space_info(), but before creation is completely completed in btrfs_create_pending_b...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 4975aa5665ae..f3a22b660fd3 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -2797,8 +2797,11 @@ void btrfs_create_pending_block_groups(struct btrfs_trans_handle *trans) /* Already aborted the transaction if it failed. */ n...
df94a342efb451deb0e32b495d1d6cd4bb3a1648
Analyze and fix the following issue in the Linux kernel code: btrfs: run btrfs_error_commit_super() early
Problem Details: [BUG] Even after all the error fixes related the "ASSERT(list_empty(&fs_info->delayed_iputs));" in close_ctree(), I can still hit it reliably with my experimental 2K block size. [CAUSE] In my case, all the error is triggered after the fs is already in error status. I find the following call trace to ...
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 984145147716..03d349edb61b 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -4320,6 +4320,14 @@ void __cold close_ctree(struct btrfs_fs_info *fs_info) /* clear out the rbtree of defraggable inodes */ btrfs_cleanup_defrag_inodes(fs_info); ...
cda76788f8b0f7de3171100e3164ec1ce702292e
Analyze and fix the following issue in the Linux kernel code: btrfs: fix non-empty delayed iputs list on unmount due to async workers
Problem Details: At close_ctree() after we have ran delayed iputs either explicitly through calling btrfs_run_delayed_iputs() or later during the call to btrfs_commit_super() or btrfs_error_commit_super(), we assert that the delayed iputs list is empty. We have (another) race where this assertion might fail because we...
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index b0f125d8efa0..984145147716 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -4340,6 +4340,19 @@ void __cold close_ctree(struct btrfs_fs_info *fs_info) */ btrfs_flush_workqueue(fs_info->delalloc_workers); + /* + * We can have ordered e...
7ca3e84980ef6484a5c6f004aa180b61ce0c37d9
Analyze and fix the following issue in the Linux kernel code: btrfs: reject out-of-band dirty folios during writeback
Problem Details: [OUT-OF-BAND DIRTY FOLIOS] An out-of-band folio means the folio is marked dirty but without notifying the filesystem. This can lead to various problems, not limited to: - No folio::private to track per block status - No proper space reserved for such a dirty folio [HISTORY IN BTRFS] This used to be...
```diff diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 2f1df6e29d4a..822317364065 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -1614,12 +1614,14 @@ static noinline_for_stack int extent_writepage_io(struct btrfs_inode *inode, start + len <= folio_start + folio_size(folio)); ...
530b601b912c42900a37d849b8a3592c8a560432
Analyze and fix the following issue in the Linux kernel code: btrfs: move __btrfs_bio_end_io() code into its single caller
Problem Details: The __btrfs_bio_end_io() helper is trivial and has a single caller, so there's no point in having a dedicated helper function. Further the double underscore prefix in the name is discouraged. So get rid of it and move its code into the caller (btrfs_bio_end_io()). Reviewed-by: Qu Wenruo <wqu@suse.com>...
```diff diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c index bc2555c44a12..94b9ab60bade 100644 --- a/fs/btrfs/bio.c +++ b/fs/btrfs/bio.c @@ -105,18 +105,6 @@ static void btrfs_cleanup_bio(struct btrfs_bio *bbio) bio_put(&bbio->bio); } -static void __btrfs_bio_end_io(struct btrfs_bio *bbio) -{ - if (bbio_has_ordered_...
4c782247b89376a83fa132f7d45d6977edae0629
Analyze and fix the following issue in the Linux kernel code: btrfs: fix non-empty delayed iputs list on unmount due to compressed write workers
Problem Details: At close_ctree() after we have ran delayed iputs either through explicitly calling btrfs_run_delayed_iputs() or later during the call to btrfs_commit_super() or btrfs_error_commit_super(), we assert that the delayed iputs list is empty. When we have compressed writes this assertion may fail because de...
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index d96ea974ef73..b0f125d8efa0 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -4340,6 +4340,18 @@ void __cold close_ctree(struct btrfs_fs_info *fs_info) */ btrfs_flush_workqueue(fs_info->delalloc_workers); + /* + * When finishing a comp...
306a75e647fe0ccb060d5098ee0829e418f01818
Analyze and fix the following issue in the Linux kernel code: btrfs: allow debug builds to accept 2K block size
Problem Details: Currently we only support two block sizes, 4K and PAGE_SIZE. This means on the most common architecture x86_64, we have no way to test subpage block size. And that's exactly I have an aarch64 machine dedicated for subpage tests. But this is still a hurdle for a lot of btrfs developers, and to improv...
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 0cb559448933..d96ea974ef73 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2442,21 +2442,27 @@ int btrfs_validate_super(const struct btrfs_fs_info *fs_info, * Check sectorsize and nodesize first, other check will need it. * Check all ...
23019d3e6617a8ec99a8d2f5947aa3dd8a74a1b8
Analyze and fix the following issue in the Linux kernel code: btrfs: properly limit inline data extent according to block size
Problem Details: Btrfs utilizes inline data extent for the following cases: - Regular small files - Symlinks And "btrfs check" detects any file extents that are too large as an error. It's not a problem for 4K block size, but for the incoming smaller block sizes (2K), it can cause problems due to bad limits: - Non-...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 012ac47351fc..0740a42d393b 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -570,6 +570,10 @@ static bool can_cow_file_range_inline(struct btrfs_inode *inode, if (size > fs_info->sectorsize) return false; + /* We do not allow a non-compressed ...
2ef9d73f2b3b7f9c9c36c2a5bab5f44381867c16
Analyze and fix the following issue in the Linux kernel code: btrfs: remove the subpage related warning message
Problem Details: Since the initial enablement of block size < page size support for btrfs in v5.15, we have hit several milestones for block size < page size (subpage) support: - RAID56 subpage support In v5.19 - Refactored scrub support to support subpage better In v6.4 - Block perfect (previously requires page...
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 52c2335ef62f..0cb559448933 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3410,11 +3410,6 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device */ fs_info->max_inline = min_t(u64, fs_info->max_inline, fs_...
0d31ca6584f21821c708752d379871b9fce2dc48
Analyze and fix the following issue in the Linux kernel code: btrfs: allow buffered write to avoid full page read if it's block aligned
Problem Details: [BUG] Since the support of block size (sector size) < page size for btrfs, test case generic/563 fails with 4K block size and 64K page size: --- tests/generic/563.out 2024-04-25 18:13:45.178550333 +0930 +++ /home/adam/xfstests-dev/results//generic/563.out.bad 2024-09-30 09:09:16.155312379 +0930 ...
```diff diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 0dffff4be5c4..2f1df6e29d4a 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -970,6 +970,10 @@ static int btrfs_do_readpage(struct folio *folio, struct extent_map **em_cached, end_folio_read(folio, true, cur, end - cur + 1); br...
d2da21a6e06c40b9fd380ada93f1b48279e48b16
Analyze and fix the following issue in the Linux kernel code: btrfs: introduce a read path dedicated extent lock helper
Problem Details: Currently we're using btrfs_lock_and_flush_ordered_range() for both btrfs_read_folio() and btrfs_readahead(), but it has one critical problem for future subpage optimizations: - It will call btrfs_start_ordered_extent() to writeback the involved folios But remember we're calling btrfs_lock_and_fl...
```diff diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index bdf75435b5f9..bfc1882ac439 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -1075,6 +1075,184 @@ static int btrfs_do_readpage(struct folio *folio, struct extent_map **em_cached, return 0; } +/* + * Check if we can skip waiting th...