id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
030e86dfdaa789dd2e2e481d7118979a9d1f8f4e
Analyze and fix the following issue in the Linux kernel code: fs: touch up predicts in path lookup
Problem Details: Rationale: - ND_ROOT_PRESET is only set in a condition already marked unlikely - LOOKUP_IS_SCOPED already has unlikely on it, but inconsistently applied - set_root() only fails if there is a bug - most names are not empty (see !*s) - most of the time path_init() does not encounter LOOKUP_CACHED witho...
```diff diff --git a/fs/namei.c b/fs/namei.c index 25cc9680e6dc..a5bffc2a29f6 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -990,8 +990,8 @@ static int complete_walk(struct nameidata *nd) * We don't want to zero nd->root for scoped-lookups or * externally-managed nd->root. */ - if (!(nd->state & ND_ROOT_PRES...
0a4a18e888ae8c8004582f665c5792c84a681668
Analyze and fix the following issue in the Linux kernel code: drm/client: fix MODULE_PARM_DESC string for "active"
Problem Details: The MODULE_PARM_DESC string for the "active" parameter is missing a space and has an extraneous trailing ']' character. Correct these. Before patch: $ modinfo -p ./drm_client_lib.ko active:Choose which drm client to start, default isfbdev] (string) After patch: $ modinfo -p ./drm_client_lib.ko active...
```diff diff --git a/drivers/gpu/drm/clients/drm_client_setup.c b/drivers/gpu/drm/clients/drm_client_setup.c index 72480db1f00d..515aceac22b1 100644 --- a/drivers/gpu/drm/clients/drm_client_setup.c +++ b/drivers/gpu/drm/clients/drm_client_setup.c @@ -13,8 +13,8 @@ static char drm_client_default[16] = CONFIG_DRM_CLIENT...
434959618c47efe9e5f2e20f4a850caac4f6b823
Analyze and fix the following issue in the Linux kernel code: leds: leds-lp50xx: Enable chip before any communication
Problem Details: If a GPIO is used to control the chip's enable pin, it needs to be pulled high before any i2c communication is attempted. Currently, the enable GPIO handling is not correct. Assume the enable GPIO is low when the probe function is entered. In this case the device is in SHUTDOWN mode and does not reac...
```diff diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c index 3a0316be96ed..e2a9c8592953 100644 --- a/drivers/leds/leds-lp50xx.c +++ b/drivers/leds/leds-lp50xx.c @@ -50,6 +50,12 @@ #define LP50XX_SW_RESET 0xff #define LP50XX_CHIP_EN BIT(6) +#define LP50XX_CHIP_DISABLE 0x00 +#define LP50XX_STA...
85f96cbbbc67b59652b2c1ec394b8ddc0ddf1b0b
Analyze and fix the following issue in the Linux kernel code: firmware: stratix10-svc: Add mutex in stratix10 memory management
Problem Details: Add mutex lock to stratix10_svc_allocate_memory and stratix10_svc_free_memory for thread safety. This prevents race conditions and ensures proper synchronization during memory operations. This is required for parallel communication with the Stratix10 service channel. Fixes: 7ca5ce896524f ("firmware: a...
```diff diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c index 5a32c1054bee..9372a17d89b7 100644 --- a/drivers/firmware/stratix10-svc.c +++ b/drivers/firmware/stratix10-svc.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2017-2018, Intel Corporation + * Copyr...
0eff2eaa5322b5b141ff5d5ded26fac4a52b5f7b
Analyze and fix the following issue in the Linux kernel code: virtio-net: fix incorrect flags recording in big mode
Problem Details: The purpose of commit 703eec1b2422 ("virtio_net: fixing XDP for fully checksummed packets handling") is to record the flags in advance, as their value may be overwritten in the XDP case. However, the flags recorded under big mode are incorrect, because in big mode, the passed buf does not point to the ...
```diff diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 8855a994e12b..0369dda5ed60 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -2631,22 +2631,28 @@ static void receive_buf(struct virtnet_info *vi, struct receive_queue *rq, return; } - /* 1. Save the flags early,...
d43358cda7c4696e08880aaa58a7df82e471fa7c
Analyze and fix the following issue in the Linux kernel code: RDMA/restrack: Fix typos in the comments
Problem Details: Fix couple of occurrences of the misspelled word "reource" in the comments with the correct spelling "resource". Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Link: https://patch.msgid.link/20251113105457.879903-1-kalesh-anakkur.purayil@broadcom.com Signed-off-by: Leon Romanovsky <leo...
```diff diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c index a7de6f403fca..b097cfcade1c 100644 --- a/drivers/infiniband/core/restrack.c +++ b/drivers/infiniband/core/restrack.c @@ -175,7 +175,7 @@ void rdma_restrack_new(struct rdma_restrack_entry *res, EXPORT_SYMBOL(rdma_restrack_...
aaecfadc22cca4c7ad381b1df457e8857c01fe14
Analyze and fix the following issue in the Linux kernel code: drm/intel/bmg: Allow device ID usage with single-argument macros
Problem Details: When INTEL_BMG_G21_IDS were added as a subplatform, token concatenation operator usage was omitted, making INTEL_BMG_IDS not usable with single-argument macros. Fix that by adding the missing operator. Fixes: 78de8f876683 ("drm/xe: Handle Wa_22010954014 and Wa_14022085890 as device workarounds") Revie...
```diff diff --git a/include/drm/intel/pciids.h b/include/drm/intel/pciids.h index 6e53fb4cdd37..286e580b2bd6 100644 --- a/include/drm/intel/pciids.h +++ b/include/drm/intel/pciids.h @@ -861,7 +861,7 @@ MACRO__(0xE216, ## __VA_ARGS__) #define INTEL_BMG_IDS(MACRO__, ...) \ - INTEL_BMG_G21_IDS(MACRO__, __VA_ARGS__),...
b84befa3126634d78e31260f538453d534742908
Analyze and fix the following issue in the Linux kernel code: drm/i915/display: Add default case to mipi_exec_send_packet
Problem Details: Add a default case to the switch case statement in mipi_exec_send_packet to prevent attempts to read an uninitialized ret value. It's unlikely the default case will ever occur during regular exeuction, but if more MIPI DSI Processor-to-Peripheral transaction types are ever added, then having this in p...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c index 31edf57a296f..4b815ce6b1fe 100644 --- a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c +++ b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c @@ -171,6 +171,9 @@ static const u8 *mipi_exec_send_packet(struct...
9a9ba098e7ba6b89efaddeabf0716a84a0f54c99
Analyze and fix the following issue in the Linux kernel code: media: i2c: imx219: Replace exposure magic value with named constant
Problem Details: Introduce IMX219_EXPOSURE_OFFSET (4) and use it instead of the literal '4' when computing the maximum coarse exposure. The IMX219 datasheet specifies the maximum storage time as frame_length_lines - 4. (Ref: Datasheet section 5-7-1) Also fix one indentation issue for consistency. Signed-off-by: Taran...
```diff diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index 40693635c0c3..bc55fe2a93b4 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -68,6 +68,7 @@ #define IMX219_EXPOSURE_STEP 1 #define IMX219_EXPOSURE_DEFAULT 0x640 #define IMX219_EXPOSURE_MAX 65535 +#define I...
15ac3d54a8296e027bf176115e36c3cb8c55c8cc
Analyze and fix the following issue in the Linux kernel code: media: i2c: imx214: Rearrange control initialization
Problem Details: Smatch is confused by the control initialization logic. It assumes that there can be a case where imx214->link_freq can be NULL and ctrls_init returns 0. Re-arrange the function to make smatch happy. This patch fixes this smatch error: drivers/media/i2c/imx214.c:1109 imx214_ctrls_init() error: we pre...
```diff diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c index 94ebe625c9e6..d4945b192776 100644 --- a/drivers/media/i2c/imx214.c +++ b/drivers/media/i2c/imx214.c @@ -1014,8 +1014,6 @@ static int imx214_ctrls_init(struct imx214 *imx214) V4L2_CID_LINK_FREQ, imx214->bus_cfg.nr_of_l...
e10d6d961842d1619ca172f11dfb33d1fae46b5b
Analyze and fix the following issue in the Linux kernel code: media: imx-mipi-csis: Move redundant debug print in probe
Problem Details: The number of data lanes is already printed as part of mipi_csis_async_register(), making the first part of this print redundant. Remove the redundant print, and move the debug print for clock frequency to mipi_csis_parse_dt(). Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Laurent Pinchart <la...
```diff diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c index fd399af56e0c..04c586aa9efc 100644 --- a/drivers/media/platform/nxp/imx-mipi-csis.c +++ b/drivers/media/platform/nxp/imx-mipi-csis.c @@ -1481,6 +1481,7 @@ static int mipi_csis_parse_dt(struct mipi_csis_devi...
554f7b8d45e99eb01a498eb6cdd5da4b9ff6e3c3
Analyze and fix the following issue in the Linux kernel code: media: imx335: Rectify name of mode struct
Problem Details: In commit 81495a59baeb ("media: imx335: Fix active area height discrepency") the height for the mode struct was rectified to '1944'. However, the name of mode struct is still reflecting to '1940'. Update it. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Tommaso Merciai <tomm.mer...
```diff diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c index 71ed9a0d84a2..a03efa799023 100644 --- a/drivers/media/i2c/imx335.c +++ b/drivers/media/i2c/imx335.c @@ -252,7 +252,7 @@ static const int imx335_tpg_val[] = { }; /* Sensor mode registers */ -static const struct cci_reg_sequence mode_2...
84c56e1cb378f4996870a67b47ff6f5b63a6d85a
Analyze and fix the following issue in the Linux kernel code: media: ipu-bridge: Add IMX471 to the list of supported sensors
Problem Details: Add the IMX471 sensor, which is used with a SONY471A ACPI HID on the Lenovo ThinkPad X9 15 laptop to the list of supported sensors. Link: https://bugzilla.redhat.com/show_bug.cgi?id=2362064 Signed-off-by: Jimmy Su <jimmy.su@intel.com> Signed-off-by: Hans de Goede <hansg@kernel.org> Signed-off-by: Saka...
```diff diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c index 153b2f3685b4..7fd9d637e63a 100644 --- a/drivers/media/pci/intel/ipu-bridge.c +++ b/drivers/media/pci/intel/ipu-bridge.c @@ -90,6 +90,8 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = { IPU_SENSOR_...
9075ceeadac3e4e4fd906cd84f1ec537442c59be
Analyze and fix the following issue in the Linux kernel code: pwm: th1520: Use module_pwm_platform_driver! macro
Problem Details: The `pwm_th1520` Rust driver calls C functions from the `PWM` namespace, triggering `modpost` warnings due to missing namespace import declarations in its `.modinfo` section. Fix these warnings and simplify the module declaration by switching from the generic `kernel::module_platform_driver!` macro to...
```diff diff --git a/drivers/pwm/pwm_th1520.rs b/drivers/pwm/pwm_th1520.rs index b2d83c121c5c..955c359b07fb 100644 --- a/drivers/pwm/pwm_th1520.rs +++ b/drivers/pwm/pwm_th1520.rs @@ -378,7 +378,7 @@ impl platform::Driver for Th1520PwmPlatformDriver { } } -kernel::module_platform_driver! { +kernel::module_pwm_pl...
26dcb42086d401373b9e09b7f83357e8b9af6b55
Analyze and fix the following issue in the Linux kernel code: pwm: th1520: Fix clippy warning for redundant struct field init
Problem Details: Clippy warns about redundant struct field initialization when the field name and the variable name are the same (e.g., `status: status`). No functional change. Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com> Reviewed-by: Elle Rhumsaa <elle@weathered-steel.dev> Link: https://patch.msgid.li...
```diff diff --git a/drivers/pwm/pwm_th1520.rs b/drivers/pwm/pwm_th1520.rs index ee2a6d573bc2..b2d83c121c5c 100644 --- a/drivers/pwm/pwm_th1520.rs +++ b/drivers/pwm/pwm_th1520.rs @@ -185,7 +185,7 @@ impl pwm::PwmOps for Th1520PwmDriverData { ); Ok(pwm::RoundedWaveform { - status: status, ...
6fe9e919c144f1296d38e2abb10c7ac4320aa7fa
Analyze and fix the following issue in the Linux kernel code: pwm: Fix Rust formatting
Problem Details: We do our best to keep the repository `rustfmt`-clean [1], thus run the tool to fix the formatting issue. A trailing empty comment [2] is added in order to preserve the wanted style for imports (otherwise the tool will compact the first two items). Link: https://rust-for-linux.com/contributing#submit...
```diff diff --git a/drivers/pwm/pwm_th1520.rs b/drivers/pwm/pwm_th1520.rs index 0ad38b78be85..ee2a6d573bc2 100644 --- a/drivers/pwm/pwm_th1520.rs +++ b/drivers/pwm/pwm_th1520.rs @@ -200,7 +200,10 @@ impl pwm::PwmOps for Th1520PwmDriverData { let rate_hz = data.clk.rate().as_hz() as u64; if wfhw.per...
51b4c0f9749d96d56887896383141e97916ac91b
Analyze and fix the following issue in the Linux kernel code: rust: pwm: Fix broken intra-doc link
Problem Details: `rustdoc` reports a broken intra-doc link: error: unresolved link to `Devres::register` --> rust/kernel/pwm.rs:722:11 | 722 | /// via [`Devres::register`]. This ties the lifetime of the PWM chip registration | ^^^^^^^^^^^^^^^^ no item named `Devres` in scope ...
```diff diff --git a/rust/kernel/pwm.rs b/rust/kernel/pwm.rs index b19661b83b0f..e6d1278d8316 100644 --- a/rust/kernel/pwm.rs +++ b/rust/kernel/pwm.rs @@ -660,7 +660,7 @@ unsafe impl<T: PwmOps + Sync> Sync for Chip<T> {} /// A resource guard that ensures `pwmchip_remove` is called on drop. /// /// This struct is int...
dd6ff5cf56fb183fce605ca6a5bfce228cd8888b
Analyze and fix the following issue in the Linux kernel code: rust: io: add typedef for phys_addr_t
Problem Details: The C typedef phys_addr_t is missing an analogue in Rust, meaning that we end up using bindings::phys_addr_t or ResourceSize as a replacement in various places throughout the kernel. Fix that by introducing a new typedef on the Rust side. Place it next to the existing ResourceSize typedef since they're...
```diff diff --git a/rust/kernel/devres.rs b/rust/kernel/devres.rs index 10a6a1789854..e01e0d36702d 100644 --- a/rust/kernel/devres.rs +++ b/rust/kernel/devres.rs @@ -52,8 +52,20 @@ struct Inner<T: Send> { /// # Examples /// /// ```no_run -/// # use kernel::{bindings, device::{Bound, Device}, devres::Devres, io::{Io...
919b72922717e396be9435c83916b9969505bd23
Analyze and fix the following issue in the Linux kernel code: rust: io: define ResourceSize as resource_size_t
Problem Details: These typedefs are always equivalent so this should not change anything, but the code makes a lot more sense like this. Cc: stable@vger.kernel.org Signed-off-by: Alice Ryhl <aliceryhl@google.com> Fixes: 493fc33ec252 ("rust: io: add resource abstraction") Link: https://patch.msgid.link/20251112-resourc...
```diff diff --git a/rust/kernel/io/resource.rs b/rust/kernel/io/resource.rs index 81220493a7f3..e294af96b374 100644 --- a/rust/kernel/io/resource.rs +++ b/rust/kernel/io/resource.rs @@ -20,7 +20,7 @@ use crate::{ /// /// This is a type alias to either `u32` or `u64` depending on the config option /// `CONFIG_PHYS_A...
4341dd24abb983eb6218bfc4ab0366de98873e00
Analyze and fix the following issue in the Linux kernel code: drm/i915/ltphy: include intel_display_utils.h instead of i915_utils.h
Problem Details: Display code stopped using i915_utils.h in favour of intel_display_utils.h. Fix recent additions. Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20251112181342.107911-1-jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
```diff diff --git a/drivers/gpu/drm/i915/display/intel_lt_phy.c b/drivers/gpu/drm/i915/display/intel_lt_phy.c index bebd7488aab9..a67eb4f7f897 100644 --- a/drivers/gpu/drm/i915/display/intel_lt_phy.c +++ b/drivers/gpu/drm/i915/display/intel_lt_phy.c @@ -6,7 +6,6 @@ #include <drm/drm_print.h> #include "i915_reg.h" ...
0330b7fbbf313b35470306a492b9e7a703b5af56
Analyze and fix the following issue in the Linux kernel code: drivers/xen/xenbus: Fix namespace collision and split() section placement with AutoFDO
Problem Details: When compiling the kernel with -ffunction-sections enabled, the split() function gets compiled into the .text.split section. In some cases it can even be cloned into .text.split.constprop.0 or .text.split.isra.0. However, .text.split.* is already reserved for use by the Clang -fsplit-machine-function...
```diff diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index 528682bf0c7f..f794014814be 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c @@ -410,7 +410,7 @@ static char *join(const char *dir, const char *name) return (!buffer) ? ERR_PTR(-ENOMEM) : buffer; ...
56255fa96871d3bd0d924a53585cdf5594262891
Analyze and fix the following issue in the Linux kernel code: media: atomisp: Fix namespace collision and startup() section placement with -ffunction-sections
Problem Details: When compiling the kernel with -ffunction-sections (e.g., for LTO, livepatch, dead code elimination, AutoFDO, or Propeller), the startup() function gets compiled into the .text.startup section. In some cases it can even be cloned into .text.startup.constprop.0 or .text.startup.isra.0. However, the .t...
```diff diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c index c7de7800799a..a4519babf37d 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c @@ -600,7 +600,7 @@ static int ov2722_s_p...
f6a8919d61484ae9ca6b1855035fcfb2ba6e2af9
Analyze and fix the following issue in the Linux kernel code: vmlinux.lds: Fix TEXT_MAIN to include .text.start and friends
Problem Details: Since: 6568f14cb5ae ("vmlinux.lds: Exclude .text.startup and .text.exit from TEXT_MAIN") the TEXT_MAIN macro uses a series of patterns to prevent the .text.startup[.*] and .text.exit[.*] sections from getting linked into the vmlinux runtime .text. That commit is a tad too aggressive: it also inadv...
```diff diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index cc060adfdc75..8f92d665cb0f 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -90,8 +90,9 @@ * Support -ffunction-sections by matching .text and .text.*, * but exclude '.text..*', ...
3813d28b2b12dea8f44a6828b9c30b38208d3fc5
Analyze and fix the following issue in the Linux kernel code: scsi: scsi_debug: Fix uninitialized pointers with __free attr
Problem Details: Uninitialized pointers with '__free' attribute can cause undefined behaviour as the memory assigned(randomly) to the pointer is freed automatically when the pointer goes out of scope scsi doesn't have any bugs related to this as of now, but it is better to initialize and assign pointers with '__free' ...
```diff diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 7291b7a7f1b0..92b2af803d87 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -2961,11 +2961,11 @@ static int resp_mode_sense(struct scsi_cmnd *scp, int target_dev_id; int target = scp->device->id; unsigned cha...
18987143d4b1945a1bfcb3963ae1961ca29b27dd
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: core: Remove an unnecessary NULL pointer check
Problem Details: The !payload check tests the address of a member of a data structure. We know that the start address of this data structure (job) is not NULL since the 'job' pointer has already been dereferenced. Hence, the !payload check is superfluous. Remove this test. This was reported by the CodeSonar static anal...
```diff diff --git a/drivers/ufs/core/ufs_bsg.c b/drivers/ufs/core/ufs_bsg.c index 252186124669..58b506eac6dc 100644 --- a/drivers/ufs/core/ufs_bsg.c +++ b/drivers/ufs/core/ufs_bsg.c @@ -105,7 +105,7 @@ static int ufs_bsg_exec_advanced_rpmb_req(struct ufs_hba *hba, struct bsg_job *j if (dir != DMA_NONE) { payloa...
acd194d9b5bac419e04968ffa44351afabb50bac
Analyze and fix the following issue in the Linux kernel code: scsi: sim710: Fix resource leak by adding missing ioport_unmap() calls
Problem Details: The driver calls ioport_map() to map I/O ports in sim710_probe_common() but never calls ioport_unmap() to release the mapping. This causes resource leaks in both the error path when request_irq() fails and in the normal device removal path via sim710_device_remove(). Add ioport_unmap() calls in the ou...
```diff diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c index e519df68d603..70c75ab1453a 100644 --- a/drivers/scsi/sim710.c +++ b/drivers/scsi/sim710.c @@ -133,6 +133,7 @@ static int sim710_probe_common(struct device *dev, unsigned long base_addr, out_put_host: scsi_host_put(host); out_release: + iopor...
f6ab594672d4cba08540919a4e6be2e202b60007
Analyze and fix the following issue in the Linux kernel code: scsi: aic94xx: fix use-after-free in device removal path
Problem Details: The asd_pci_remove() function fails to synchronize with pending tasklets before freeing the asd_ha structure, leading to a potential use-after-free vulnerability. When a device removal is triggered (via hot-unplug or module unload), race condition can occur. The fix adds tasklet_kill() before freeing...
```diff diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c index adf3d9145606..95f3620059f7 100644 --- a/drivers/scsi/aic94xx/aic94xx_init.c +++ b/drivers/scsi/aic94xx/aic94xx_init.c @@ -882,6 +882,9 @@ static void asd_pci_remove(struct pci_dev *dev) asd_disable_ints(asd_ha); +...
1dd7e743dd37361c8c1ac89355a8da738e2b81fb
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: phy: fix out-of-bounds access in rtw89_phy_read_txpwr_limit()
Problem Details: Coverity reported a potential out-of-bounds access when 'bw' exceeds the valid range for the specified band. Add a helper `rtw89_bw_is_valid()` to check bandwidth validity for each band before accessing limit tables. Addresses-Coverity-ID: 1598844 ("Out-of-bounds access") Addresses-Coverity-ID: 159889...
```diff diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c index 23892c1359a5..28e2b15240a7 100644 --- a/drivers/net/wireless/realtek/rtw89/phy.c +++ b/drivers/net/wireless/realtek/rtw89/phy.c @@ -2376,6 +2376,21 @@ static u8 rtw89_channel_to_idx(struct rtw89_dev *rtwdev, u...
7bf433c6767ffe2ad5b7ac8680c6e93e7d0be3e4
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: debug: add parser to diagnose along DIAG_MAC fw element
Problem Details: The rules to diagnose MAC have a common header, and a cmd field is used to know the exact command and its format. The rules with the same tuple of fields {sheet, seq} can be seen as a set of compound rules, which treat it as positive rule if just one of the rules is positive. Take EQUALV rules as exam...
```diff diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c index 3dc7981c510f..1264c2f82600 100644 --- a/drivers/net/wireless/realtek/rtw89/debug.c +++ b/drivers/net/wireless/realtek/rtw89/debug.c @@ -87,6 +87,7 @@ struct rtw89_debugfs { struct rtw89_debugfs_priv disa...
dae8d7d63b740d8f5972b8438b139a6488e0f9fa
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: pci: add to read PCI configuration space from common code
Problem Details: Normally only access PCI device in pci.c. However for debug purpose, a set of registers predefined in firmware element including PCI configuration space should be read for diagnosis. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20251111022452.28093-2-pkshih@realtek.c...
```diff diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h index 71eb7078a0dc..e6584462f6c0 100644 --- a/drivers/net/wireless/realtek/rtw89/core.h +++ b/drivers/net/wireless/realtek/rtw89/core.h @@ -39,6 +39,8 @@ extern const struct ieee80211_ops rtw89_ops; #define RFREG...
823576c894d73255d35c0d0dabbb6ffecf1f2667
Analyze and fix the following issue in the Linux kernel code: PCI/ASPM: Avoid L0s and L1 on PA Semi [1959:a002] Root Ports
Problem Details: Christian reported that f3ac2ff14834 ("PCI/ASPM: Enable all ClockPM and ASPM states for devicetree platforms") broke booting on the A-EON AmigaOne X1000. Override the L0s and L1 Support advertised in Link Capabilities by the X1000 Root Ports ([1959:a002]) so we don't try to enable those states. Fixes...
```diff diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index b94264cd3833..90f6abdb77f4 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2524,6 +2524,7 @@ static void quirk_disable_aspm_l0s_l1(struct pci_dev *dev) */ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ASMEDIA, 0x1080, quirk_disable_aspm...
5b40a5080c39933e7ce28bcb63cd4c1818d6c873
Analyze and fix the following issue in the Linux kernel code: PCI/ASPM: Avoid L0s and L1 on Freescale [1957:0451] Root Ports
Problem Details: Christian reported that f3ac2ff14834 ("PCI/ASPM: Enable all ClockPM and ASPM states for devicetree platforms") broke booting on the A-EON X5000. Override the L0s and L1 Support advertised in Link Capabilities by the X5000 Root Ports ([1957:0451]) so we don't try to enable those states. Fixes: f3ac2ff...
```diff diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 922c77c627a1..b94264cd3833 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2523,6 +2523,7 @@ static void quirk_disable_aspm_l0s_l1(struct pci_dev *dev) * disable both L0s and L1 for now to be safe. */ DECLARE_PCI_FIXUP_HEADER(P...
360b3730f8eab6c4467c6cca4cb0e30902174a63
Analyze and fix the following issue in the Linux kernel code: ASoC: rsnd: fix OF node reference leak in rsnd_ssiu_probe()
Problem Details: rsnd_ssiu_probe() leaks an OF node reference obtained by rsnd_ssiu_of_node(). The node reference is acquired but never released across all return paths. Fix it by declaring the device node with the __free(device_node) cleanup construct to ensure automatic release when the variable goes out of scope. ...
```diff diff --git a/sound/soc/renesas/rcar/ssiu.c b/sound/soc/renesas/rcar/ssiu.c index faf351126d57..244fb833292a 100644 --- a/sound/soc/renesas/rcar/ssiu.c +++ b/sound/soc/renesas/rcar/ssiu.c @@ -509,7 +509,7 @@ void rsnd_parse_connect_ssiu(struct rsnd_dai *rdai, int rsnd_ssiu_probe(struct rsnd_priv *priv) { str...
091719c21d5aa0d461496de3e120cd864c5750a0
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: target: Fix invalid memory access with big CDBs
Problem Details: struct atio7_fcp_cmnd is a variable-length data structure because of add_cdb_len, but it is embedded in struct atio_from_isp and copied around like a fixed-length data structure. For big CDBs > 16 bytes, get_datalen_for_atio() called on a fixed-length copy of the atio will access invalid memory. In s...
```diff diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 009b9ca5c2b9..7b0da89ea347 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -210,6 +210,10 @@ static void qlt_queue_unknown_atio(scsi_qla_host_t *vha, struct qla_tgt_sess_op *u; ...
3d56983cc6f03aef05ab30f8cd16039c1db3c5e0
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Fix TMR failure handling
Problem Details: (target mode) If handle_tmr() fails: - The code for QLA_TGT_ABTS results in memory-use-after-free and double-free: qlt_do_tmr_work() qlt_build_abts_resp_iocb() qpair->req->outstanding_cmds[h] = (srb_t *)mcmd; mempool_free(mcmd, qla_tgt_mgmt_cmd_mempool); FIRST FREE qlt_handle_abts_comple...
```diff diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index f0e02ad83ac0..34ee7a179a79 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1893,7 +1893,7 @@ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res) * Currently, only ABTS response gets on t...
5c50d84798eb2d05fa86f923ec869934d04e6f31
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: target: Improve checks in qlt_xmit_response() / qlt_rdy_to_xfer()
Problem Details: Similar fixes to both functions: qlt_xmit_response: - If the cmd cannot be processed, remember to call ->free_cmd() to prevent the target-mode midlevel from seeing a cmd lockup. - Do not try to send the response if the exchange has been terminated. - Check for chip reset once after lock inste...
```diff diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index c6dc5e9efb69..849ab256807b 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -3206,12 +3206,7 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, uint32_t full_req_cnt ...
17488f1390749af61152ca4012b754ac3edcb42b
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: target: Fix races with aborting commands
Problem Details: cmd->cmd_lock only protects cmd->aborted, but when deciding how to process a cmd, it is necessary to consider other factors such as cmd->state and if the chip has been reset, which are protected by qpair->qp_lock_ptr. So replace cmd_lock with qp_lock_ptr, whick makes it possible to check additional va...
```diff diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index fd32b30a5b38..f0e02ad83ac0 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -7248,6 +7248,7 @@ qla2xxx_wake_dpc(struct scsi_qla_host *vha) if (!test_bit(UNLOADING, &vha->dpc_flags) && t) wake_u...
d46c69a087aa3d1513f7a78f871b80251ea0c1ae
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Clear cmds after chip reset
Problem Details: Commit aefed3e5548f ("scsi: qla2xxx: target: Fix offline port handling and host reset handling") caused two problems: 1. Commands sent to FW, after chip reset got stuck and never freed as FW is not going to respond to them anymore. 2. BUG_ON(cmd->sg_mapped) in qlt_free_cmd(). Commit 26f9ce53817a ...
```diff diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 848ee6c88311..fd32b30a5b38 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1875,10 +1875,26 @@ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res) continue; } cmd = (struct qla...
044b9f1a7f4f3d41563007d0762c83a7d7505ac0
Analyze and fix the following issue in the Linux kernel code: PCI/PTM: Enable only if device advertises relevant role
Problem Details: We have a Switch Upstream Port (2b:00.0) that has a PTM Capability, but doesn't advertise support for any PTM roles: Capabilities: [220 v1] Precision Time Measurement PTMCap: Requester- Responder- Root- Linux enables PTM without looking into what roles it actually supports, and appa...
```diff diff --git a/drivers/pci/pcie/ptm.c b/drivers/pci/pcie/ptm.c index 65e4b008be00..ed0f9691e7d1 100644 --- a/drivers/pci/pcie/ptm.c +++ b/drivers/pci/pcie/ptm.c @@ -81,6 +81,11 @@ void pci_ptm_init(struct pci_dev *dev) dev->ptm_granularity = 0; } + if (cap & PCI_PTM_CAP_RES) + dev->ptm_responder = 1; + if...
ed382b95f5de9b98668b3d00c7adddfdd4fc5c31
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: target: Fix term exchange when cmd_sent_to_fw == 1
Problem Details: Properly set the nport_handle field of the terminate exchange message. Previously when this field was not set properly, the term exchange would fail when cmd_sent_to_fw == 1 but work when cmd_sent_to_fw == 0 (i.e. it would fail when the HW was actively transferring data or status for the cmd but work w...
```diff diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 72c74f8f5375..b700bfc642b3 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -3622,14 +3622,35 @@ static int __qlt_send_term_exchange(struct qla_qpair *qpair, struct qla_tgt_cmd *cm...
c34e373f535e74d3caf1c0d81b6819deb52d37ed
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: target: Improve debug output for term exchange
Problem Details: Print better debug info when terminating a command, and print the response status from the hardware. Signed-off-by: Tony Battersby <tonyb@cybernetics.com> Link: https://patch.msgid.link/22f8a0b6-0e24-474d-9f28-9d65c9b7af03@cybernetics.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
```diff diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 5136549005e7..ff4124eccc9c 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c @@ -54,7 +54,7 @@ * | Misc | 0xd303 | 0xd031-0xd0ff | * | ...
957aa5974989fba4ae4f807ebcb27f12796edd4d
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Use reinit_completion on mbx_intr_comp
Problem Details: If a mailbox command completes immediately after wait_for_completion_timeout() times out, ha->mbx_intr_comp could be left in an inconsistent state, causing the next mailbox command not to wait for the hardware. Fix by reinitializing the completion before use. Signed-off-by: Tony Battersby <tonyb@cybe...
```diff diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 32eb0ce8b170..1f01576f044b 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -253,6 +253,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) /* Issue set host interrupt command t...
4f6aaade2a22ac428fa99ed716cf2b87e79c9837
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Fix lost interrupts with qlini_mode=disabled
Problem Details: When qla2xxx is loaded with qlini_mode=disabled, ha->flags.disable_msix_handshake is used before it is set, resulting in the wrong interrupt handler being used on certain HBAs (qla2xxx_msix_rsp_q_hs() is used when qla2xxx_msix_rsp_q() should be used). The only difference between these two interrupt ha...
```diff diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index cb95b7b12051..b3265952c4be 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -3503,7 +3503,6 @@ struct isp_operations { #define QLA_MSIX_RSP_Q 0x01 #define QLA_ATIO_VECTOR 0x02 #define QLA_...
8f58fc64d559b5fda1b0a5e2a71422be61e79ab9
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Fix initiator mode with qlini_mode=exclusive
Problem Details: When given the module parameter qlini_mode=exclusive, qla2xxx in initiator mode is initially unable to successfully send SCSI commands to devices it finds while scanning, resulting in an escalating series of resets until an adapter reset clears the issue. Fix by checking the active mode instead of the...
```diff diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index fb8292d3f358..848ee6c88311 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -3438,13 +3438,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ha->mqenable = 0; if (h...
b57fbc88715b6d18f379463f48a15b560b087ffe
Analyze and fix the following issue in the Linux kernel code: scsi: Revert "scsi: qla2xxx: Perform lockless command completion in abort path"
Problem Details: This reverts commit 0367076b0817d5c75dfb83001ce7ce5c64d803a9. The commit being reverted added code to __qla2x00_abort_all_cmds() to call sp->done() without holding a spinlock. But unlike the older code below it, this new code failed to check sp->cmd_type and just assumed TYPE_SRB, which results in a ...
```diff diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 5ffd94586652..fb8292d3f358 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1862,12 +1862,6 @@ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res) for (cnt = 1; cnt < req->num_outstanding_cmd...
6b74d0a5e259d268312259c83d1a61744fbc9306
Analyze and fix the following issue in the Linux kernel code: drm/xe/guc: Eliminate RPa frequency caching
Problem Details: Remove the cached pc->rpa_freq field and refactor RPA frequency handling to fetch values directly from hardware registers on each request. v2: Check graphics version instead of platform (Rodrigo) v3: Fix graphics version check (Badal) Suggested-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Suggested-by: ...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c index 4c48115f1795..951a49fb1d3e 100644 --- a/drivers/gpu/drm/xe/xe_guc_pc.c +++ b/drivers/gpu/drm/xe/xe_guc_pc.c @@ -363,7 +363,7 @@ static int pc_set_max_freq(struct xe_guc_pc *pc, u32 freq) freq); } -static void mtl_updat...
581ca490353ca5f4bee0d662595af27c06e603d4
Analyze and fix the following issue in the Linux kernel code: scsi: scsi_debug: Abort SCSI commands via an internal command
Problem Details: Add a .queue_reserved_command() implementation and call it from the code path that aborts SCSI commands. This ensures that the code for allocating a pseudo SCSI device and also the code for allocating and processing reserved commands gets triggered while running blktests. Most of the code in this patc...
```diff diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index b2ab97be5db3..7291b7a7f1b0 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -6752,20 +6752,59 @@ static bool scsi_debug_stop_cmnd(struct scsi_cmnd *cmnd) return false; } +struct sdebug_abort_cmd { + u32 unique...
214291cbaaceeb28debd773336642b1fca393ae0
Analyze and fix the following issue in the Linux kernel code: acpi/hmat: Fix lockdep warning for hmem_register_resource()
Problem Details: The following lockdep splat was observed while kernel auto-online a CXL memory region: ====================================================== WARNING: possible circular locking dependency detected 6.17.0djtest+ #53 Tainted: G W ------------------------------------------------------ systemd-udev...
```diff diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c index 5a36d57289b4..11e4483685c9 100644 --- a/drivers/acpi/numa/hmat.c +++ b/drivers/acpi/numa/hmat.c @@ -874,10 +874,32 @@ static void hmat_register_target_devices(struct memory_target *target) } } -static void hmat_register_target(struct me...
fd0ae4754c7b2add72338b14ddc8c8ff5ffda426
Analyze and fix the following issue in the Linux kernel code: blk-zoned: Fix a typo in a source code comment
Problem Details: Remove a superfluous parenthesis that was introduced by commit fa8555630b32 ("blk-zoned: Improve the queue reference count strategy documentation"). Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Bart ...
```diff diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 3791755bc6ad..57ab2b365c2d 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -730,7 +730,7 @@ static inline void blk_zone_wplug_bio_io_error(struct blk_zone_wplug *zwplug, bio_clear_flag(bio, BIO_ZONE_WRITE_PLUGGING); bio_io_error(bio); disk...
593ee49222a0d751062fd9a5e4a963ade4ec028a
Analyze and fix the following issue in the Linux kernel code: ACPI: property: Fix fwnode refcount leak in acpi_fwnode_graph_parse_endpoint()
Problem Details: acpi_fwnode_graph_parse_endpoint() calls fwnode_get_parent() to obtain the parent fwnode but returns without calling fwnode_handle_put() on it. This potentially leads to a fwnode refcount leak and prevents the parent node from being released properly. Call fwnode_handle_put() on the parent fwnode befo...
```diff diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index 73171d277ab6..57a9c18ec673 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -1718,6 +1718,7 @@ static int acpi_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode, if (fwnode_property_read_u32(fwnode, "reg", &...
76934e495cdc31942b53b513cee4290750578a9a
Analyze and fix the following issue in the Linux kernel code: cpuidle: Add sanity check for exit latency and target residency
Problem Details: Make __cpuidle_driver_init() fail if the exit latency of one of the driver's idle states is less than its target residency which would break cpuidle assumptions. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Reviewed-by: ...
```diff diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c index 9bbfa594c442..1c295a93d582 100644 --- a/drivers/cpuidle/driver.c +++ b/drivers/cpuidle/driver.c @@ -152,7 +152,7 @@ static void cpuidle_setup_broadcast_timer(void *arg) * __cpuidle_driver_init - initialize the driver's internal data * @d...
c55a8e24cd129b6d8fed20e3d63c10c2263e2fc8
Analyze and fix the following issue in the Linux kernel code: hwmon: (gpd-fan) initialize EC on driver load for Win 4
Problem Details: The original implement will re-init the EC when it reports a zero value, and it's a workaround for the black box buggy firmware. Now a contributer test and report that, the bug is that, the firmware won't initialize the EC on boot, so the EC ramains in unusable status. And it won't need to re-init it ...
```diff diff --git a/drivers/hwmon/gpd-fan.c b/drivers/hwmon/gpd-fan.c index 48c84e3e9939..f81c3bc422f4 100644 --- a/drivers/hwmon/gpd-fan.c +++ b/drivers/hwmon/gpd-fan.c @@ -276,31 +276,6 @@ static int gpd_generic_read_rpm(void) return (u16)high << 8 | low; } -static void gpd_win4_init_ec(void) -{ - u8 chip_id, c...
9efb297c520f392ab04bc45544a03770c98c3798
Analyze and fix the following issue in the Linux kernel code: hwmon: (gpd-fan) Fix compilation error in non-ACPI builds
Problem Details: Building gpd-fan driver without CONFIG_ACPI results in the following build errors: drivers/hwmon/gpd-fan.c: In function ‘gpd_ecram_read’: drivers/hwmon/gpd-fan.c:228:9: error: implicit declaration of function ‘outb’ [-Werror=implicit-function-declaration] 228 | outb(0x2E, addr_port); |...
```diff diff --git a/drivers/hwmon/gpd-fan.c b/drivers/hwmon/gpd-fan.c index 321794807e8d..48c84e3e9939 100644 --- a/drivers/hwmon/gpd-fan.c +++ b/drivers/hwmon/gpd-fan.c @@ -12,9 +12,9 @@ * Copyright (c) 2024 Cryolitia PukNgae */ -#include <linux/acpi.h> #include <linux/dmi.h> #include <linux/hwmon.h> +#includ...
3249e8a17e62eefef096ec3818efbb91debbf9c7
Analyze and fix the following issue in the Linux kernel code: bpf: Adjust return value for queue destruction in rqspinlock
Problem Details: Return -ETIMEDOUT whenever non-head waiters are signalled by head, and fix oversight in commit 7bd6e5ce5be6 ("rqspinlock: Disable queue destruction for deadlocks"). We no longer signal on deadlocks. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Reviewed-by: Amery Hung <ameryhung@gmail.com>...
```diff diff --git a/kernel/bpf/rqspinlock.c b/kernel/bpf/rqspinlock.c index b94e258bf2b9..3cc23d79a9fc 100644 --- a/kernel/bpf/rqspinlock.c +++ b/kernel/bpf/rqspinlock.c @@ -537,7 +537,7 @@ queue: val = arch_mcs_spin_lock_contended(&node->locked); if (val == RES_TIMEOUT_VAL) { - ret = -EDEADLK; + ret = -ET...
b305fbdad4ed7e66b5b3f76b15f71d05fa6af212
Analyze and fix the following issue in the Linux kernel code: can: bxcan: Fix a typo error for assign
Problem Details: Fix the spelling error of "assign". Signed-off-by: Chu Guangqing <chuguangqing@inspur.com> Reviewed-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Link: https://patch.msgid.link/20251103074009.4708-1-chuguangqing@inspur.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
```diff diff --git a/drivers/net/can/bxcan.c b/drivers/net/can/bxcan.c index 0b579e7bb3b6..baf494d20bef 100644 --- a/drivers/net/can/bxcan.c +++ b/drivers/net/can/bxcan.c @@ -227,7 +227,7 @@ static void bxcan_enable_filters(struct bxcan_priv *priv, enum bxcan_cfg cfg) * mask mode with 32 bits width. */ - /* Ent...
c902835fc6eb7e13dbffc404210eed59293425c8
Analyze and fix the following issue in the Linux kernel code: can: mcp251xfd: add workaround for errata 5
Problem Details: According to Errata DS80000789E 5 writing IOCON register using one SPI write command clears LAT0/LAT1. Errata Fix/Work Around suggests to write registers with single byte write instructions. However, it seems that every write to the second byte causes the overwrite of LAT0/LAT1. Never write byte 2 of...
```diff diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c index e61cbd209955..70d5ff0ae7ac 100644 --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c @@ -13,9 +13,9 @@ static const struct regmap_con...
a0b8c6af29a4be3ca2ff9a95cf71e54db5d73e65
Analyze and fix the following issue in the Linux kernel code: lib/xxhash: remove more unused xxh functions
Problem Details: xxh32_reset() and xxh32_copy_state() are unused, and with those gone, the xxh32_state struct is also unused. xxh64_copy_state() is also unused. Remove them all. (Also fixes a comment above the xxh64_state that referred to it as xxh32_state). Link: https://lkml.kernel.org/r/20251024205120.454508-1-l...
```diff diff --git a/include/linux/xxhash.h b/include/linux/xxhash.h index 27f57eca8cb1..587122e2c29c 100644 --- a/include/linux/xxhash.h +++ b/include/linux/xxhash.h @@ -141,21 +141,7 @@ static inline unsigned long xxhash(const void *input, size_t length, */ /** - * struct xxh32_state - private xxh32 state, do no...
6c2e6e2c1af1809d1d9cdbd50ac80f54f5995bdb
Analyze and fix the following issue in the Linux kernel code: dynamic_debug: add support for print stack
Problem Details: In practical problem diagnosis, especially during the boot phase, it is often desirable to know the call sequence. However, currently, apart from adding print statements and recompiling the kernel, there seems to be no good alternative. If dynamic_debug supported printing the call stack, it would be ...
```diff diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index 7c036590cd07..095a63892257 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -223,12 +223,13 @@ The flags are:: f ...
a2b1c419ff72ec62ff5831684e30cd1d4f0b09ee
Analyze and fix the following issue in the Linux kernel code: ocfs2: add inline inode consistency check to ocfs2_validate_inode_block()
Problem Details: In 'ocfs2_validate_inode_block()', add an extra check whether an inode with inline data (i.e. self-contained) has no clusters, thus preventing an invalid inode from being passed to 'ocfs2_evict_inode()' and below. Link: https://lkml.kernel.org/r/20251023141650.417129-1-dmantipov@yandex.ru Signed-off-...
```diff diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index dc4044a565b5..dbc38a212c8f 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -1505,6 +1505,14 @@ int ocfs2_validate_inode_block(struct super_block *sb, goto bail; } + if ((le16_to_cpu(di->i_dyn_features) & OCFS2_INLINE_DATA_FL) && + le32_to...
c9dff86eb78a4b6b02b1e407993c946ccaf9bfb4
Analyze and fix the following issue in the Linux kernel code: ocfs2: use correct endian in ocfs2_dinode_has_extents
Problem Details: Fields in ocfs2_dinode is little endian, covert to host endian when checking those contents. Link: https://lkml.kernel.org/r/20251025123218.3997866-1-joseph.qi@linux.alibaba.com Fixes: fdbb6cd96ed5 ("ocfs2: correct l_next_free_rec in online check") Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com...
```diff diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index fcc89856ab95..0a0a96054bfe 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -201,13 +201,15 @@ bail: static int ocfs2_dinode_has_extents(struct ocfs2_dinode *di) { /* inodes flagged with other stuff in id2 */ - if (di->i_flags & (OCFS2_SUPER_BLOC...
390ac56cf0f687de53695648bc6f2259a7eae429
Analyze and fix the following issue in the Linux kernel code: ocfs2: add boundary check to ocfs2_check_dir_entry()
Problem Details: In 'ocfs2_check_dir_entry()', add extra check whether at least the smallest possible dirent may be located at the specified offset within bh's data, thus preventing an out-of-bounds accesses below. Link: https://lkml.kernel.org/r/20251013062826.122586-1-dmantipov@yandex.ru Signed-off-by: Dmitry Antipo...
```diff diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index dc3d66263335..2785ff245e79 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -302,8 +302,21 @@ static int ocfs2_check_dir_entry(struct inode *dir, unsigned long offset) { const char *error_msg = NULL; - const int rlen = le16_to_cpu(de->rec_len); - co...
032a730268a3e88a1df1df1bafd9af64a460822e
Analyze and fix the following issue in the Linux kernel code: init/main.c: wrap long kernel cmdline when printing to logs
Problem Details: The kernel cmdline length is allowed to be longer than what printk can handle. When this happens the cmdline that's printed to the kernel ring buffer at bootup is cutoff and some kernel cmdline options are "hidden" from the logs. This undercuts the usefulness of the log message. Specifically, greppi...
```diff diff --git a/init/Kconfig b/init/Kconfig index cab3ad28ca49..56a5dec1fdfc 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1512,6 +1512,24 @@ config BOOT_CONFIG_EMBED_FILE This bootconfig will be used if there is no initrd or no other bootconfig in the initrd. +config CMDLINE_LOG_WRAP_IDEAL_LEN + int ...
aa5b6a72ccd9fad2d2ed875631f6aca6b0633d80
Analyze and fix the following issue in the Linux kernel code: ocfs2: add directory size check to ocfs2_find_dir_space_id()
Problem Details: Fix a null-pointer-deref which was detected by UBSAN: KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] CPU: 0 UID: 0 PID: 5317 Comm: syz-executor310 Not tainted 6.15.0-syzkaller-12141-gec7714e49479 #0 PREEMPT(full) In 'ocfs2_find_dir_space_id()', add extra check whether the dir...
```diff diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 0fcaa0e90747..dc3d66263335 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -3431,6 +3431,14 @@ static int ocfs2_find_dir_space_id(struct inode *dir, struct buffer_head *di_bh, offset += le16_to_cpu(de->rec_len); } + if (!last_de) { + ret = ocfs2_err...
adc15829fb73e402903b7030729263b6ee4a7232
Analyze and fix the following issue in the Linux kernel code: crash: let architecture decide crash memory export to iomem_resource
Problem Details: With the generic crashkernel reservation, the kernel emits the following warning on powerpc: WARNING: CPU: 0 PID: 1 at arch/powerpc/mm/mem.c:341 add_system_ram_resources+0xfc/0x180 Modules linked in: CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.17.0-auto-12607-g5472d60c129f #1 VOLUNTARY Hardware...
```diff diff --git a/arch/powerpc/include/asm/crash_reserve.h b/arch/powerpc/include/asm/crash_reserve.h index 6467ce29b1fa..d1b570ddbf98 100644 --- a/arch/powerpc/include/asm/crash_reserve.h +++ b/arch/powerpc/include/asm/crash_reserve.h @@ -5,4 +5,12 @@ /* crash kernel regions are Page size agliged */ #define CRASH...
1b34743c31fef06d3728abf58126a7bcadb5ba1b
Analyze and fix the following issue in the Linux kernel code: ocfs2: add extra consistency check to ocfs2_dx_dir_lookup_rec()
Problem Details: In 'ocfs2_dx_dir_lookup_rec()', check whether an extent list length of the directory indexing block matches the one configured via the superblock parameters established at mount, thus preventing an out-of-bounds accesses while iterating over the extent records below. Link: https://lkml.kernel.org/r/20...
```diff diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 48b092bc83d4..0fcaa0e90747 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -778,6 +778,14 @@ static int ocfs2_dx_dir_lookup_rec(struct inode *inode, struct ocfs2_extent_block *eb; struct ocfs2_extent_rec *rec = NULL; + if (le16_to_cpu(el->l_count) != ...
2f26f58df041bbcf692730ff4d8ab0f250d9670d
Analyze and fix the following issue in the Linux kernel code: ocfs2: annotate flexible array members with __counted_by_le()
Problem Details: Annotate flexible array members of 'struct ocfs2_extent_list', 'struct ocfs2_chain_list', 'struct ocfs2_truncate_log', 'struct ocfs2_dx_entry_list', 'ocfs2_refcount_list' and 'struct ocfs2_xattr_header' with '__counted_by_le()' attribute to improve array bounds checking when CONFIG_UBSAN_BOUNDS is ena...
```diff diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 8c9c4825f984..48b092bc83d4 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -4104,10 +4104,15 @@ static int ocfs2_expand_inline_dx_root(struct inode *dir, } dx_root->dr_flags &= ~OCFS2_DX_FLAG_INLINE; - memset(&dx_root->dr_list, 0, osb->sb->s_blocksize...
08bd4c46d5e63b78e77f2605283874bbe868ab19
Analyze and fix the following issue in the Linux kernel code: scs: fix a wrong parameter in __scs_magic
Problem Details: __scs_magic() needs a 'void *' variable, but a 'struct task_struct *' is given. 'task_scs(tsk)' is the starting address of the task's shadow call stack, and '__scs_magic(task_scs(tsk))' is the end address of the task's shadow call stack. Here should be '__scs_magic(task_scs(tsk))'. The user-visible ...
```diff diff --git a/kernel/scs.c b/kernel/scs.c index d7809affe740..772488afd5b9 100644 --- a/kernel/scs.c +++ b/kernel/scs.c @@ -135,7 +135,7 @@ static void scs_check_usage(struct task_struct *tsk) if (!IS_ENABLED(CONFIG_DEBUG_STACK_USAGE)) return; - for (p = task_scs(tsk); p < __scs_magic(tsk); ++p) { + for (...
8a7d58845fae061c62b50bc5eeb9bae4a1dedc3d
Analyze and fix the following issue in the Linux kernel code: ocfs2: relax BUG() to ocfs2_error() in __ocfs2_move_extent()
Problem Details: In '__ocfs2_move_extent()', relax 'BUG()' to 'ocfs2_error()' just to avoid crashing the whole kernel due to a filesystem corruption. Fixes: 8f603e567aa7 ("Ocfs2/move_extents: move a range of extent.") Link: https://lkml.kernel.org/r/20251009102349.181126-2-dmantipov@yandex.ru Signed-off-by: Dmitry Ant...
```diff diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c index bc83dc5ab5bd..ce978a2497d9 100644 --- a/fs/ocfs2/move_extents.c +++ b/fs/ocfs2/move_extents.c @@ -98,7 +98,13 @@ static int __ocfs2_move_extent(handle_t *handle, rec = &el->l_recs[index]; - BUG_ON(ext_flags != rec->e_flags); + if (ext_fl...
387aba39b7be9e4b7fbacb04f22d8bb40be51a34
Analyze and fix the following issue in the Linux kernel code: drm/xe/pf: Allow to lockdown the PF using custom guard
Problem Details: Some driver components, like eudebug or ccs-mode, can't be used when VFs are enabled. Add functions to allow those components to block the PF from enabling VFs for the requested duration. Introduce trivial counter to allow lockdown or exclusive access that can be used in the scenarios where we can't ...
```diff diff --git a/drivers/gpu/drm/xe/xe_guard.h b/drivers/gpu/drm/xe/xe_guard.h new file mode 100644 index 000000000000..333f8e13b5a1 --- /dev/null +++ b/drivers/gpu/drm/xe/xe_guard.h @@ -0,0 +1,119 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Copyright © 2025 Intel Corporation + */ + +#ifndef _XE_GUARD_H_ +#defin...
337f7e3a4b4d60b41d3e9a389675bb9353925183
Analyze and fix the following issue in the Linux kernel code: arm64: Fix double word in comments
Problem Details: Remove the repeated word "the" in comments. Signed-off-by: Bo Liu <liubo03@inspur.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
```diff diff --git a/arch/arm64/kernel/entry-ftrace.S b/arch/arm64/kernel/entry-ftrace.S index 169ccf600066..025140caafe7 100644 --- a/arch/arm64/kernel/entry-ftrace.S +++ b/arch/arm64/kernel/entry-ftrace.S @@ -94,7 +94,7 @@ SYM_CODE_START(ftrace_caller) stp x29, x30, [sp, #FREGS_SIZE] add x29, sp, #FREGS_SIZE - ...
77874ebd4032b1f407b01a7bbdfcad752da05592
Analyze and fix the following issue in the Linux kernel code: riscv: dts: Add initial Anlogic DR1V90 SoC device tree
Problem Details: DR1V90 is a FPSoC from Anlogic, which features a RISC-V core as the PS part and 94,464 LUTs for the PL part. The PS part integrates a Nuclei UX900 RISC-V core with 32KB L1 icache and 32KB L1 dcache. It also provides two "snps,dw-apb-uart" compatible UART controllers. Some basic information of the pro...
```diff diff --git a/arch/riscv/boot/dts/anlogic/dr1v90.dtsi b/arch/riscv/boot/dts/anlogic/dr1v90.dtsi new file mode 100644 index 000000000000..a5d0765ade32 --- /dev/null +++ b/arch/riscv/boot/dts/anlogic/dr1v90.dtsi @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* + * Copyright (C) 2025 Junhui Liu <ju...
c86ee66e14acb15d7d20b329ea49f751c9df8bc9
Analyze and fix the following issue in the Linux kernel code: dt-bindings: vendor-prefixes: Add Anlogic, Milianke and Nuclei
Problem Details: Add vendor prefixes for "anlogic", "milianke" and "nuclei". These are required for describing the Milianke MLKPAI-FS01 board with DR1V90 SoC from Anlogic, which uses a processor core designed by Nuclei. Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Junhui Liu <junhui.li...
```diff diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index f1d1882009ba..23e74b96bfb7 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -132,6 +132,8 @@ patte...
96ac403ea2b4ddfc0aa99815476c3ff13a23935e
Analyze and fix the following issue in the Linux kernel code: arm64: Fix typos and spelling errors in comments
Problem Details: This patch corrects several minor typographical and spelling errors in comments across multiple arm64 source files. No functional changes. Signed-off-by: mrigendrachaubey <mrigendra.chaubey@gmail.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
```diff diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index 23be85d93348..b8b1229e05e5 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -371,7 +371,7 @@ alternative_endif * [start, end) with dcache line size explicitly provided. * *...
3749ea4deeba6049ea97e653d964568a45543e37
Analyze and fix the following issue in the Linux kernel code: null_blk: fix zone read length beyond write pointer
Problem Details: Fix up the divisor calculating the number of zone sectors being read and handle a read that straddles the zone write pointer. The length is rounded up a sector boundary, so be sure to truncate any excess bytes off to avoid copying past the data segment. Fixes: 3451cf34f51bb70 ("null_blk: allow byte al...
```diff diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index f1e67962ecae..c7c0fb79a6bf 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -1240,9 +1240,12 @@ static blk_status_t null_transfer(struct nullb *nullb, struct page *page, p = kmap_local_page(page...
4b747cc628d8f500d56cf1338280eacc66362ff3
Analyze and fix the following issue in the Linux kernel code: cpufreq: intel_pstate: Check IDA only before MSR_IA32_PERF_CTL writes
Problem Details: Commit ac4e04d9e378 ("cpufreq: intel_pstate: Unchecked MSR aceess in legacy mode") introduced a check for feature X86_FEATURE_IDA to verify turbo mode support. Although this is the correct way to check for turbo mode support, it causes issues on some platforms that disable turbo during OS boot, but ena...
```diff diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 38897bb14a2c..492a10f1bdbf 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -603,9 +603,6 @@ static bool turbo_is_disabled(void) { u64 misc_en; - if (!cpu_feature_enabled(X86_FEATURE_IDA)) ...
013f912eb5fa7c06b3648ca630acfc4ff26456fa
Analyze and fix the following issue in the Linux kernel code: rust: sync: atomic: Implement Debug for Atomic<Debug>
Problem Details: If `Atomic<T>` is `Debug` then it's a `debugfs::Writer`, therefore make it so since 1) debugfs needs to support `Atomic<T>` and 2) it's rather trivial to implement `Debug` for `Atomic<Debug>`. Tested-by: David Gow <davidgow@google.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-o...
```diff diff --git a/rust/kernel/sync/atomic.rs b/rust/kernel/sync/atomic.rs index 0bc6e7b04d67..3afc376be42d 100644 --- a/rust/kernel/sync/atomic.rs +++ b/rust/kernel/sync/atomic.rs @@ -307,6 +307,15 @@ where } } +impl<T: AtomicType + core::fmt::Debug> core::fmt::Debug for Atomic<T> +where + T::Repr: Atomic...
9e9182cab5ebc3ee7544e60ef08ba19fdf216920
Analyze and fix the following issue in the Linux kernel code: coresight: etm4x: Remove the state_needs_restore flag
Problem Details: When the restore flow is invoked, it means no error occurred during the save phase. Otherwise, if any errors happened while saving the context, the function would return an error and abort the suspend sequence. Therefore, the state_needs_restore flag is unnecessary. The save and restore functions are ...
```diff diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index bdf5ab85b221..560975b70474 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -1966,8 +1966,6 @@ static int __etm4_c...
5ebec443fb96ac305baaae51efe998194f3c87c4
Analyze and fix the following issue in the Linux kernel code: sched_ext: Exit dispatch and move operations immediately when aborting
Problem Details: 62dcbab8b0ef ("sched_ext: Avoid live-locking bypass mode switching") introduced the breather mechanism to inject delays during bypass mode switching. It maintains operation semantics unchanged while reducing lock contention to avoid live-locks on large NUMA systems. However, the breather only activate...
```diff diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index 5da699cacde1..56a6d453543a 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -1818,48 +1818,11 @@ static struct rq *move_task_between_dsqs(struct scx_sched *sch, return dst_rq; } -/* - * A poorly behaving BPF scheduler can live-lock the s...
5f02151c411dda46efcc5dc57b0845efcdcfc26d
Analyze and fix the following issue in the Linux kernel code: sched_ext: Fix unsafe locking in the scx_dump_state()
Problem Details: For built with CONFIG_PREEMPT_RT=y kernels, the dump_lock will be converted sleepable spinlock and not disable-irq, so the following scenarios occur: inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. irq_work/0/27 [HC0[0]:SC0[0]:HE1:SE1] takes: (&rq->__lock){?...}-{2:2}, at: raw_spin_rq_lock_nested...
```diff diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index 1a019a7728fb..184d562bda5e 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -4276,7 +4276,7 @@ static void scx_dump_state(struct scx_exit_info *ei, size_t dump_len) size_t avail, used; bool idle; - rq_lock(rq, &rf); + rq_lock_irqsav...
1d562ba0aa7df81335bf96c02be77efe8d5bab87
Analyze and fix the following issue in the Linux kernel code: spi: dt-bindings: nuvoton,npcm-pspi: Convert to DT schema
Problem Details: Convert the Nuvoton NPCM PSPI binding to DT schema format. Also update the binding to fix shortcoming: * Drop clock-frequency property: it is never read in the NPCM PSPI driver and has no effect. Signed-off-by: Tomer Maimon <tmaimon77@gmail.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlows...
```diff diff --git a/Documentation/devicetree/bindings/spi/nuvoton,npcm-pspi.txt b/Documentation/devicetree/bindings/spi/nuvoton,npcm-pspi.txt deleted file mode 100644 index a4e72e52af59..000000000000 --- a/Documentation/devicetree/bindings/spi/nuvoton,npcm-pspi.txt +++ /dev/null @@ -1,36 +0,0 @@ -Nuvoton NPCM Peripher...
2d0e88f3fd1dcb37072d499c36162baf5b009d41
Analyze and fix the following issue in the Linux kernel code: io_uring/rsrc: don't use blk_rq_nr_phys_segments() as number of bvecs
Problem Details: io_buffer_register_bvec() currently uses blk_rq_nr_phys_segments() as the number of bvecs in the request. However, bvecs may be split into multiple segments depending on the queue limits. Thus, the number of segments may overestimate the number of bvecs. For ublk devices, the only current users of io_b...
```diff diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index 2602d76d5ff0..0010c4992490 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -943,8 +943,8 @@ int io_buffer_register_bvec(struct io_uring_cmd *cmd, struct request *rq, struct req_iterator rq_iter; struct io_mapped_ubuf *imu; struct io_rsrc_node *nod...
a77fa0b9222d2f23a764061a3be18e6bc738672e
Analyze and fix the following issue in the Linux kernel code: vfio: selftests: fix map limit tests to use last available iova
Problem Details: Use the newly available vfio_pci_iova_ranges() to determine the last legal IOVA, and use this as the basis for vfio_dma_map_limit_test tests. Fixes: de8d1f2fd5a5 ("vfio: selftests: add end of address space DMA map/unmap tests") Reviewed-by: David Matlack <dmatlack@google.com> Tested-by: David Matlack ...
```diff diff --git a/tools/testing/selftests/vfio/vfio_dma_mapping_test.c b/tools/testing/selftests/vfio/vfio_dma_mapping_test.c index 4f1ea79a200c..e1374aab96bd 100644 --- a/tools/testing/selftests/vfio/vfio_dma_mapping_test.c +++ b/tools/testing/selftests/vfio/vfio_dma_mapping_test.c @@ -3,6 +3,8 @@ #include <sys/mm...
76680d0d2825900f23bf35290ab2b80bdf3a8e4a
Analyze and fix the following issue in the Linux kernel code: tracing: Have function tracer define options per instance
Problem Details: Currently the function tracer's options are saved via a global mask when it should be per instance. Use the new infrastructure to define a "default_flags" field in the tracer structure that is used for the top level instance as well as new ones. Currently the global mask causes confusion: # cd /sys...
```diff diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c index d17c18934445..c12795c2fb39 100644 --- a/kernel/trace/trace_functions.c +++ b/kernel/trace/trace_functions.c @@ -154,11 +154,11 @@ static int function_trace_init(struct trace_array *tr) if (!tr->ops) return -ENOMEM; - func ...
428add559b6923f13acc591913cda3467be98dfd
Analyze and fix the following issue in the Linux kernel code: tracing: Have tracer option be instance specific
Problem Details: Tracers can add specify options to modify them. This logic was added before instances were created and the tracer flags were global variables. After instances were created where a tracer may exist in more than one instance, the flags were not updated from being global into instance specific. This cause...
```diff diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 0aea9cb84276..9268489d2ce8 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -94,6 +94,13 @@ static bool tracepoint_printk_stop_on_boot __initdata; static bool traceoff_after_boot __initdata; static DEFINE_STATIC_KEY_FALSE(tracepoint...
26b8986a18c1f8c277659340e59c59d5f17d927f
Analyze and fix the following issue in the Linux kernel code: net: clear skb->sk in skb_release_head_state()
Problem Details: skb_release_head_state() inlines skb_orphan(). We need to clear skb->sk otherwise we can freeze TCP flows on a mostly idle host, because skb_fclone_busy() would return true as long as the packet is not yet processed by skb_defer_free_flush(). Fixes: 1fcf572211da ("net: allow skb_release_head_state() ...
```diff diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 4f4d7ab7057f..f34372666e67 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -1152,6 +1152,7 @@ void skb_release_head_state(struct sk_buff *skb) #endif skb->destructor = NULL; + skb->sk = NULL; } nf_reset_ct(skb); skb_ext_reset(skb); ...
ac1499fcd40fe06479e9b933347b837ccabc2a40
Analyze and fix the following issue in the Linux kernel code: ipv4: route: Prevent rt_bind_exception() from rebinding stale fnhe
Problem Details: The sit driver's packet transmission path calls: sit_tunnel_xmit() -> update_or_create_fnhe(), which lead to fnhe_remove_oldest() being called to delete entries exceeding FNHE_RECLAIM_DEPTH+random. The race window is between fnhe_remove_oldest() selecting fnheX for deletion and the subsequent kfree_rc...
```diff diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 6d27d3610c1c..b549d6a57307 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -607,6 +607,11 @@ static void fnhe_remove_oldest(struct fnhe_hash_bucket *hash) oldest_p = fnhe_p; } } + + /* Clear oldest->fnhe_daddr to prevent this fnhe from bein...
f2687d3cc9f905505d7b510c50970176115066a2
Analyze and fix the following issue in the Linux kernel code: drm/i915/dp_mst: Disable Panel Replay
Problem Details: Disable Panel Replay on MST links until it's properly implemented. For instance the required VSC SDP is not programmed on MST and FEC is not enabled if Panel Replay is enabled. Fixes: 3257e55d3ea7 ("drm/i915/panelreplay: enable/disable panel replay") Closes: https://gitlab.freedesktop.org/drm/i915/ker...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index d5e0a1e66944..4619237f1346 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -585,6 +585,10 @@ static void _panel_replay_init_dpcd(struct intel_dp *intel_d...
53361aa64f2137e31a10813ccbd00d99f4dac130
Analyze and fix the following issue in the Linux kernel code: drm/xe: fix kernel-doc function name mismatch in xe_pm.c
Problem Details: Documentation build reported: WARNING: ./drivers/gpu/drm/xe/xe_pm.c:131 expecting prototype for xe_pm_might_block_on_suspend(). Prototype was for xe_pm_block_on_suspend() instead The kernel-doc comment for xe_pm_block_on_suspend() incorrectly used the function name xe_pm_might_block_on_suspend(). ...
```diff diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c index 7b089e6fb63f..44924512830f 100644 --- a/drivers/gpu/drm/xe/xe_pm.c +++ b/drivers/gpu/drm/xe/xe_pm.c @@ -112,7 +112,7 @@ void xe_pm_might_block_on_suspend(void) } /** - * xe_pm_might_block_on_suspend() - Block pending suspend. + * xe_...
99f932c9050911fab8ac82455fc4d74b1c0200af
Analyze and fix the following issue in the Linux kernel code: selftests/vsock: disable shellcheck SC2317 and SC2119
Problem Details: Disable shellcheck rules SC2317 and SC2119. These rules are being triggered due to false positives. For SC2317, many `return "${KSFT_PASS}"` lines are reported as unreachable, even though they are executed during normal runs. For SC2119, the fact that log_guest/log_host accept either stdin or arguments...
```diff diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index 42e155b45602..c7b270dd77a9 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -7,6 +7,8 @@ # * virtme-ng # * busybox-static (used by virtme-ng) # * qemu (...
338c5ddf4c889926e931067418797cd1711dd939
Analyze and fix the following issue in the Linux kernel code: selftests/vsock: add vsock_loopback module loading
Problem Details: Add vsock_loopback module loading to the loopback test so that vmtest.sh can be used for kernels built with loopback as a module. This is not technically a fix as kselftest expects loopback to be built-in already (defined in selftests/vsock/config). This is useful only for using vmtest.sh outside of k...
```diff diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index b611172da09e..42e155b45602 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -452,6 +452,8 @@ test_vm_client_host_server() { test_vm_loopback() { local port...
67422ef38f8cc1116c28a74c144c1ab3cbbdb3bb
Analyze and fix the following issue in the Linux kernel code: selftests/vsock: add 1.37 to tested virtme-ng versions
Problem Details: Testing with 1.37 shows all tests passing but emits the warning: warning: vng version 'virtme-ng 1.37' has not been tested and may not function properly. The following versions have been tested: 1.33 1.36 This patch adds 1.37 to the virtme-ng versions to get rid of the above warning. Reviewed-by: S...
```diff diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index e961b65b4c6e..b611172da09e 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -156,7 +156,7 @@ check_vng() { local version local ok - tested_versions=("1....
592e3d14cecf8ffebe718586f02007a082aa3193
Analyze and fix the following issue in the Linux kernel code: selftests/vsock: add BUILD=0 definition
Problem Details: Add the definition for BUILD and initialize it to zero. This avoids 'bash -u vmtest.sh` from throwing 'unbound variable' when BUILD is not set to 1 and is later checked for its value. Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Link: htt...
```diff diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index a1c2969c44b6..e961b65b4c6e 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -548,6 +548,7 @@ run_shared_vm_test() { return "${rc}" } +BUILD=0 QEMU="qemu...
d13fb04a4bf0811b593843f7d2385fac5cf313c8
Analyze and fix the following issue in the Linux kernel code: selftests/vsock: identify and execute tests that can re-use VM
Problem Details: In preparation for future patches that introduce tests that cannot re-use the same VM, add functions to identify those that *can* re-use a VM. By continuing to re-use the same VM for these tests we can save time by avoiding the delay of booting a VM for every test. Reviewed-by: Simon Horman <horms@ke...
```diff diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index 2dd9bbb8c4a9..a1c2969c44b6 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -46,6 +46,8 @@ readonly TEST_DESCS=( "Run vsock_test using the loopback transpor...
7fea50dff98812db3ee4ddd96405c3298d9aa4cb
Analyze and fix the following issue in the Linux kernel code: selftests/vsock: add check_result() for pass/fail counting
Problem Details: Add check_result() function to reuse logic for incrementing the pass/fail counters. This function will get used by different callers as we add different types of tests in future patches (namely, namespace and non-namespace tests will be called at different places, and re-use this function). Reviewed-b...
```diff diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index bd231467c66b..2dd9bbb8c4a9 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -79,6 +79,26 @@ die() { exit "${KSFT_FAIL}" } +check_result() { + local rc ar...
9e2ad0bc3640c384799c91da0b8b794c672da4d3
Analyze and fix the following issue in the Linux kernel code: selftests/vsock: speed up tests by reducing the QEMU pidfile timeout
Problem Details: Reduce the time waiting for the QEMU pidfile from three minutes to five seconds. The three minute time window was chosen to make sure QEMU had enough time to fully boot up. This, however, is an unreasonably long delay for QEMU to write the pidfile, which happens earlier when the QEMU process starts (no...
```diff diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index 6889bdb8a31c..bd231467c66b 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -22,7 +22,7 @@ readonly SSH_HOST_PORT=2222 readonly VSOCK_CID=1234 readonly WAIT...
c7df4adc0679afa2da47c13cbf7960a26e0fe7cb
Analyze and fix the following issue in the Linux kernel code: selftests/vsock: do not unconditionally die if qemu fails
Problem Details: If QEMU fails to boot, then set the returncode (via timeout) instead of unconditionally dying. This is in preparation for tests that expect QEMU to fail to boot. In that case, we just want to know if the boot failed or not so we can test the pass/fail criteria, and continue executing the next test. Re...
```diff diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index 13b685280a67..6889bdb8a31c 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -236,10 +236,8 @@ vm_start() { --append "${KERNEL_CMDLINE}" \ --rw &> ${log...
ac8997e943bc035171e76c8457db6fa973c8a9ab
Analyze and fix the following issue in the Linux kernel code: selftests/vsock: avoid multi-VM pidfile collisions with QEMU
Problem Details: Change QEMU to use generated pidfile names instead of just a single globally-defined pidfile. This allows multiple QEMU instances to co-exist with different pidfiles. This is required for future tests that use multiple VMs to check for CID collissions. Additionally, this also places the burden of kill...
```diff diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index 3bccd9b84e4a..13b685280a67 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -23,7 +23,8 @@ readonly VSOCK_CID=1234 readonly WAIT_PERIOD=3 readonly WAIT_PERI...
4f76ff14d3d96a21574e66222041757d679a8a10
Analyze and fix the following issue in the Linux kernel code: selftests/vsock: reuse logic for vsock_test through wrapper functions
Problem Details: Add wrapper functions vm_vsock_test() and host_vsock_test() to invoke the vsock_test binary. This encapsulates several items of repeat logic, such as waiting for the server to reach listening state and enabling/disabling the bash option pipefail to avoid pipe-style logging from hiding failures. Signed...
```diff diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index 01ce16523afb..3bccd9b84e4a 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -272,8 +272,81 @@ EOF } host_wait_for_listener() { - wait_for_listener "${TEST...
2ed3ce7efbd2854fb7eb76627ccec92362b2345b
Analyze and fix the following issue in the Linux kernel code: selftests/vsock: make wait_for_listener() work even if pipefail is on
Problem Details: Rewrite wait_for_listener()'s pattern matching to avoid tripping the if-condition when pipefail is on. awk doesn't gracefully handle SIGPIPE with a non-zero exit code, so grep exiting upon finding a match causes false-positives when the pipefail option is used (grep exits, SIGPIPE emits, and awk compl...
```diff diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index bc16b13cdbe3..01ce16523afb 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -251,9 +251,11 @@ wait_for_listener() # for tcp protocol additionally check th...
d9cac93cd1bed31724f55857b934bcbbc8313b59
Analyze and fix the following issue in the Linux kernel code: selftests/vsock: improve logging in vmtest.sh
Problem Details: Improve usability of logging functions. Remove the test name prefix from logging functions so that logging calls can be made deeper into the call stack without passing down the test name or setting some global. Teach log function to accept a LOG_PREFIX variable to avoid unnecessary argument shifting. ...
```diff diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index 8ceeb8a7894f..bc16b13cdbe3 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -271,60 +271,51 @@ EOF host_wait_for_listener() { wait_for_listener "${TEST_H...