id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
1cc3462159babb69c84c39cb1b4e262aef3ea325
Analyze and fix the following issue in the Linux kernel code: selftests: openvswitch: don't hardcode the drop reason subsys
Problem Details: WiFi removed one of their subsys entries from drop reasons, in commit 286e69677065 ("wifi: mac80211: Drop cooked monitor support") SKB_DROP_REASON_SUBSYS_OPENVSWITCH is now 2 not 3. The drop reasons are not uAPI, read the correct value from debug info. We need to enable vmlinux BTF, otherwise pahole n...
```diff diff --git a/tools/testing/selftests/net/config b/tools/testing/selftests/net/config index a86f3e752ce2..b0d0eda829d0 100644 --- a/tools/testing/selftests/net/config +++ b/tools/testing/selftests/net/config @@ -18,6 +18,8 @@ CONFIG_DUMMY=y CONFIG_BRIDGE_VLAN_FILTERING=y CONFIG_BRIDGE=y CONFIG_CRYPTO_CHACHA20...
35ea4f06fd33fc32f556a0c26d1d8340497fa7f8
Analyze and fix the following issue in the Linux kernel code: net: airoha: Fix lan4 support in airoha_qdma_get_gdm_port()
Problem Details: EN7581 SoC supports lan{1,4} ports on MT7530 DSA switch. Fix lan4 reported value in airoha_qdma_get_gdm_port routine. Fixes: 23020f0493270 ("net: airoha: Introduce ethernet support for EN7581 SoC") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: ...
```diff diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c index f3a61879e284..347c11b1fff5 100644 --- a/drivers/net/ethernet/airoha/airoha_eth.c +++ b/drivers/net/ethernet/airoha/airoha_eth.c @@ -589,7 +589,7 @@ static int airoha_qdma_get_gdm_port(struct airoha_eth *eth, ...
44ff44cadbd144ee1159f5687a852c49c4290262
Analyze and fix the following issue in the Linux kernel code: smccc: kvm_guest: Fix kernel builds for 32 bit arm
Problem Details: The paravirtual implementation ID stuffs is 64-bit only and broke 32bit arm builds. Slap an ifdef bandaid on the situation to get things rolling again. Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
```diff diff --git a/drivers/firmware/smccc/kvm_guest.c b/drivers/firmware/smccc/kvm_guest.c index 2f03b582c298..5767aed25cdc 100644 --- a/drivers/firmware/smccc/kvm_guest.c +++ b/drivers/firmware/smccc/kvm_guest.c @@ -55,6 +55,7 @@ bool kvm_arm_hyp_service_available(u32 func_id) } EXPORT_SYMBOL_GPL(kvm_arm_hyp_servi...
115ef44a98220fddfab37a39a19370497cd718b9
Analyze and fix the following issue in the Linux kernel code: sched: address a potential NULL pointer dereference in the GRED scheduler.
Problem Details: If kzalloc in gred_init returns a NULL pointer, the code follows the error handling path, invoking gred_destroy. This, in turn, calls gred_offload, where memset could receive a NULL pointer as input, potentially leading to a kernel crash. When table->opt is NULL in gred_init(), gred_change_table_def()...
```diff diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index ab6234b4fcd5..532fde548b88 100644 --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c @@ -913,7 +913,8 @@ static void gred_destroy(struct Qdisc *sch) for (i = 0; i < table->DPs; i++) gred_destroy_vq(table->tab[i]); - gred_offload(sch, TC_GR...
b0920abe0d529101bcf2eb1cd309032d2a42b4db
Analyze and fix the following issue in the Linux kernel code: perf report: Do not process non-JIT BPF ksymbol events
Problem Details: The length of PERF_RECORD_KSYMBOL for BPF is a size of JITed code so it'd be 0 when it's not JITed. The ksymbol is needed to symbolize the code when it gets samples in the region but non-JITed code cannot get samples. Thus it'd be ok to ignore them. Actually it caused a performance issue in the perf...
```diff diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index a81ffd2d1a05..2531b373f2cf 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -779,6 +779,10 @@ int machine__process_ksymbol(struct machine *machine __maybe_unused, if (dump_trace) perf_event__fprintf_ksymbol(ev...
2c744f38da7aeae77f9fc220a538fe8ca88f6db4
Analyze and fix the following issue in the Linux kernel code: perf test: Fix leak in "Synthesize attr update" test
Problem Details: The own_cpus map variable may be non-NULL and hold a reference, in particular on hybrid machines. Do a put before overwriting the variable to avoid a memory leak. Signed-off-by: Ian Rogers <irogers@google.com> Reviewed-by: James Clark <james.clark@linaro.org> Link: https://lore.kernel.org/r/2025030519...
```diff diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c index d6b4ce3ef4ee..9301fde11366 100644 --- a/tools/perf/tests/event_update.c +++ b/tools/perf/tests/event_update.c @@ -109,6 +109,7 @@ static int test__event_update(struct test_suite *test __maybe_unused, int subtes TEST_ASSERT_VA...
f9d2f5ddd47cd4e8092b0dc1d4cc488d27e5e191
Analyze and fix the following issue in the Linux kernel code: selftests: net: fix error message in bpf_offload
Problem Details: We hit a following exception on timeout, nmaps is never set: Test bpftool bound info reporting (own ns)... Traceback (most recent call last): File "/home/virtme/testing-1/tools/testing/selftests/net/./bpf_offload.py", line 1128, in <module> check_dev_info(False, "") File "/...
```diff diff --git a/tools/testing/selftests/net/bpf_offload.py b/tools/testing/selftests/net/bpf_offload.py index fd0d959914e4..4a9be8c49561 100755 --- a/tools/testing/selftests/net/bpf_offload.py +++ b/tools/testing/selftests/net/bpf_offload.py @@ -207,9 +207,11 @@ def bpftool_prog_list_wait(expected=0, n_retry=20): ...
8e0e8bef484160ac01ea7bcc3122cc1f0405c982
Analyze and fix the following issue in the Linux kernel code: tcp: clamp window like before the cleanup
Problem Details: A recent cleanup changed the behaviour of tcp_set_window_clamp(). This looks unintentional, and affects MPTCP selftests, e.g. some tests re-establishing a connection after a disconnect are now unstable. Before the cleanup, this operation was done: new_rcv_ssthresh = min(tp->rcv_wnd, new_window_clam...
```diff diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index eb5a60c7a9cc..46951e749308 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -3693,7 +3693,7 @@ EXPORT_SYMBOL(tcp_sock_set_keepcnt); int tcp_set_window_clamp(struct sock *sk, int val) { - u32 old_window_clamp, new_window_clamp; + u32 old_window_clamp, new...
33255c161ac4be003ac87c434ebc49645d18a929
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix bch2_dev_journal_alloc() spuriously failing
Problem Details: Previously, we fixed journal resize spuriousl failing with -BCH_ERR_open_buckets_empty, but initial journal allocation was missed because it didn't invoke the "block on allocator" loop at all. Factor out the "loop on allocator" code to fix that. Signed-off-by: Kent Overstreet <kent.overstreet@linux.d...
```diff diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c index 5dabbf3c0965..05b1250619ec 100644 --- a/fs/bcachefs/journal.c +++ b/fs/bcachefs/journal.c @@ -1021,8 +1021,8 @@ struct journal_buf *bch2_next_write_buffer_flush_journal_buf(struct journal *j, /* allocate journal on a device: */ -static int __...
7a310c644cf571fbdb1d447a1dc39cf048634589
Analyze and fix the following issue in the Linux kernel code: perf/x86/intel/bts: Check if bts_ctx is allocated when calling BTS functions
Problem Details: bts_ctx might not be allocated, for example if the CPU has X86_FEATURE_PTI, but intel_bts_disable/enable_local() and intel_bts_interrupt() are called unconditionally from intel_pmu_handle_irq() and crash on bts_ctx. So check if bts_ctx is allocated when calling BTS functions. Fixes: 3acfcefa795c ("pe...
```diff diff --git a/arch/x86/events/intel/bts.c b/arch/x86/events/intel/bts.c index 953868da82fb..39a987d5eb6e 100644 --- a/arch/x86/events/intel/bts.c +++ b/arch/x86/events/intel/bts.c @@ -338,9 +338,14 @@ static void bts_event_stop(struct perf_event *event, int flags) void intel_bts_enable_local(void) { - struct...
fd881d0a085fc54354414aed990ccf05f282ba53
Analyze and fix the following issue in the Linux kernel code: rseq: Fix segfault on registration when rseq_cs is non-zero
Problem Details: The rseq_cs field is documented as being set to 0 by user-space prior to registration, however this is not currently enforced by the kernel. This can result in a segfault on return to user-space if the value stored in the rseq_cs field doesn't point to a valid struct rseq_cs. The correct solution to t...
```diff diff --git a/kernel/rseq.c b/kernel/rseq.c index a7d81229eda0..b7a1ec327e81 100644 --- a/kernel/rseq.c +++ b/kernel/rseq.c @@ -236,6 +236,29 @@ efault: return -EFAULT; } +/* + * Get the user-space pointer value stored in the 'rseq_cs' field. + */ +static int rseq_get_rseq_cs_ptr_val(struct rseq __user *rse...
c00b413a96261faef4ce22329153c6abd4acef25
Analyze and fix the following issue in the Linux kernel code: x86/boot: Sanitize boot params before parsing command line
Problem Details: The 5-level paging code parses the command line to look for the 'no5lvl' string, and does so very early, before sanitize_boot_params() has been called and has been given the opportunity to wipe bogus data from the fields in boot_params that are not covered by struct setup_header, and are therefore supp...
```diff diff --git a/arch/x86/boot/compressed/pgtable_64.c b/arch/x86/boot/compressed/pgtable_64.c index c882e1f67af0..d8c5de40669d 100644 --- a/arch/x86/boot/compressed/pgtable_64.c +++ b/arch/x86/boot/compressed/pgtable_64.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "misc.h" #include <asm/bootpa...
d4c22ec680c8db832ffc0b964c6008e65436cba8
Analyze and fix the following issue in the Linux kernel code: net: hold netdev instance lock during ndo_open/ndo_stop
Problem Details: For the drivers that use shaper API, switch to the mode where core stack holds the netdev lock. This affects two drivers: * iavf - already grabs netdev lock in ndo_open/ndo_stop, so mostly remove these * netdevsim - switch to _locked APIs to avoid deadlock iavf_close diff is a bit confusing,...
```diff diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c index 71f11f64b13d..9f4d223dffcf 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_main.c +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -4562,22 +4562,21 @@ static int iavf_open(struct net_device *netde...
2a785307e41b5c621228e3a7ec3949af546a3e69
Analyze and fix the following issue in the Linux kernel code: i3c: master: svc: Fix npcm845 DAA process corruption
Problem Details: When MCONFIG.SKEW=0 and MCONFIG.ODHPP=0, the ENTDAA transaction gets corrupted and results in a no repeated-start condition at the end of address assignment. Workaround: Set MCONFIG.SKEW to 1 before initiating the DAA process. After the DAA process is completed, return MCONFIG.SKEW to its previous val...
```diff diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 25439f9ca2a5..f22fb9e75142 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -32,6 +32,7 @@ #define SVC_I3C_MCONFIG_ODBAUD(x) FIELD_PREP(GENMASK(23, 16), (x)) #define SV...
4dd12e944f07013ac280d7f46463c19157898bd1
Analyze and fix the following issue in the Linux kernel code: i3c: master: svc: Fix npcm845 invalid slvstart event
Problem Details: I3C HW may generate an invalid SlvStart event when emitting a STOP. If it is a true SlvStart, the MSTATUS state is SLVREQ. Check the MSTATUS state to ignore the false event. Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Stanley Chu <yschu@nuvoton.com> Link: https://lore.kernel.org/r/20250306...
```diff diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 6b0ec74313d3..25439f9ca2a5 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -58,6 +58,7 @@ #define SVC_I3C_MSTATUS 0x088 #define SVC_I3C_MSTATUS_STATE(x) FIELD_GET(G...
4008a74e0f9b0ec25441028e324452933644ed2a
Analyze and fix the following issue in the Linux kernel code: i3c: master: svc: Fix npcm845 FIFO empty issue
Problem Details: I3C HW stalls the write transfer if the transmit FIFO becomes empty, when new data is written to FIFO, I3C HW resumes the transfer but the first transmitted data bit may have the wrong value. Fill the FIFO in advance to prevent FIFO from becoming empty. Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-...
```diff diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index c0299e3f2cf8..6b0ec74313d3 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -113,6 +113,7 @@ #define SVC_I3C_MWDATAHE 0x0BC #define SVC_I3C_MRDATAB 0x0C0 #define ...
49306d5bfc6a86e3a75f8d584cda65164fb3ed71
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix file descriptor assertion in open_tuntap helper
Problem Details: The open_tuntap helper function uses open() to get a file descriptor for /dev/net/tun. The open(2) manpage writes this about its return value: On success, open(), openat(), and creat() return the new file descriptor (a nonnegative integer). On error, -1 is returned and errno is set to indicate...
```diff diff --git a/tools/testing/selftests/bpf/network_helpers.c b/tools/testing/selftests/bpf/network_helpers.c index fcee2c4a637a..29541d486c5e 100644 --- a/tools/testing/selftests/bpf/network_helpers.c +++ b/tools/testing/selftests/bpf/network_helpers.c @@ -554,7 +554,7 @@ int open_tuntap(const char *dev_name, boo...
d52d2b311a5a251ddd723d1dac881dc46e8803ab
Analyze and fix the following issue in the Linux kernel code: pm: cpupower: Fix cmd_monitor() error legs to free cpu_topology
Problem Details: cmd_monitor() calls get_cpu_topology() to allocate memory for cpu topology and fails to release in error legs. Fix it to call cpu_topology_release() from error legs. Link: https://lore.kernel.org/r/20250305225342.19447-2-skhan@linuxfoundation.org Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
```diff diff --git a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c index e123aa578881..0380d2e70016 100644 --- a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c +++ b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c @@ -427,1...
0ea4c3906416cefd6ae7ae5e93af9f2ef1b8c39b
Analyze and fix the following issue in the Linux kernel code: rust: workqueue: add missing newline to pr_info! examples
Problem Details: The documentation examples in rust/kernel/workqueue.rs use pr_info! calls that lack a trailing newline. To maintain consistency with kernel logging practices, this patch adds the newline to all affected examples. Fixes: 15b286d1fd05 ("rust: workqueue: add examples") Reported-by: Miguel Ojeda <ojeda@ke...
```diff diff --git a/rust/kernel/workqueue.rs b/rust/kernel/workqueue.rs index 0cd100d2aefb..b7be224cdf4b 100644 --- a/rust/kernel/workqueue.rs +++ b/rust/kernel/workqueue.rs @@ -60,7 +60,7 @@ //! type Pointer = Arc<MyStruct>; //! //! fn run(this: Arc<MyStruct>) { -//! pr_info!("The value is: {}", th...
50c3e77eb3712a039760345999709ee0fad83447
Analyze and fix the following issue in the Linux kernel code: rust: sync: add missing newline in locked_by log example
Problem Details: The pr_info! example in rust/kernel/sync/locked_by.rs was missing a newline. This patch appends the missing newline to ensure that log messages for locked resources display correctly. Fixes: 7b1f55e3a984 ("rust: sync: introduce `LockedBy`") Reported-by: Miguel Ojeda <ojeda@kernel.org> Link: https://gi...
```diff diff --git a/rust/kernel/sync/locked_by.rs b/rust/kernel/sync/locked_by.rs index a7b244675c2b..61f100a45b35 100644 --- a/rust/kernel/sync/locked_by.rs +++ b/rust/kernel/sync/locked_by.rs @@ -55,7 +55,7 @@ use core::{cell::UnsafeCell, mem::size_of, ptr}; /// fn print_bytes_used(dir: &Directory, file: &File) { ...
6933c1067fe6df8ddb34dd68bdb2aa172cbd08c8
Analyze and fix the following issue in the Linux kernel code: rust: init: add missing newline to pr_info! calls
Problem Details: Several pr_info! calls in rust/kernel/init.rs (both in code examples and macro documentation) were missing a newline, causing logs to run together. This commit updates these calls to include a trailing newline, improving readability and consistency with the C side. Fixes: 6841d45a3030 ("rust: init: ad...
```diff diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs index 8bbd5e3398fc..e25d047f3c82 100644 --- a/rust/kernel/init.rs +++ b/rust/kernel/init.rs @@ -259,7 +259,7 @@ pub mod macros; /// }, /// })); /// let foo: Pin<&mut Foo> = foo; -/// pr_info!("a: {}", &*foo.a.lock()); +/// pr_info!("a: {}\n", &*foo.a...
d92eabb370ceb1e0d797f68cb06a751d3c216e82
Analyze and fix the following issue in the Linux kernel code: drm/xe: Add SVM debug
Problem Details: Add some useful SVM debug logging fro SVM range which prints the range's state. v2: - Update logging with latest structure layout v3: - Better commit message (Thomas) - New range structure (Thomas) - s/COLLECTOT/s/COLLECTOR (Thomas) v4: - Drop partial evict message (Thomas) - Use %p for pointers...
```diff diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c index ab8847e3b042..ffaf0d02dc7d 100644 --- a/drivers/gpu/drm/xe/xe_pt.c +++ b/drivers/gpu/drm/xe/xe_pt.c @@ -654,6 +654,7 @@ xe_pt_stage_bind(struct xe_tile *tile, struct xe_vma *vma, /* Move this entire thing to xe_svm.c? */ xe_svm_not...
2f118c949160d163b439dc726793443918edeb6e
Analyze and fix the following issue in the Linux kernel code: drm/xe: Add SVM VRAM migration
Problem Details: Migration is implemented with range granularity, with VRAM backing being a VM private TTM BO (i.e., shares dma-resv with VM). The lifetime of the TTM BO is limited to when the SVM range is in VRAM (i.e., when a VRAM SVM range is migrated to SRAM, the TTM BO is destroyed). The design choice for using T...
```diff diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c index 5075704b562d..766a6ab6f368 100644 --- a/drivers/gpu/drm/xe/xe_svm.c +++ b/drivers/gpu/drm/xe/xe_svm.c @@ -32,6 +32,11 @@ static unsigned long xe_svm_range_end(struct xe_svm_range *range) return drm_gpusvm_range_end(&range->base); } ...
c5b3eb5a906c4777960050b9fece20a4722453b8
Analyze and fix the following issue in the Linux kernel code: drm/xe: Add GPUSVM device memory copy vfunc functions
Problem Details: Add GPUSVM device memory copy vfunc functions and connect to migration layer. Used for device memory migration. v2: - Allow NULL device pages in xe_svm_copy - Use new drm_gpusvm_devmem_ops v3: - Prefix defines with XE_ (Thomas) - Change copy chunk size to 8M - Add a bunch of comments to xe_svm_co...
```diff diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c index 4d1b18702d07..3bdd72a4f8ff 100644 --- a/drivers/gpu/drm/xe/xe_svm.c +++ b/drivers/gpu/drm/xe/xe_svm.c @@ -4,6 +4,7 @@ */ #include "xe_gt_tlb_invalidation.h" +#include "xe_migrate.h" #include "xe_pt.h" #include "xe_svm.h" #inclu...
0c30c65473ff372be68e139b56a1c84dd2b6ac8d
Analyze and fix the following issue in the Linux kernel code: drm/xe: Add SVM device memory mirroring
Problem Details: Add SVM device memory mirroring which enables device pages for migration. Enabled via CONFIG_XE_DEVMEM_MIRROR Kconfig. Kconfig option defaults to enabled. If not enabled, SVM will work sans migration and KMD memory footprint will be less. v3: - Add CONFIG_XE_DEVMEM_MIRROR v4: - Fix Kconfig (Himal) ...
```diff diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig index 1c747b08448a..7d7995196702 100644 --- a/drivers/gpu/drm/xe/Kconfig +++ b/drivers/gpu/drm/xe/Kconfig @@ -74,6 +74,15 @@ config DRM_XE_DP_TUNNEL If in doubt say "Y". +config DRM_XE_DEVMEM_MIRROR + bool "Enable device memory mirror"...
ab498828fad7349ae9c150e894396ab150f9f2d6
Analyze and fix the following issue in the Linux kernel code: drm/xe: Add SVM range invalidation and page fault
Problem Details: Add SVM range invalidation vfunc which invalidates PTEs. A new PT layer function which accepts a SVM range is added to support this. In addition, add the basic page fault handler which allocates a SVM range which is used by SVM range invalidation vfunc. v2: - Don't run invalidation if VM is closed -...
```diff diff --git a/drivers/gpu/drm/xe/xe_gt_pagefault.c b/drivers/gpu/drm/xe/xe_gt_pagefault.c index 17d69039b866..c5ad9a0a89c2 100644 --- a/drivers/gpu/drm/xe/xe_gt_pagefault.c +++ b/drivers/gpu/drm/xe/xe_gt_pagefault.c @@ -19,6 +19,7 @@ #include "xe_guc.h" #include "xe_guc_ct.h" #include "xe_migrate.h" +#include...
85d4653354690891296352d68dfc4497414ae153
Analyze and fix the following issue in the Linux kernel code: drm/xe: Add dma_addr res cursor
Problem Details: Add dma_addr res cursor which walks an array of drm_pagemap_dma_addr. Useful for SVM ranges and programing page tables. v3: - Better commit message (Thomas) - Use new drm_pagemap.h location v7: - Fix kernel doc (CI) Signed-off-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Thomas Hells...
```diff diff --git a/drivers/gpu/drm/xe/xe_res_cursor.h b/drivers/gpu/drm/xe/xe_res_cursor.h index dca374b6521c..d1a403cfb628 100644 --- a/drivers/gpu/drm/xe/xe_res_cursor.h +++ b/drivers/gpu/drm/xe/xe_res_cursor.h @@ -26,6 +26,7 @@ #include <linux/scatterlist.h> +#include <drm/drm_pagemap.h> #include <drm/ttm/tt...
b43e864af0d4e74636c0e1dee857ce3275a84829
Analyze and fix the following issue in the Linux kernel code: drm/xe/uapi: Add DRM_XE_VM_BIND_FLAG_CPU_ADDR_MIRROR
Problem Details: Add the DRM_XE_VM_BIND_FLAG_CPU_ADDR_MIRROR flag, which is used to create unpopulated virtual memory areas (VMAs) without memory backing or GPU page tables. These VMAs are referred to as CPU address mirror VMAs. The idea is that upon a page fault or prefetch, the memory backing and GPU page tables will...
```diff diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c index dc24baa84092..651512023829 100644 --- a/drivers/gpu/drm/xe/xe_pt.c +++ b/drivers/gpu/drm/xe/xe_pt.c @@ -1090,6 +1090,11 @@ static int op_add_deps(struct xe_vm *vm, struct xe_vma_op *op, { int err = 0; + /* + * No need to check for ...
5473f4d4e29dea06155e884459b4b9744b2330a8
Analyze and fix the following issue in the Linux kernel code: drm/xe/bo: Introduce xe_bo_put_async
Problem Details: Introduce xe_bo_put_async to put a bo where the context is such that the bo destructor can't run due to lockdep problems or atomic context. If the put is the final put, freeing will be done from a work item. v5: - Kerenl doc for xe_bo_put_async (Thomas) v7: - Fix kernel doc (CI) Signed-off-by: Mat...
```diff diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c index 9adc63175e69..51cd22695592 100644 --- a/drivers/gpu/drm/xe/xe_bo.c +++ b/drivers/gpu/drm/xe/xe_bo.c @@ -2660,6 +2660,31 @@ void xe_bo_put_commit(struct llist_head *deferred) drm_gem_object_free(&bo->ttm.base.refcount); } +static vo...
73463dac9beecf583b89eb3e20465e92df04d1a9
Analyze and fix the following issue in the Linux kernel code: drm/pagemap: Add DRM pagemap
Problem Details: Introduce drm_pagemap ops to map and unmap dma to VRAM resources. In the local memory case it's a matter of merely providing an offset into the device's physical address. For future p2p the map and unmap functions may encode as needed. Similar to how dma-buf works, let the memory provider (drm_pagemap...
```diff diff --git a/include/drm/drm_pagemap.h b/include/drm/drm_pagemap.h new file mode 100644 index 000000000000..202c157ff4d7 --- /dev/null +++ b/include/drm/drm_pagemap.h @@ -0,0 +1,107 @@ +/* SPDX-License-Identifier: MIT */ +#ifndef _DRM_PAGEMAP_H_ +#define _DRM_PAGEMAP_H_ + +#include <linux/dma-direction.h> +#inc...
1afaeb8293c9addbf4f9140bdd22635fed763459
Analyze and fix the following issue in the Linux kernel code: mm/migrate: Trylock device page in do_swap_page
Problem Details: Avoid multiple CPU page faults to the same device page racing by trying to lock the page in do_swap_page before taking an extra reference to the page. This prevents scenarios where multiple CPU page faults each take an extra reference to a device page, which could abort migration in folio_migrate_mappi...
```diff diff --git a/mm/memory.c b/mm/memory.c index b4d3d4893267..59b804f4bf3f 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4348,10 +4348,15 @@ vm_fault_t do_swap_page(struct vm_fault *vmf) * Get a page reference while we know the page can't be * freed. */ - get_page(vmf->page); - pte_unmap_unlock...
e79751f69b3c1ab42c6ae8c3b9e3bf05d1bdb49b
Analyze and fix the following issue in the Linux kernel code: drm/msm/dpu: Clear perf params before calculating bw
Problem Details: To prevent incorrect BW calculation, zero out dpu_core_perf_params before it is passed into dpu_core_perf_aggregate(). Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com> Fixes: 795aef6f3653 ("drm/msm/dpu: remove duplicate code calculating sum of bandwidths") Reviewed-by: Abhinav Kumar <quic_abhi...
```diff diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c index 7ff3405c6867..0fb5789c60d0 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -164,7 +164,7 @@ int dpu_core_perf_crtc_check(struct drm_c...
8eea4e74475804285507c077bec87d40be87ff06
Analyze and fix the following issue in the Linux kernel code: taint: Add TAINT_FWCTL
Problem Details: Requesting a fwctl scope of access that includes mutating device debug data will cause the kernel to be tainted. Changing the device operation through things in the debug scope may cause the device to malfunction in undefined ways. This should be reflected in the TAINT flags to help any debuggers under...
```diff diff --git a/Documentation/admin-guide/tainted-kernels.rst b/Documentation/admin-guide/tainted-kernels.rst index 700aa72eecb1..a0cc017e4424 100644 --- a/Documentation/admin-guide/tainted-kernels.rst +++ b/Documentation/admin-guide/tainted-kernels.rst @@ -101,6 +101,7 @@ Bit Log Number Reason that got the ker...
27321c788b3aa238af3c3234dc722a30b62d8dcd
Analyze and fix the following issue in the Linux kernel code: firmware: tegra: bpmp: Fix typo in bpmp-abi.h
Problem Details: The word 'traget' is wrong, so fix it. Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com> Link: https://lore.kernel.org/r/20241118022928.11305-1-zhujun2@cmss.chinamobile.com Signed-off-by: Thierry Reding <treding@nvidia.com>
```diff diff --git a/include/soc/tegra/bpmp-abi.h b/include/soc/tegra/bpmp-abi.h index 6b995a8f0f6d..dc0789c20333 100644 --- a/include/soc/tegra/bpmp-abi.h +++ b/include/soc/tegra/bpmp-abi.h @@ -3755,7 +3755,7 @@ enum mrq_pwr_limit_cmd { * @defgroup bpmp_pwr_limit_type PWR_LIMIT TYPEs * @{ */ -/** @brief Limit va...
93039a60fb28f72196769869aa4b502f1849a373
Analyze and fix the following issue in the Linux kernel code: cpufreq/amd-pstate: Drop debug statements for policy setting
Problem Details: There are trace events that exist now for all amd-pstate modes that will output information right before programming to the hardware. This makes the existing debug statements unnecessary remaining overhead. Drop them. Reviewed-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com> Reviewed-by: Gautham R....
```diff diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index df42a2d22225..c70ed41a2448 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -667,7 +667,6 @@ static int amd_pstate_verify(struct cpufreq_policy_data *policy_data) } cpufreq_verify_within_cpu_limit...
a9ba0fd452d82ca0da170eb6291aac01075a17d5
Analyze and fix the following issue in the Linux kernel code: cpufreq/amd-pstate: Show a warning when a CPU fails to setup
Problem Details: I came across a system that MSR_AMD_CPPC_CAP1 for some CPUs isn't populated. This is an unexpected behavior that is most likely a BIOS bug. In the event it happens I'd like users to report bugs to properly root cause and get this fixed. Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Reviewed...
```diff diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 44318eb33463..29250638a2ac 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1028,6 +1028,7 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) free_cpudata2: freq_qos_remove_request(&cp...
b7a41156588ad03757bf0a2f0e05d6cbcebeaa9e
Analyze and fix the following issue in the Linux kernel code: cpufreq/amd-pstate: Invalidate cppc_req_cached during suspend
Problem Details: During resume it's possible the firmware didn't restore the CPPC request MSR but the kernel thinks the values line up. This leads to incorrect performance after resume from suspend. To fix the issue invalidate the cached value at suspend. During resume use the saved values programmed as cached limits....
```diff diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 56930424c9fa..44318eb33463 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1605,7 +1605,7 @@ static int amd_pstate_epp_reenable(struct cpufreq_policy *policy) max_perf, policy->boost_enabled);...
a1d1d8fb653532638cfb3ee0b7e67ebd5327a3d6
Analyze and fix the following issue in the Linux kernel code: cpufreq/amd-pstate: Fix the clamping of perf values
Problem Details: The clamping in freq_to_perf() is broken right now, as we first typecast (read wraparound) the overflowing value into a u8 and then clamp it down. So, use a u32 to store the >255 value in certain edge cases and then clamp it down into a u8. Also, use a "explicit typecast + clamp" instead of just a "cl...
```diff diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 08ae48076812..56930424c9fa 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -144,10 +144,10 @@ static struct quirk_entry quirk_amd_7k62 = { static inline u8 freq_to_perf(struct amd_cpudata *cpudata, ...
ca29a0bf1221451f566f19999f2eda8adf116ff9
Analyze and fix the following issue in the Linux kernel code: tracing: gfp: Remove duplication of recording GFP flags
Problem Details: The gfp_flags when recorded in the trace require being converted from their numbers to values. Various macros are used to help facilitate this, but there's two sets of macros that need to keep track of the same GFP flags to stay in sync. Commit 60295b944ff68 ("tracing: gfp: Fix the GFP enum values sho...
```diff diff --git a/include/trace/events/mmflags.h b/include/trace/events/mmflags.h index 72fbfe3caeaf..82371177ef79 100644 --- a/include/trace/events/mmflags.h +++ b/include/trace/events/mmflags.h @@ -78,6 +78,13 @@ TRACE_DEFINE_ENUM(___GFP_LAST_BIT); #define gfpflag_string(flag) {(__force unsigned long)flag, #fla...
3ca4d7af35093fa5c698e1e10e5fc48156c376fe
Analyze and fix the following issue in the Linux kernel code: ring-buffer: Fix typo in comment about header page pointer
Problem Details: Fix typo in comment about header page pointer in function rb_get_reader_page. Link: https://lore.kernel.org/20250118012352.3430519-1-zhouzhouyi@gmail.com Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
```diff diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index bb6089c2951e..9d4d951090d3 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -5318,7 +5318,7 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer) * moving it. The page before the header page has the ...
ebb0f38bb47f74b29e267babdbcd2c47d5292aa8
Analyze and fix the following issue in the Linux kernel code: fs/pipe: fix pipe buffer index use in FUSE
Problem Details: This was another case that Rasmus pointed out where the direct access to the pipe head and tail pointers broke on 32-bit configurations due to the type changes. As with the pipe FIONREAD case, fix it by using the appropriate helper functions that deal with the right pipe index sizing. Reported-by: Ra...
```diff diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 2b2d1b755544..3c9caafca9e2 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -2107,7 +2107,7 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe, struct file *out, loff_t *ppos, size_t len, unsigned int flags) { - unsigned in...
d810d4c27bf34c719243bab9feb0d843edc09fd7
Analyze and fix the following issue in the Linux kernel code: fs/pipe: do not open-code pipe head/tail logic in FIONREAD
Problem Details: Rasmus points out that we do indeed have other cases of breakage from the type changes that were introduced on 32-bit targets in order to read the pipe head and tail values atomically (commit 3d252160b818: "fs/pipe: Read pipe->{head,tail} atomically outside pipe->mutex"). Fix it up by using the proper...
```diff diff --git a/fs/pipe.c b/fs/pipe.c index e8e6698f3698..5c872775a6db 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -614,7 +614,7 @@ out: static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { struct pipe_inode_info *pipe = filp->private_data; - unsigned int count, head, tail, mask; + un...
6bb81b94f7a9cba6bde9a905cef52a65317a8b04
Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: Prevent integer overflow in hdr_first_de()
Problem Details: The "de_off" and "used" variables come from the disk so they both need to check. The problem is that on 32bit systems if they're both greater than UINT_MAX - 16 then the check does work as intended because of an integer overflow. Fixes: 60ce8dfde035 ("fs/ntfs3: Fix wrong if in hdr_first_de") Signed-o...
```diff diff --git a/fs/ntfs3/ntfs.h b/fs/ntfs3/ntfs.h index 241f2ffdd920..1ff13b6f9613 100644 --- a/fs/ntfs3/ntfs.h +++ b/fs/ntfs3/ntfs.h @@ -717,7 +717,7 @@ static inline struct NTFS_DE *hdr_first_de(const struct INDEX_HDR *hdr) struct NTFS_DE *e; u16 esize; - if (de_off >= used || de_off + sizeof(struct NTFS_D...
5ad414f4df2294b28836b5b7b69787659d6aa708
Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: Fix a couple integer overflows on 32bit systems
Problem Details: On 32bit systems the "off + sizeof(struct NTFS_DE)" addition can have an integer wrapping issue. Fix it by using size_add(). Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Konstantin Komarov <almaz.alexandrovi...
```diff diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c index 7eb9fae22f8d..78d20e4baa2c 100644 --- a/fs/ntfs3/index.c +++ b/fs/ntfs3/index.c @@ -618,7 +618,7 @@ static bool index_hdr_check(const struct INDEX_HDR *hdr, u32 bytes) u32 off = le32_to_cpu(hdr->de_off); if (!IS_ALIGNED(off, 8) || tot > bytes || end >...
143d75583f2427f3a97dba62413c4f0604867ebf
Analyze and fix the following issue in the Linux kernel code: media: vim2m: print device name after registering device
Problem Details: Move the v4l2_info() call displaying the video device name after the device is actually registered. This fixes a bug where the driver was always displaying "/dev/video0" since it was reading from the vfd before it was registered. Fixes: cf7f34777a5b ("media: vim2m: Register video device after setting...
```diff diff --git a/drivers/media/test-drivers/vim2m.c b/drivers/media/test-drivers/vim2m.c index 6c24dcf27eb0..0fe97e208c02 100644 --- a/drivers/media/test-drivers/vim2m.c +++ b/drivers/media/test-drivers/vim2m.c @@ -1314,9 +1314,6 @@ static int vim2m_probe(struct platform_device *pdev) vfd->v4l2_dev = &dev->v4l2_d...
f883f34b6a46b1a09d44d7f94c3cd72fe0e8f93b
Analyze and fix the following issue in the Linux kernel code: media: platform: stm32: Add check for clk_enable()
Problem Details: Add check for the return value of clk_enable() to gurantee the success. Fixes: 002e8f0d5927 ("media: stm32-dma2d: STM32 DMA2D driver") Cc: stable@vger.kernel.org Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
```diff diff --git a/drivers/media/platform/st/stm32/dma2d/dma2d.c b/drivers/media/platform/st/stm32/dma2d/dma2d.c index b6c8400fb92d..48fa781aab06 100644 --- a/drivers/media/platform/st/stm32/dma2d/dma2d.c +++ b/drivers/media/platform/st/stm32/dma2d/dma2d.c @@ -490,7 +490,8 @@ static void device_run(void *prv) dst->...
347d84833faac79a105e438168cedf0b9658445b
Analyze and fix the following issue in the Linux kernel code: media: xilinx-tpg: fix double put in xtpg_parse_of()
Problem Details: This loop was recently converted to use for_each_of_graph_port() which automatically does __cleanup__ on the "port" iterator variable. Delete the calls to of_node_put(port) to avoid a double put bug. Fixes: 393194cdf11e ("media: xilinx-tpg: use new of_graph functions") Cc: stable@vger.kernel.org Sign...
```diff diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c b/drivers/media/platform/xilinx/xilinx-tpg.c index cb93711ea3e3..7deec6e37edc 100644 --- a/drivers/media/platform/xilinx/xilinx-tpg.c +++ b/drivers/media/platform/xilinx/xilinx-tpg.c @@ -722,7 +722,6 @@ static int xtpg_parse_of(struct xtpg_device *xtpg) ...
734ac57e47b3bdd140a1119e2c4e8e6f8ef8b33d
Analyze and fix the following issue in the Linux kernel code: media: siano: Fix error handling in smsdvb_module_init()
Problem Details: The smsdvb_module_init() returns without checking the retval from smscore_register_hotplug(). If the smscore_register_hotplug() failed, the module failed to install, leaving the smsdvb_debugfs not unregistered. Fixes: 3f6b87cff66b ("[media] siano: allow showing the complete statistics via debugfs") Cc...
```diff diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c index 44d8fe8b220e..9b1a650ed055 100644 --- a/drivers/media/common/siano/smsdvb-main.c +++ b/drivers/media/common/siano/smsdvb-main.c @@ -1243,6 +1243,8 @@ static int __init smsdvb_module_init(void) smsdvb_debugfs...
223fc68d317776d9f9620d0a934efe128bf30790
Analyze and fix the following issue in the Linux kernel code: dt-bindings: media: mediatek,vcodec: Revise description
Problem Details: Revise the description of MediaTek video decoder to improve wording, fix typos, simplify diagram, and extend the pipeline architecture used in newer MediaTek SoCs (MT8186 and MT8188). Signed-off-by: Fei Shao <fshao@chromium.org> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off...
```diff diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml index 5865e6f0be89..bf8082d87ac0 100644 --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml +++ b/Documentation/dev...
3edd1fc48d2c045e8259561797c89fe78f01717e
Analyze and fix the following issue in the Linux kernel code: media: v4l2-dv-timings: prevent possible overflow in v4l2_detect_gtf()
Problem Details: In v4l2_detect_gtf(), it seems safer to cast the 32-bit image_width variable to the 64-bit type u64 before multiplying to avoid a possible overflow. The resulting object code even seems to look better, at least on x86_64. Found by Linux Verification Center (linuxtesting.org) with Svace. [Sergey: rewr...
```diff diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c b/drivers/media/v4l2-core/v4l2-dv-timings.c index 6361e11d2be7..7710cb26bea0 100644 --- a/drivers/media/v4l2-core/v4l2-dv-timings.c +++ b/drivers/media/v4l2-core/v4l2-dv-timings.c @@ -764,7 +764,7 @@ bool v4l2_detect_gtf(unsigned int frame_height, u64 nu...
11de3582675cc0b7136e12f3971f1da3e5a05382
Analyze and fix the following issue in the Linux kernel code: media: rockchip: rga: fix rga offset lookup
Problem Details: The arguments to rga_lookup_draw_pos() are passed in the wrong order, rotate mode should be before mirror mode. Fixes: 558c248f930e6 ("media: rockchip: rga: split src and dst buffer setup") Cc: stable@vger.kernel.org Signed-off-by: John Keeping <jkeeping@inmusicbrands.com> Reviewed-by: Michael Tretter...
```diff diff --git a/drivers/media/platform/rockchip/rga/rga-hw.c b/drivers/media/platform/rockchip/rga/rga-hw.c index bf55beec0fac..43ed742a1649 100644 --- a/drivers/media/platform/rockchip/rga/rga-hw.c +++ b/drivers/media/platform/rockchip/rga/rga-hw.c @@ -376,7 +376,7 @@ static void rga_cmd_set_dst_info(struct rga_c...
1e7bd9627dad7686e6e318b4d3736dbd3ddece92
Analyze and fix the following issue in the Linux kernel code: media: rockchip: rga: fix field in OUTPUT buffers
Problem Details: Returned buffers shouldn't contain V4L2_FIELD_ANY as field. Set the field to V4L2_FIELD_NONE, if it isn't set. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
```diff diff --git a/drivers/media/platform/rockchip/rga/rga-buf.c b/drivers/media/platform/rockchip/rga/rga-buf.c index 4396348811c8..730bdf98565a 100644 --- a/drivers/media/platform/rockchip/rga/rga-buf.c +++ b/drivers/media/platform/rockchip/rga/rga-buf.c @@ -119,6 +119,13 @@ static int rga_buf_prepare(struct vb2_bu...
9c1cde7eb08dbc93e126547d9b40486f06fc7f3d
Analyze and fix the following issue in the Linux kernel code: staging: media: sdis: move open braces to the previous line
Problem Details: Fix checkpatch error "ERROR: that open brace { should be on the previous line" in ia_css_sdis.host.c:253 and :258. Signed-off-by: Santiago Ruano Rincón <santiagorr@riseup.net> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
```diff diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c index d516b686b8b8..a1bea8bd1a39 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c +++ b/drivers/...
5b1b37e97b23db21340bd297ecbbe02c9dd5ed8d
Analyze and fix the following issue in the Linux kernel code: staging: media: sdis: move open brace to a new line
Problem Details: Fix checkpatch error "ERROR: open brace '{' following function definitions go on the next line" in sdis_1.0/ia_css_sdis.host.c:239. Signed-off-by: Santiago Ruano Rincón <santiagorr@riseup.net> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
```diff diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c index a4e019e74e6b..d516b686b8b8 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c +++ b/drivers/...
c0c1a6bf80e9075e3f6b81fd542550d8eb91e57a
Analyze and fix the following issue in the Linux kernel code: media: cec: use us_to_ktime() where appropriate
Problem Details: [Why] There are several ns_to_ktime() calls that require using nanoseconds. It is better to replace them with us_to_ktime() to make code clear, getting rid of multiplication by 1000. Also the timer function code may have an integer wrap-around issue. Since both tx_custom_low_usecs and tx_custom_high_u...
```diff diff --git a/drivers/media/cec/core/cec-pin.c b/drivers/media/cec/core/cec-pin.c index a70451d99ebc..f232c3df7ee1 100644 --- a/drivers/media/cec/core/cec-pin.c +++ b/drivers/media/cec/core/cec-pin.c @@ -873,19 +873,19 @@ static enum hrtimer_restart cec_pin_timer(struct hrtimer *timer) if (pin->wait_usecs > 1...
e49563c3be09d4639ccff8ca68ef63b6f6c8456d
Analyze and fix the following issue in the Linux kernel code: media: i2c: add lt6911uxe hdmi bridge driver
Problem Details: Lontium LT9611UXE is a HDMI to MIPI CSI-2 bridge. The device supports modes up to 4k@60fps, obtains the video information and switches the current mode once the video signal changes. Signed-off-by: Dongcheng Yan <dongcheng.yan@intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> [hverkuil: fix ...
```diff diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig index 85ecb2aeefdb..e576b213084d 100644 --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig @@ -1147,6 +1147,17 @@ config VIDEO_ISL7998X Support for Intersil ISL7998x analog to MIPI-CSI2 or BT.656 decoder. +config VIDEO_LT6...
3b8c56d8072750fd9625f03b92d8d6000c98628f
Analyze and fix the following issue in the Linux kernel code: firmware: arm_scmi: use ioread64() instead of ioread64_hi_lo()
Problem Details: The scmi_common_fastchannel_db_ring() function calls either ioread64() or ioread64_hi_lo() depending on whether it is compiler for 32-bit or 64-bit architectures. The same logic is used to define ioread64() itself in the linux/io-64-nonatomic-hi-lo.h header file, so the special case is not really need...
```diff diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 60050da54bf2..1c75a4c9c371 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -1997,17 +1997,7 @@ static void scmi_common_fastchannel_db_ring(struct scmi_fc_db_info *db) else if ...
b13abcb7ddd8d38de769486db5bd917537b32ab1
Analyze and fix the following issue in the Linux kernel code: usb: typec: ucsi: Fix NULL pointer access
Problem Details: Resources should be released only after all threads that utilize them have been destroyed. This commit ensures that resources are not released prematurely by waiting for the associated workqueue to complete before deallocating them. Cc: stable <stable@kernel.org> Fixes: b9aa02ca39a4 ("usb: typec: ucsi...
```diff diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 7a56d3f840d7..2a2915b0a645 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -1825,11 +1825,11 @@ static int ucsi_init(struct ucsi *ucsi) err_unregister: for (con = connector; con->port; con++) ...
bb0ba4cb1065e87f9cc75db1fa454e56d0894d01
Analyze and fix the following issue in the Linux kernel code: usb: xhci: Apply the link chain quirk on NEC isoc endpoints
Problem Details: Two clearly different specimens of NEC uPD720200 (one with start/stop bug, one without) were seen to cause IOMMU faults after some Missed Service Errors. Faulting address is immediately after a transfer ring segment and patched dynamic debug messages revealed that the MSE was received when waiting for ...
```diff diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 4ee14f651d36..d9d7cd1906f3 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1760,11 +1760,20 @@ static inline void xhci_write_64(struct xhci_hcd *xhci, } -/* Link TRB chain should always be set on 0.95 hosts, and AMD...
860f5d0d3594005d4588240028f42e8d2bfc725b
Analyze and fix the following issue in the Linux kernel code: xhci: Prevent early endpoint restart when handling STALL errors.
Problem Details: Ensure that an endpoint halted due to device STALL is not restarted before a Clear_Feature(ENDPOINT_HALT) request is sent to the device. The host side of the endpoint may otherwise be started early by the 'Set TR Deq' command completion handler which is called if dequeue is moved past a cancelled or h...
```diff diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index c2e15a27338b..7643ab9ec3b4 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -556,8 +556,8 @@ void xhci_ring_ep_doorbell(struct xhci_hcd *xhci, * pointer command pending because the device can choose ...
9a7f4bc4c82b4dd8e57b13375d42aff6a52d1812
Analyze and fix the following issue in the Linux kernel code: usb: xhci: move debug capabilities from trb_in_td() to handle_tx_event()
Problem Details: Function trb_in_td() currently includes debug capabilities that are triggered when its debug argument is set to true. The only consumer of these debug capabilities is handle_tx_event(), which calls trb_in_td() twice, once for its primary functionality and a second time solely for debugging purposes if ...
```diff diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 8c7258afb6bf..c2e15a27338b 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -281,8 +281,7 @@ static void inc_enq(struct xhci_hcd *xhci, struct xhci_ring *ring, * If the suspect DMA address is a TRB in...
68c1f1671650b49bbd26e6a65ddcf33f2565efa3
Analyze and fix the following issue in the Linux kernel code: usb: xhci: set page size to the xHCI-supported size
Problem Details: The current xHCI driver does not validate whether a page size of 4096 bytes is supported. Address the issue by setting the page size to the value supported by the xHCI controller, as read from the Page Size register. In the event of an unexpected value; default to a 4K page size. Additionally, this co...
```diff diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index dc5bcd8db4c0..a7fdfa00eb48 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -1953,7 +1953,6 @@ no_bw: xhci->interrupters = NULL; xhci->page_size = 0; - xhci->page_shift = 0; xhci->usb2_rhub.bus_stat...
55741c723318905e6d5161bf1e12749020b161e3
Analyze and fix the following issue in the Linux kernel code: usb: xhci: correct debug message page size calculation
Problem Details: The ffs() function returns the index of the first set bit, starting from 1. If no bits are set, it returns zero. This behavior causes an off-by-one page size in the debug message, as the page size calculation [1] is zero-based, while ffs() is one-based. Fix this by subtracting one from the result of f...
```diff diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 92703efda1f7..dc5bcd8db4c0 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -2391,10 +2391,10 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) page_size = readl(&xhci->op_regs->page_size); xhci_...
d0b619599e52fe3e1454f7d151dedf2b194f61d8
Analyze and fix the following issue in the Linux kernel code: usb: xhci: Expedite skipping missed isoch TDs on modern HCs
Problem Details: xHCI spec rev. 1.0 allowed the TRB pointer of Missed Service events to be NULL. Having no idea which of the queued TDs were missed and which are waiting, we can only set a flag to skip missed TDs later. But HCs are also allowed to give us pointer to the last missed TRB, and this became mandatory in sp...
```diff diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index d34f46b63006..e871dd61a636 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2439,6 +2439,12 @@ static void process_isoc_td(struct xhci_hcd *xhci, struct xhci_virt_ep *ep, if (ep_trb != td->end_trb) ...
906dec15b9b321b546fd31a3c99ffc13724c7af4
Analyze and fix the following issue in the Linux kernel code: usb: xhci: Fix isochronous Ring Underrun/Overrun event handling
Problem Details: The TRB pointer of these events points at enqueue at the time of error occurrence on xHCI 1.1+ HCs or it's NULL on older ones. By the time we are handling the event, a new TD may be queued at this ring position. I can trigger this race by rising interrupt moderation to increase IRQ handling delay. Sim...
```diff diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 47aaaf4eb92a..d34f46b63006 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2627,6 +2627,7 @@ static int handle_tx_event(struct xhci_hcd *xhci, int status = -EINPROGRESS; struct xhci_ep_ctx *ep_ctx...
bfa8459942822bdcc86f0e87f237c0723ae64948
Analyze and fix the following issue in the Linux kernel code: usb: xhci: Complete 'error mid TD' transfers when handling Missed Service
Problem Details: Missed Service Error after an error mid TD means that the failed TD has already been passed by the xHC without acknowledgment of the final TRB, a known hardware bug. So don't wait any more and give back the TD. Reproduced on NEC uPD720200 under conditions of ludicrously bad USB link quality, confirmed...
```diff diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 6fb48d30ec21..47aaaf4eb92a 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2752,7 +2752,7 @@ static int handle_tx_event(struct xhci_hcd *xhci, xhci_dbg(xhci, "Miss service interval error for s...
58d0a3fab5f4fdc112c16a4c6d382f62097afd1c
Analyze and fix the following issue in the Linux kernel code: usb: xhci: Don't skip on Stopped - Length Invalid
Problem Details: Up until commit d56b0b2ab142 ("usb: xhci: ensure skipped isoc TDs are returned when isoc ring is stopped") in v6.11, the driver didn't skip missed isochronous TDs when handling Stoppend and Stopped - Length Invalid events. Instead, it erroneously cleared the skip flag, which would cause the ring to get...
```diff diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 23cf20026359..6fb48d30ec21 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2828,6 +2828,10 @@ static int handle_tx_event(struct xhci_hcd *xhci, if (!ep_seg) { if (ep->skip && usb_endpoint_xfe...
b020761e8cbf6c0bb14b12095a61e85f77c6b8b9
Analyze and fix the following issue in the Linux kernel code: xhci: show correct U1 and U2 timeout values in debug messages
Problem Details: U2 value is encoded in 256 microsecond intervals, show in microseconds. U1 value is in microseconds. debug message incorrectly showed "ms" Unwrap debug messages while we anyway modify them. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20250306144954.350...
```diff diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 45653114ccd7..3f2cd546a7a2 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4755,8 +4755,8 @@ static u16 xhci_calculate_u1_timeout(struct xhci_hcd *xhci, */ if (timeout_ns <= USB3_LPM_U1_MAX_TIMEOUT) return timeou...
abcdeb4e299a11ecb5a3ea0cce00e68e8f540375
Analyze and fix the following issue in the Linux kernel code: pinctrl: renesas: rza2: Fix missing of_node_put() call
Problem Details: of_parse_phandle_with_fixed_args() requires its caller to call into of_node_put() on the node pointer from the output structure, but such a call is currently missing. Call into of_node_put() to rectify that. Fixes: b59d0e782706 ("pinctrl: Add RZ/A2 pin and gpio controller") Signed-off-by: Fabrizio Ca...
```diff diff --git a/drivers/pinctrl/renesas/pinctrl-rza2.c b/drivers/pinctrl/renesas/pinctrl-rza2.c index a654ede01f70..3b5812963850 100644 --- a/drivers/pinctrl/renesas/pinctrl-rza2.c +++ b/drivers/pinctrl/renesas/pinctrl-rza2.c @@ -259,6 +259,8 @@ static int rza2_gpio_register(struct rza2_pinctrl_priv *priv) retu...
5a550b00704d3a2cd9d766a9427b0f8166da37df
Analyze and fix the following issue in the Linux kernel code: pinctrl: renesas: rzv2m: Fix missing of_node_put() call
Problem Details: of_parse_phandle_with_fixed_args() requires its caller to call into of_node_put() on the node pointer from the output structure, but such a call is currently missing. Call into of_node_put() to rectify that. Fixes: 92a9b8252576 ("pinctrl: renesas: Add RZ/V2M pin and gpio controller driver") Signed-of...
```diff diff --git a/drivers/pinctrl/renesas/pinctrl-rzv2m.c b/drivers/pinctrl/renesas/pinctrl-rzv2m.c index 4062c56619f5..8c7169db4fcc 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzv2m.c +++ b/drivers/pinctrl/renesas/pinctrl-rzv2m.c @@ -940,6 +940,8 @@ static int rzv2m_gpio_register(struct rzv2m_pinctrl *pctrl) re...
a5779e625e2b377f16a6675c432aaf299ce5028c
Analyze and fix the following issue in the Linux kernel code: pinctrl: renesas: rzg2l: Fix missing of_node_put() call
Problem Details: of_parse_phandle_with_fixed_args() requires its caller to call into of_node_put() on the node pointer from the output structure, but such a call is currently missing. Call into of_node_put() to rectify that. Fixes: c4c4637eb57f ("pinctrl: renesas: Add RZ/G2L pin and gpio controller driver") Signed-of...
```diff diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c index 9280bc37a623..c72e250f4a15 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c @@ -2763,6 +2763,8 @@ static int rzg2l_gpio_register(struct rzg2l_pinctrl *pctrl) i...
3707fd9c383fc7ae19733a3ad2e5a82bf86370a0
Analyze and fix the following issue in the Linux kernel code: spi: stm32: Remove unnecessary print function dev_err()
Problem Details: The print function dev_err() is redundant because platform_get_irq() already prints an error. ./drivers/spi/spi-stm32-ospi.c:798:2-9: line 798 is redundant because platform_get_irq() already prints an error. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/sho...
```diff diff --git a/drivers/spi/spi-stm32-ospi.c b/drivers/spi/spi-stm32-ospi.c index a544d7897edf..d4f413c8c3ce 100644 --- a/drivers/spi/spi-stm32-ospi.c +++ b/drivers/spi/spi-stm32-ospi.c @@ -794,10 +794,8 @@ static int stm32_ospi_get_resources(struct platform_device *pdev) } ospi->irq = platform_get_irq(pdev,...
98f3ab18a0a55aa1ff2cd6b74bd0c02c8f76f17e
Analyze and fix the following issue in the Linux kernel code: ARM: OMAP1: select CONFIG_GENERIC_IRQ_CHIP
Problem Details: When GENERIC_IRQ_CHIP is disabled, OMAP1 kernels fail to link: arm-linux-gnueabi-ld: arch/arm/mach-omap1/irq.o: in function `omap1_init_irq': irq.c:(.init.text+0x1e8): undefined reference to `irq_alloc_generic_chip' arm-linux-gnueabi-ld: irq.c:(.init.text+0x228): undefined reference to `irq_setup_gene...
```diff diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig index a643b71e30a3..08ec6bd84ada 100644 --- a/arch/arm/mach-omap1/Kconfig +++ b/arch/arm/mach-omap1/Kconfig @@ -8,6 +8,7 @@ menuconfig ARCH_OMAP1 select ARCH_OMAP select CLKSRC_MMIO select FORCE_PCI if PCCARD + select GENERIC_IRQ_CHIP ...
c2662b1544cbd8ea3181381bb899b8e681dfedc7
Analyze and fix the following issue in the Linux kernel code: dm cache: support shrinking the origin device
Problem Details: This patch introduces formal support for shrinking the cache origin by reducing the cache target length via table reloads. Cache blocks mapped beyond the new target length must be clean and are invalidated during preresume. If any dirty blocks exist in the area being removed, the preresume operation fa...
```diff diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 6cee5eac8b9e..a10d75a562db 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -406,6 +406,12 @@ struct cache { mempool_t migration_pool; struct bio_set bs; + + /* + * Cache_size entries. Set bits i...
5da692e2262b8f81993baa9592f57d12c2703dea
Analyze and fix the following issue in the Linux kernel code: dm cache: prevent BUG_ON by blocking retries on failed device resumes
Problem Details: A cache device failing to resume due to mapping errors should not be retried, as the failure leaves a partially initialized policy object. Repeating the resume operation risks triggering BUG_ON when reloading cache mappings into the incomplete policy object. Reproduce steps: 1. create a cache metadat...
```diff diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 9cb797a561d6..6cee5eac8b9e 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -2899,6 +2899,27 @@ static dm_cblock_t get_cache_dev_size(struct cache *cache) return to_cblock(size); } +static bool can...
d301f164c3fbff611bd71f57dfa553b9219f0f5e
Analyze and fix the following issue in the Linux kernel code: badblocks: use sector_t instead of int to avoid truncation of badblocks length
Problem Details: There is a truncation of badblocks length issue when set badblocks as follow: echo "2055 4294967299" > bad_blocks cat bad_blocks 2055 3 Change 'sectors' argument type from 'int' to 'sector_t'. This change avoids truncation of badblocks length for large sectors by replacing 'int' with 'sector_t' (u64...
```diff diff --git a/block/badblocks.c b/block/badblocks.c index e326a16fd056..673ef068423a 100644 --- a/block/badblocks.c +++ b/block/badblocks.c @@ -836,7 +836,7 @@ static bool try_adjacent_combine(struct badblocks *bb, int prev) } /* Do exact work to set bad block range into the bad block table */ -static bool _...
5236f041fa6c81c71eabad44897e54a0d6d5bbf6
Analyze and fix the following issue in the Linux kernel code: badblocks: fix missing bad blocks on retry in _badblocks_check()
Problem Details: The bad blocks check would miss bad blocks when retrying under contention, as checking parameters are not reset. These stale values from the previous attempt could lead to incorrect scanning in the subsequent retry. Move seqlock to outer function and reinitialize checking state for each retry. This en...
```diff diff --git a/block/badblocks.c b/block/badblocks.c index 92bd43f7fff1..b66d5f12a766 100644 --- a/block/badblocks.c +++ b/block/badblocks.c @@ -1191,31 +1191,12 @@ update_sectors: static int _badblocks_check(struct badblocks *bb, sector_t s, int sectors, sector_t *first_bad, int *bad_sectors) { - int u...
9ec65dec634a752ab0a1203510ee190356e4cf1a
Analyze and fix the following issue in the Linux kernel code: badblocks: fix merge issue when new badblocks align with pre+1
Problem Details: There is a merge issue when adding badblocks as follow: echo 0 10 > bad_blocks echo 30 10 > bad_blocks echo 20 10 > bad_blocks cat bad_blocks 0 10 20 10 //should be merged with (30 10) 30 10 In this case, if new badblocks does not intersect with prev, it is added by insert_at(). If th...
```diff diff --git a/block/badblocks.c b/block/badblocks.c index 57e9edf9b848..92bd43f7fff1 100644 --- a/block/badblocks.c +++ b/block/badblocks.c @@ -892,7 +892,7 @@ re_insert: len = insert_at(bb, 0, &bad); bb->count++; added++; - hint = 0; + hint = ++prev; goto update_sectors; } @@ -947,7 +947,7 @@ ...
37446680dfbfbba7cbedd680047182f70a0b857b
Analyze and fix the following issue in the Linux kernel code: badblocks: fix the using of MAX_BADBLOCKS
Problem Details: The number of badblocks cannot exceed MAX_BADBLOCKS, but it should be allowed to equal MAX_BADBLOCKS. Fixes: aa511ff8218b ("badblocks: switch to the improved badblock handling code") Fixes: c3c6a86e9efc ("badblocks: add helper routines for badblock ranges handling") Signed-off-by: Li Nan <linan122@hua...
```diff diff --git a/block/badblocks.c b/block/badblocks.c index 88f27d4f3856..43430bd3efa7 100644 --- a/block/badblocks.c +++ b/block/badblocks.c @@ -700,7 +700,7 @@ static bool can_front_overwrite(struct badblocks *bb, int prev, *extra = 2; } - if ((bb->count + (*extra)) >= MAX_BADBLOCKS) + if ((bb->count + (...
7f500f0a59b1d7345a05ec4ae703babf34b7e470
Analyze and fix the following issue in the Linux kernel code: badblocks: return error if any badblock set fails
Problem Details: _badblocks_set() returns success if at least one badblock is set successfully, even if others fail. This can lead to data inconsistencies in raid, where a failed badblock set should trigger the disk to be kicked out to prevent future reads from failed write areas. _badblocks_set() should return error ...
```diff diff --git a/block/badblocks.c b/block/badblocks.c index 1c8b8f65f6df..88f27d4f3856 100644 --- a/block/badblocks.c +++ b/block/badblocks.c @@ -843,7 +843,6 @@ static int _badblocks_set(struct badblocks *bb, sector_t s, int sectors, struct badblocks_context bad; int prev = -1, hint = -1; unsigned long flag...
28243dcd1f49cc8be398a1396d16a45527882ce5
Analyze and fix the following issue in the Linux kernel code: badblocks: return error directly when setting badblocks exceeds 512
Problem Details: In the current handling of badblocks settings, a lot of processing has been done for scenarios where the number of badblocks exceeds 512. This makes the code look quite complex and also introduces some issues, For example, if there is 512 badblocks already: for((i=0; i<510; i++)); do ((sector=i*2));...
```diff diff --git a/block/badblocks.c b/block/badblocks.c index ad8652fbe1c8..1c8b8f65f6df 100644 --- a/block/badblocks.c +++ b/block/badblocks.c @@ -527,51 +527,6 @@ out: return ret; } -/* - * Return 'true' if the range indicated by 'bad' can be backward merged - * with the bad range (from the bad table) index b...
32e9ad4d11f69949ff331e35a417871ee0d31d99
Analyze and fix the following issue in the Linux kernel code: badblocks: attempt to merge adjacent badblocks during ack_all_badblocks
Problem Details: If ack and unack badblocks are adjacent, they will not be merged and will remain as two separate badblocks. Even after the bad blocks are written to disk and both become ack, they will still remain as two independent bad blocks. This is not ideal as it wastes the limited space for badblocks. Therefore,...
```diff diff --git a/block/badblocks.c b/block/badblocks.c index f069c93e986d..ad8652fbe1c8 100644 --- a/block/badblocks.c +++ b/block/badblocks.c @@ -1491,6 +1491,11 @@ void ack_all_badblocks(struct badblocks *bb) p[i] = BB_MAKE(start, len, 1); } } + + for (i = 0; i < bb->count ; i++) + while (try_adjac...
7d83c5d73c1a3c7b71ba70d0ad2ae66e7a0e7ace
Analyze and fix the following issue in the Linux kernel code: badblocks: Fix error shitf ops
Problem Details: 'bb->shift' is used directly in badblocks. It is wrong, fix it. Fixes: 3ea3354cb9f0 ("badblocks: improve badblocks_check() for multiple ranges handling") Signed-off-by: Li Nan <linan122@huawei.com> Reviewed-by: Yu Kuai <yukuai3@huawei.com> Acked-by: Coly Li <colyli@kernel.org> Link: https://lore.kerne...
```diff diff --git a/block/badblocks.c b/block/badblocks.c index db4ec8b9b2a8..bcee057efc47 100644 --- a/block/badblocks.c +++ b/block/badblocks.c @@ -880,8 +880,8 @@ static int _badblocks_set(struct badblocks *bb, sector_t s, int sectors, /* round the start down, and the end up */ sector_t next = s + sectors; ...
85f72925000e924291a0ebf63d2234994a4f22bd
Analyze and fix the following issue in the Linux kernel code: block: Correctly initialize BLK_INTEGRITY_NOGENERATE and BLK_INTEGRITY_NOVERIFY
Problem Details: Currently, BLK_INTEGRITY_NOGENERATE and BLK_INTEGRITY_NOVERIFY are not explicitly set during integrity initialization. This can lead to incorrect reporting of read_verify and write_generate sysfs values, particularly when a device does not support integrity. Ensure that these flags are correctly initia...
```diff diff --git a/block/blk-settings.c b/block/blk-settings.c index 25fd7793fd9d..008947a13541 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -114,6 +114,7 @@ static int blk_validate_integrity_limits(struct queue_limits *lim) pr_warn("invalid PI settings.\n"); return -EINVAL; } + bi->fla...
677e332e4885a17def5efa4788b6e725a737b63c
Analyze and fix the following issue in the Linux kernel code: block: ensure correct integrity capability propagation in stacked devices
Problem Details: queue_limits_stack_integrity() incorrectly sets BLK_INTEGRITY_DEVICE_CAPABLE for a DM device even when none of its underlying devices support integrity. This happens because the flag is inherited unconditionally. Ensure that integrity capabilities are correctly propagated only when the underlying devic...
```diff diff --git a/block/blk-settings.c b/block/blk-settings.c index 2763a34a9d56..25fd7793fd9d 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -864,36 +864,28 @@ bool queue_limits_stack_integrity(struct queue_limits *t, if (!IS_ENABLED(CONFIG_BLK_DEV_INTEGRITY)) return true; - if (!ti->tuple_s...
391b41f983bf7ff853de44704d8e14e7cc648a9b
Analyze and fix the following issue in the Linux kernel code: gpio: rcar: Fix missing of_node_put() call
Problem Details: of_parse_phandle_with_fixed_args() requires its caller to call into of_node_put() on the node pointer from the output structure, but such a call is currently missing. Call into of_node_put() to rectify that. Fixes: 159f8a0209af ("gpio-rcar: Add DT support") Signed-off-by: Fabrizio Castro <fabrizio.ca...
```diff diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index 8e0544e92488..a7a1cdf7ac66 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c @@ -468,7 +468,12 @@ static int gpio_rcar_parse_dt(struct gpio_rcar_priv *p, unsigned int *npins) p->info = *info; ret = of_parse_phandle_w...
3db4404435397a345431b45f57876a3df133f3b4
Analyze and fix the following issue in the Linux kernel code: md/raid10: wait barrier before returning discard request with REQ_NOWAIT
Problem Details: raid10_handle_discard should wait barrier before returning a discard bio which has REQ_NOWAIT. And there is no need to print warning calltrace if a discard bio has REQ_NOWAIT flag. Quality engineer usually checks dmesg and reports error if dmesg has warning/error calltrace. Fixes: c9aa889b035f ("md: r...
```diff diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 1c2026682f86..9d8516acf2fd 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1624,11 +1624,10 @@ static int raid10_handle_discard(struct mddev *mddev, struct bio *bio) if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)) return -EAGA...
cf58c9434599730ee95fcfe1ee26874814e99080
Analyze and fix the following issue in the Linux kernel code: drm/i915/gt/uc: Fix typo in a comment
Problem Details: Fix typo in a comment. explaination -> explanation Signed-off-by: Yuichiro Tsuji <yuichtsu@amazon.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250224085638.3500-2-yuichtsu@amazon....
```diff diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c index 30ec92f1b2a4..48c01bfb7ad7 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -3008,7 +3008,7 @@ static int __guc_contex...
2b2d7ca7ce25fbec8389e7d85e57742caa47c97d
Analyze and fix the following issue in the Linux kernel code: dma-buf: fix incorrect dma-fence documentation v2
Problem Details: There isn't much worse than documentation giving an incorrect advise. Grabbing a spinlock while interrupts are disabled usually means that you must also disable interrupts for all other uses of this spinlock. Otherwise really hard to debug issues can occur. So fix that invalid documentation. v2: use ...
```diff diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h index e7ad819962e3..52587d390aca 100644 --- a/include/linux/dma-fence.h +++ b/include/linux/dma-fence.h @@ -169,8 +169,8 @@ struct dma_fence_ops { * implementation know that there is another driver waiting on the * signal (ie. hw->sw case)...
c0c9c73434666dc99ee156b25e7e722150bee001
Analyze and fix the following issue in the Linux kernel code: counter: microchip-tcb-capture: Fix undefined counter channel state on probe
Problem Details: Hardware initialize of the timer counter channel does not occur on probe thus leaving the Count in an undefined state until the first function_write() callback is executed. Fix this by performing the proper hardware initialization during probe. Fixes: 106b104137fd ("counter: Add microchip TCB capture ...
```diff diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c index 2f096a5b973d..c391ac38b990 100644 --- a/drivers/counter/microchip-tcb-capture.c +++ b/drivers/counter/microchip-tcb-capture.c @@ -368,6 +368,25 @@ static int mchp_tc_probe(struct platform_device *pdev) chann...
35d99c68af40a8ca175babc5a89ef7e2226fb3ca
Analyze and fix the following issue in the Linux kernel code: btrfs: fix a leaked chunk map issue in read_one_chunk()
Problem Details: Add btrfs_free_chunk_map() to free the memory allocated by btrfs_alloc_chunk_map() if btrfs_add_chunk_map() fails. Fixes: 7dc66abb5a47 ("btrfs: use a dedicated data structure for chunk maps") CC: stable@vger.kernel.org Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Filipe Manana <fdmanana@suse.com...
```diff diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index f6ae76815e4b..6f8dcf59b525 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -7151,6 +7151,7 @@ static int read_one_chunk(struct btrfs_key *key, struct extent_buffer *leaf, btrfs_err(fs_info, "failed to add chunk map, start=%llu len=%...
e26f1cfeac6712516bfeed80890da664f4f2e88a
Analyze and fix the following issue in the Linux kernel code: ASoC: cs42l43: Fix maximum ADC Volume
Problem Details: The range of ADC volume is -1 -> 3 (-6 to 18dB) so the number of levels should actually be 4. Fixes: fc918cbe874e ("ASoC: cs42l43: Add support for the cs42l43") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20250306133254.1861046-1-ckeepax@opensource.cirr...
```diff diff --git a/sound/soc/codecs/cs42l43.c b/sound/soc/codecs/cs42l43.c index 4257dbefe9dd..d307b56a7f38 100644 --- a/sound/soc/codecs/cs42l43.c +++ b/sound/soc/codecs/cs42l43.c @@ -1146,7 +1146,7 @@ static const struct snd_kcontrol_new cs42l43_controls[] = { SOC_DOUBLE_R_SX_TLV("ADC Volume", CS42L43_ADC_B_CTR...
7dfc9bdde9fa20cf1ac5cbea97b0446622ca74c7
Analyze and fix the following issue in the Linux kernel code: spi: stm32-ospi: Fix an IS_ERR() vs NULL bug in stm32_ospi_get_resources()
Problem Details: The devm_ioremap() function returns NULL on error, it doesn't return error pointers. Fix the check to match. Fixes: 79b8a705e26c ("spi: stm32: Add OSPI driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Link: https://patch.msgid...
```diff diff --git a/drivers/spi/spi-stm32-ospi.c b/drivers/spi/spi-stm32-ospi.c index 8eadcb64f34a..a544d7897edf 100644 --- a/drivers/spi/spi-stm32-ospi.c +++ b/drivers/spi/spi-stm32-ospi.c @@ -835,10 +835,10 @@ static int stm32_ospi_get_resources(struct platform_device *pdev) if (rmem) { ospi->mm_size = rmem->si...
2c2eadd07e747059ccd65e68cd1d1b23ca96b072
Analyze and fix the following issue in the Linux kernel code: ASoC: cs42l43: convert to SYSTEM_SLEEP_PM_OPS
Problem Details: The custom suspend function causes a build warning when CONFIG_PM_SLEEP is disabled: sound/soc/codecs/cs42l43.c:2405:12: error: unused function 'cs42l43_codec_runtime_force_suspend' [-Werror,-Wunused-function] Change SET_SYSTEM_SLEEP_PM_OPS() to the newer SYSTEM_SLEEP_PM_OPS(), to avoid this. Fixes:...
```diff diff --git a/sound/soc/codecs/cs42l43.c b/sound/soc/codecs/cs42l43.c index 4257dbefe9dd..e0d630c262f6 100644 --- a/sound/soc/codecs/cs42l43.c +++ b/sound/soc/codecs/cs42l43.c @@ -2417,7 +2417,7 @@ static int cs42l43_codec_runtime_force_suspend(struct device *dev) static const struct dev_pm_ops cs42l43_codec_...
269b844239149a9bbaba66518db99ebb06554a15
Analyze and fix the following issue in the Linux kernel code: ASoC: dapm: Fix changes to DECLARE_ADAU17X1_DSP_MUX_CTRL
Problem Details: The changes to DECLARE_ADAU17X1_DSP_MUX_CTRL did avoid the issue with a compiler not liking all the macro indirection. However it introduced a new issue with respect to the mux not being declared static: sound/soc/codecs/adau17x1.c:275:8: sparse: sparse: symbol 'adau17x1_dac_mux' was not declared. Sho...
```diff diff --git a/sound/soc/codecs/adau17x1.c b/sound/soc/codecs/adau17x1.c index 2ebb5c90bdd9..0b6b0d2115eb 100644 --- a/sound/soc/codecs/adau17x1.c +++ b/sound/soc/codecs/adau17x1.c @@ -254,13 +254,11 @@ static int adau17x1_dsp_mux_enum_get(struct snd_kcontrol *kcontrol, } #define DECLARE_ADAU17X1_DSP_MUX_CTRL...
83437689249e6a17b25e27712fbee292e42e7855
Analyze and fix the following issue in the Linux kernel code: RDMA/erdma: Prevent use-after-free in erdma_accept_newconn()
Problem Details: After the erdma_cep_put(new_cep) being called, new_cep will be freed, and the following dereference will cause a UAF problem. Fix this issue. Fixes: 920d93eac8b9 ("RDMA/erdma: Add connection management (CM) support") Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Cheng Xu...
```diff diff --git a/drivers/infiniband/hw/erdma/erdma_cm.c b/drivers/infiniband/hw/erdma/erdma_cm.c index 1b23c698ec25..e0acc185e719 100644 --- a/drivers/infiniband/hw/erdma/erdma_cm.c +++ b/drivers/infiniband/hw/erdma/erdma_cm.c @@ -709,7 +709,6 @@ error: erdma_cancel_mpatimer(new_cep); erdma_cep_put(new_cep)...
fb8286562ecfb585e26b033c5e32e6fb85efb0b3
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_tables: make destruction work queue pernet
Problem Details: The call to flush_work before tearing down a table from the netlink notifier was supposed to make sure that all earlier updates (e.g. rule add) that might reference that table have been processed. Unfortunately, flush_work() waits for the last queued instance. This could be an instance that is differe...
```diff diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index 60d5dcdb289c..803d5f1601f9 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h @@ -1891,7 +1891,7 @@ void nft_chain_filter_fini(void); void __init nft_chain_route_init(void); void nft_ch...
b5e3956535466187657563b754ba0f1da8626c7f
Analyze and fix the following issue in the Linux kernel code: kbuild: install-extmod-build: Fix build when specifying KBUILD_OUTPUT
Problem Details: Since commit 5f73e7d0386d ("kbuild: refactor cross-compiling linux-headers package"), the linux-headers pacman package fails to build when "O=" is set. The build system complains: /mnt/chroot/linux/scripts/Makefile.build:41: mnt/chroots/linux-mainline/pacman/linux-upstream/pkg/linux-upstream-headers/u...
```diff diff --git a/scripts/package/install-extmod-build b/scripts/package/install-extmod-build index 2966473b4660..b96538787f3d 100755 --- a/scripts/package/install-extmod-build +++ b/scripts/package/install-extmod-build @@ -63,7 +63,7 @@ if [ "${CC}" != "${HOSTCC}" ]; then # Clear VPATH and srcroot because the sou...
9af152dcf1a06f589f44a74da4ad67e365d4db9a
Analyze and fix the following issue in the Linux kernel code: drm/gma500: Add NULL check for pci_gfx_root in mid_get_vbt_data()
Problem Details: Since pci_get_domain_bus_and_slot() can return NULL, add NULL check for pci_gfx_root in the mid_get_vbt_data(). This change is similar to the checks implemented in mid_get_fuse_settings() and mid_get_pci_revID(), which were introduced by commit 0cecdd818cd7 ("gma500: Final enables for Oaktrail") as "a...
```diff diff --git a/drivers/gpu/drm/gma500/mid_bios.c b/drivers/gpu/drm/gma500/mid_bios.c index 7e76790c6a81..cba97d7db131 100644 --- a/drivers/gpu/drm/gma500/mid_bios.c +++ b/drivers/gpu/drm/gma500/mid_bios.c @@ -279,6 +279,11 @@ static void mid_get_vbt_data(struct drm_psb_private *dev_priv) 0, PCI_DEVFN(2,...
fa6192adc32f4fdfe5b74edd5b210e12afd6ecc0
Analyze and fix the following issue in the Linux kernel code: uprobes/x86: Harden uretprobe syscall trampoline check
Problem Details: Jann reported a possible issue when trampoline_check_ip returns address near the bottom of the address space that is allowed to call into the syscall if uretprobes are not set up: https://lore.kernel.org/bpf/202502081235.5A6F352985@keescook/T/#m9d416df341b8fbc11737dacbcd29f0054413cbbf Though the m...
```diff diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c index 5a952c5ea66b..9194695662b2 100644 --- a/arch/x86/kernel/uprobes.c +++ b/arch/x86/kernel/uprobes.c @@ -357,19 +357,23 @@ void *arch_uprobe_trampoline(unsigned long *psize) return &insn; } -static unsigned long trampoline_check_ip(void)...