id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
0719bc3a5c77091192c57e440896a969cd1cf885
Analyze and fix the following issue in the Linux kernel code: net: fec: do not double-parse 'phy-reset-active-high' property
Problem Details: Conversion to gpiod API done in commit 468ba54bd616 ("fec: convert to gpio descriptor") clashed with gpiolib applying the same quirk to the reset GPIO polarity (introduced in commit b02c85c9458c). This results in the reset line being left active/device being left in reset state when reset line is "acti...
```diff diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 00115b55d0ff..c73e25f8995e 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -4036,7 +4036,6 @@ free_queue_mem: static int fec_reset_phy(struct platfo...
d7b5e5dd669436328dbf41d89af09b3fa5de3b95
Analyze and fix the following issue in the Linux kernel code: net: fec: restore handling of PHY reset line as optional
Problem Details: Conversion of the driver to gpiod API done in 468ba54bd616 ("fec: convert to gpio descriptor") incorrectly made reset line mandatory and resulted in aborting driver probe in cases where reset line was not specified (note: this way of specifying PHY reset line is actually deprecated). Switch to using d...
```diff diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 2716898e0b9b..00115b55d0ff 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -4056,12 +4056,15 @@ static int fec_reset_phy(struct platform_device *pdev...
727f083ff48ae94cd7422e42bb9513ab61160e8a
Analyze and fix the following issue in the Linux kernel code: crypto: stm32/hash - Use existing busy poll function
Problem Details: When exporting state we are waiting indefinitely in the same was as the ordinary stm32_hash_wait_busy() poll-for-completion function but without a timeout, which means we could hang in an eternal loop. Fix this by waiting for completion like the rest of the code. Acked-by: Lionel Debieve <lionel.debie...
```diff diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c index 0473ced7b4ea..cc0a4e413a82 100644 --- a/drivers/crypto/stm32/stm32-hash.c +++ b/drivers/crypto/stm32/stm32-hash.c @@ -960,11 +960,13 @@ static int stm32_hash_export(struct ahash_request *req, void *out) struct stm32_hash_...
3ce2d5971522adfdec9b17182ce9e513a26707e1
Analyze and fix the following issue in the Linux kernel code: crypto: img-hash - Fix sparse endianness warning
Problem Details: Use cpu_to_be32 instead of be32_to_cpu in img_hash_read_result_queue to silence sparse. The generated code should be identical. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
```diff diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c index 9629e98bd68b..e5ed098a154d 100644 --- a/drivers/crypto/img-hash.c +++ b/drivers/crypto/img-hash.c @@ -157,9 +157,9 @@ static inline void img_hash_write(struct img_hash_dev *hdev, writel_relaxed(value, hdev->io_base + offset); } -stati...
46a334a98f585ef78d51d8f5736596887bdd7f54
Analyze and fix the following issue in the Linux kernel code: crypto: ccp - Flush the SEV-ES TMR memory before giving it to firmware
Problem Details: Perform a cache flush on the SEV-ES TMR memory after allocation to prevent any possibility of the firmware encountering an error should dirty cache lines be present. Use clflush_cache_range() to flush the SEV-ES TMR memory. Fixes: 97f9ac3db661 ("crypto: ccp - Add support for SEV-ES to the PSP driver")...
```diff diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c index 13f1c88810d8..e2f25926eb51 100644 --- a/drivers/crypto/ccp/sev-dev.c +++ b/drivers/crypto/ccp/sev-dev.c @@ -26,6 +26,7 @@ #include <linux/fs_struct.h> #include <asm/smp.h> +#include <asm/cacheflush.h> #include "psp-dev.h" #in...
354bb4a0e0b6be8f55bacbe7f08c94b4741f5658
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Initialize tc in xdp_synproxy
Problem Details: xdp_synproxy/xdp fails in CI with: Error: bpf_tc_hook_create: File exists The XDP version of the test should not be calling bpf_tc_hook_create(); the reason it's happening anyway is that if we don't specify --tc on the command line, tc variable remains uninitialized. Fixes: 784d5dc0efc2 ("selfte...
```diff diff --git a/tools/testing/selftests/bpf/xdp_synproxy.c b/tools/testing/selftests/bpf/xdp_synproxy.c index 410a1385a01d..6dbe0b745198 100644 --- a/tools/testing/selftests/bpf/xdp_synproxy.c +++ b/tools/testing/selftests/bpf/xdp_synproxy.c @@ -116,6 +116,7 @@ static void parse_options(int argc, char *argv[], uns...
cb80242cc679d6397e77d8a964deeb3ff218d2b5
Analyze and fix the following issue in the Linux kernel code: riscv: stacktrace: Fix missing the first frame
Problem Details: When running kfence_test, I found some testcases failed like this: # test_out_of_bounds_read: EXPECTATION FAILED at mm/kfence/kfence_test.c:346 Expected report_matches(&expect) to be true, but is false not ok 1 - test_out_of_bounds_read The corresponding call-trace is: BUG: KFENCE: out-of-bounds...
```diff diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c index 75c8dd64fc48..f9a5a7c90ff0 100644 --- a/arch/riscv/kernel/stacktrace.c +++ b/arch/riscv/kernel/stacktrace.c @@ -32,6 +32,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, fp = (unsigned long)__b...
1e70c680375aa33cca97bff0bca68c0f82f5023c
Analyze and fix the following issue in the Linux kernel code: x86/tdx: Do not corrupt frame-pointer in __tdx_hypercall()
Problem Details: If compiled with CONFIG_FRAME_POINTER=y, objtool is not happy that __tdx_hypercall() messes up RBP: objtool: __tdx_hypercall+0x7f: return with modified stack frame Rework the function to store TDX_HCALL_ flags on stack instead of RBP. [ dhansen: minor changelog tweaks ] Fixes: c30c4b2555ba ("x86/...
```diff diff --git a/arch/x86/coco/tdx/tdcall.S b/arch/x86/coco/tdx/tdcall.S index 5da06d1a9ba3..2bd436a4790d 100644 --- a/arch/x86/coco/tdx/tdcall.S +++ b/arch/x86/coco/tdx/tdcall.S @@ -131,11 +131,10 @@ SYM_FUNC_START(__tdx_hypercall) push %r13 push %r12 push %rbx - push %rbp /* Free RDI and RSI to be used ...
608723c41cd951fb32ade2f8371e61c270816175
Analyze and fix the following issue in the Linux kernel code: rcu/kvfree: Add kvfree_rcu_mightsleep() and kfree_rcu_mightsleep()
Problem Details: The kvfree_rcu() and kfree_rcu() APIs are hazardous in that if you forget the second argument, it works, but might sleep. This sleeping can be a correctness bug from atomic contexts, and even in non-atomic contexts it might introduce unacceptable latencies. This commit therefore adds kvfree_rcu_might...
```diff diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index f38d4469d7f3..84433600885a 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -1004,6 +1004,9 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) #define kvfree_rcu(...) KVFREE_GET_MACRO(__VA_ARGS__, \ ...
a222d7d96b586d4f1d54803c28383718f87730a9
Analyze and fix the following issue in the Linux kernel code: dt-bindings: phy: hisilicon: Fix 'hisilicon,eye-diagram-param' differing types
Problem Details: 'hisilicon,eye-diagram-param' is also defined in hisilicon,phy-hi3670-pcie.yaml as a 'uint32-array'. Unify it to use 'uint32-array' everywhere. Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org> Link: https://lore.kernel.org/r/20230125221444.3058631-1-robh@kernel.org Signed-off-by: Rob Herring <r...
```diff diff --git a/Documentation/devicetree/bindings/phy/hisilicon,hi3660-usb3.yaml b/Documentation/devicetree/bindings/phy/hisilicon,hi3660-usb3.yaml index 20b79e2e8b82..b11d9873854a 100644 --- a/Documentation/devicetree/bindings/phy/hisilicon,hi3660-usb3.yaml +++ b/Documentation/devicetree/bindings/phy/hisilicon,hi...
5dfb29d444daf94120762e9d7b9fe6aa4e0f9929
Analyze and fix the following issue in the Linux kernel code: drm/i915/guc: Improve debug message on context reset notification
Problem Details: Just recently we switched over to new GuC oriented log macros but in the meantime yet another message was added that we missed to update. While around improve that new message by adding engine name and use existing helpers to check for context state. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@...
```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 53f3ed3244d5..be495e657d66 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -4660,9 +4660,10 @@ static void guc_handle...
707344c8a188bb1d6704d3546229fc7a07c01a63
Analyze and fix the following issue in the Linux kernel code: dt-bindings: interrupt-controller: arm,gic-v3: Fix typo in description of msi-controller property
Problem Details: Fix typo functionnality -> functionality. Signed-off-by: Lad Prabhakar <prabhakar.csengg@gmail.com> Link: https://lore.kernel.org/r/20230130234335.13952-1-prabhakar.csengg@gmail.com Signed-off-by: Rob Herring <robh@kernel.org>
```diff diff --git a/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml b/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml index 9f7d3e11aacb..8449e14af9f3 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml +++ b/Documentation/devicetree/binding...
08f379d98731a7014ee6987508d1228cb56ce694
Analyze and fix the following issue in the Linux kernel code: dt-bindings: Fix .gitignore
Problem Details: The tracked files should not be ignored. Fixes: 44ec8b20d1e9 ("dt-bindings: Add running yamllint to dt_binding_check") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230127150225.18148-1-andriy.shevchenko@linux.intel.com Signed-off-by: Rob Herring ...
```diff diff --git a/Documentation/devicetree/bindings/.gitignore b/Documentation/devicetree/bindings/.gitignore index a77719968a7e..51ddb26d93f0 100644 --- a/Documentation/devicetree/bindings/.gitignore +++ b/Documentation/devicetree/bindings/.gitignore @@ -2,3 +2,8 @@ *.example.dts /processed-schema*.yaml /process...
f6933c01e42d2fc83b9133ed755609e4aac6eadd
Analyze and fix the following issue in the Linux kernel code: of/address: Return an error when no valid dma-ranges are found
Problem Details: Commit 7a8b64d17e35 ("of/address: use range parser for of_dma_get_range") converted the parsing of dma-range properties to use code shared with the PCI range parser. The intent was to introduce no functional changes however in the case where we fail to translate the first resource instead of returning ...
```diff diff --git a/drivers/of/address.c b/drivers/of/address.c index c34ac33b7338..67763e5b8c0e 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -965,8 +965,19 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map) } of_dma_range_parser_init(&parser, node); - for_each_...
241d2fb56a18473af5f2ff0d512992a996eb64dd
Analyze and fix the following issue in the Linux kernel code: of: Make OF framebuffer device names unique
Problem Details: Since Linux 5.19 this error is observed: sysfs: cannot create duplicate filename '/devices/platform/of-display' This is because multiple devices with the same name 'of-display' are created on the same bus. Update the code to create numbered device names for the displays. Also, fix a node refcounting...
```diff diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 81c8c227ab6b..b3878a98d27f 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -525,6 +525,7 @@ static int __init of_platform_default_populate_init(void) if (IS_ENABLED(CONFIG_PPC)) { struct device_node *boot_display = NULL; ...
b09ee1cd59918bcf1a6793b663034b6e345b3ced
Analyze and fix the following issue in the Linux kernel code: platform/surface: aggregator: Rename top-level request functions to avoid ambiguities
Problem Details: We currently have a struct ssam_request_sync and a function ssam_request_sync(). While this is valid C, there are some downsides to it. One of these is that current Sphinx versions (>= 3.0) cannot disambiguate between the two (see disucssion and pull request linked below). It instead emits a "WARNING:...
```diff diff --git a/Documentation/driver-api/surface_aggregator/client.rst b/Documentation/driver-api/surface_aggregator/client.rst index 9d7411223a84..e100ab0a24cc 100644 --- a/Documentation/driver-api/surface_aggregator/client.rst +++ b/Documentation/driver-api/surface_aggregator/client.rst @@ -19,7 +19,7 @@ .. |ss...
13eca7d74e331deb5924ad0555355c114a59def2
Analyze and fix the following issue in the Linux kernel code: platform/surface: aggregator_registry: Fix target-ID of base-hub
Problem Details: The target ID of the base hub is currently set to KIP (keyboard/ peripherals). However, even though it manages such devices with the KIP target ID, the base hub itself is actually accessed via the SAM target ID. So set it accordingly. Note that the target ID of the hub can be chosen arbitrarily and do...
```diff diff --git a/drivers/platform/surface/surface_aggregator_hub.c b/drivers/platform/surface/surface_aggregator_hub.c index 6abd1efe2088..8b8b80228c14 100644 --- a/drivers/platform/surface/surface_aggregator_hub.c +++ b/drivers/platform/surface/surface_aggregator_hub.c @@ -349,7 +349,7 @@ static const struct ssam_...
2730fc0ab4716bb5d884a8dbd3b0ac73317cfb54
Analyze and fix the following issue in the Linux kernel code: platform/surface: aggregator: Add target and source IDs to command trace events
Problem Details: Add command source and target IDs to trace events. Tracing support for the Surface Aggregator driver was originally implemented at a time when only two peers were known: Host and SAM. We now know that there are at least five, with three actively being used (Host, SAM, KIP; four with Debug if you want ...
```diff diff --git a/drivers/platform/surface/aggregator/trace.h b/drivers/platform/surface/aggregator/trace.h index 2a2c17771d01..55cc61bba1da 100644 --- a/drivers/platform/surface/aggregator/trace.h +++ b/drivers/platform/surface/aggregator/trace.h @@ -96,6 +96,7 @@ TRACE_DEFINE_ENUM(SSAM_SSH_TC_POS); #define SSAM_S...
6f10f2ec61c7968b44428c551b1b06a4c5e4e544
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Finalise EL2 state from pKVM PSCI relay
Problem Details: The EL2 state is not initialised correctly when a CPU comes out of CPU_{SUSPEND,OFF} as the finalise_el2 function is not being called. Let's directly call finalise_el2_state from this path to solve the issue. Fixes: 504ee23611c4 ("arm64: Add the arm64.nosve command line option") Signed-off-by: Quentin...
```diff diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-init.S b/arch/arm64/kvm/hyp/nvhe/hyp-init.S index c953fb4b9a13..a6d67c2bb5ae 100644 --- a/arch/arm64/kvm/hyp/nvhe/hyp-init.S +++ b/arch/arm64/kvm/hyp/nvhe/hyp-init.S @@ -183,6 +183,7 @@ SYM_CODE_START_LOCAL(__kvm_hyp_init_cpu) /* Initialize EL2 CPU state to sane valu...
a84153f939808102dfa10904aa0f743e734a3e1d
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to update age extent in f2fs_do_zero_range()
Problem Details: We should update age extent in f2fs_do_zero_range() like we did in f2fs_truncate_data_blocks_range(). Fixes: 71644dff4811 ("f2fs: add block_age-based extent cache") Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
```diff diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index a83117325b87..a17aca50c18c 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1494,6 +1494,7 @@ static int f2fs_do_zero_range(struct dnode_of_data *dn, pgoff_t start, } f2fs_update_read_extent_cache_range(dn, start, 0, index - start); + f2fs_update_age_...
8c0ed062ce27f6b7f0a568cb241e2b4dd2d9e6a6
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to update age extent correctly during truncation
Problem Details: nr_free may be less than len, we should update age extent cache w/ range [fofs, len] rather than [fofs, nr_free]. Fixes: 71644dff4811 ("f2fs: add block_age-based extent cache") Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
```diff diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index f05148a9dc99..a83117325b87 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -617,7 +617,7 @@ void f2fs_truncate_data_blocks_range(struct dnode_of_data *dn, int count) fofs = f2fs_start_bidx_of_node(ofs_of_node(dn->node_page), dn->inode) + ofs; ...
0dbbf0fb38d5ec5d4138d1aeaeb43d9217b9a592
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to avoid potential memory corruption in __update_iostat_latency()
Problem Details: Add iotype sanity check to avoid potential memory corruption. This is to fix the compile error below: fs/f2fs/iostat.c:231 __update_iostat_latency() error: buffer overflow 'io_lat->peak_lat[type]' 3 <= 3 vim +228 fs/f2fs/iostat.c 211 static inline void __update_iostat_latency(struct bio_iostat_ct...
```diff diff --git a/fs/f2fs/iostat.c b/fs/f2fs/iostat.c index ed8176939aa5..96637756eae8 100644 --- a/fs/f2fs/iostat.c +++ b/fs/f2fs/iostat.c @@ -223,8 +223,12 @@ static inline void __update_iostat_latency(struct bio_iostat_ctx *iostat_ctx, return; ts_diff = jiffies - iostat_ctx->submit_ts; - if (iotype >= META...
933141e4eb49d8b48721e2377835063a1e8fb823
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to handle F2FS_IOC_START_ATOMIC_REPLACE in f2fs_compat_ioctl()
Problem Details: Otherwise, 32-bits binary call ioctl(F2FS_IOC_START_ATOMIC_REPLACE) will fail in 64-bits kernel. Fixes: 41e8f85a75fc ("f2fs: introduce F2FS_IOC_START_ATOMIC_REPLACE") Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
```diff diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 65199574cd7d..f05148a9dc99 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -4814,6 +4814,7 @@ long f2fs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) case F2FS_IOC32_MOVE_RANGE: return f2fs_compat_ioc_move_range(file, arg); cas...
2eae077e6e46f9046d383631145750e043820dce
Analyze and fix the following issue in the Linux kernel code: f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info
Problem Details: This patch tries to use bitfield in struct f2fs_io_info to improve memory usage. struct f2fs_io_info { ... unsigned int need_lock:8; /* indicate we need to lock cp_rwsem */ unsigned int version:8; /* version of the node */ unsigned int submitted:1; /* indicate IO submission */ unsigned int in_lis...
```diff diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 7e2b44db1587..89ce08b0ff7c 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -70,7 +70,7 @@ static struct page *__get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index, .old_blkaddr = index, .new_blkaddr = index, .encrypted_pa...
3e46d910d8acf94e5360126593b68bf4fee4c4a1
Analyze and fix the following issue in the Linux kernel code: tracing: Fix poll() and select() do not work on per_cpu trace_pipe and trace_pipe_raw
Problem Details: poll() and select() on per_cpu trace_pipe and trace_pipe_raw do not work since kernel 6.1-rc6. This issue is seen after the commit 42fb0a1e84ff525ebe560e2baf9451ab69127e2b ("tracing/ring-buffer: Have polling block on watermark"). This issue is firstly detected and reported, when testing the CXL error ...
```diff diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 78ed5f1baa8c..c9e40f692650 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -9148,9 +9148,6 @@ buffer_percent_write(struct file *filp, const char __user *ubuf, if (val > 100) return -EINVAL; - if (!val) - val = 1; - tr->buff...
3432e57493c278c1cb48abc2d69c6c055a19723e
Analyze and fix the following issue in the Linux kernel code: jffs2: Fix list_del corruption if compressors initialized failed
Problem Details: There is a list_del corruption when remove the jffs2 module: list_del corruption, ffffffffa0623e60->next is NULL WARNING: CPU: 6 PID: 6332 at lib/list_debug.c:49 __list_del_entry_valid+0x98/0x130 Modules linked in: jffs2(-) ] CPU: 6 PID: 6332 Comm: rmmod Tainted: G W 6.1.0-rc2+...
```diff diff --git a/fs/jffs2/compr.c b/fs/jffs2/compr.c index afe74c65f1e4..764f19dec3f0 100644 --- a/fs/jffs2/compr.c +++ b/fs/jffs2/compr.c @@ -364,12 +364,24 @@ void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig) int __init jffs2_compressors_init(void) { + int ret = 0; /* Registering compres...
d5711ae52d5a548d16e5c177c92c15338ec63624
Analyze and fix the following issue in the Linux kernel code: jffs2: Use function instead of macro when initialize compressors
Problem Details: The initialized compressors should be released if one of them initialize fail, this is the pre-patch for fix the problem, use function instead of the macro in jffs2_compressors_init() to simplify the codes, no functional change intended. Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com> Signed-off...
```diff diff --git a/fs/jffs2/compr.c b/fs/jffs2/compr.c index 4849a4c9a0e2..afe74c65f1e4 100644 --- a/fs/jffs2/compr.c +++ b/fs/jffs2/compr.c @@ -365,19 +365,12 @@ void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig) int __init jffs2_compressors_init(void) { /* Registering compressors */ -#ifdef C...
7198c9c00338287fe364d76bba35b3b10feec3c5
Analyze and fix the following issue in the Linux kernel code: jffs2: fix spelling mistake "neccecary"->"necessary"
Problem Details: There is a spelling mistake in comment. Fix it. Signed-off-by: Yu Zhe <yuzhe@nfschina.com> Signed-off-by: Richard Weinberger <richard@nod.at>
```diff diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index 66af51c41619..e952b0bd548b 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c @@ -403,7 +403,7 @@ int jffs2_do_remount_fs(struct super_block *sb, struct fs_context *fc) /* We stop if it was running, then restart if it needs to. This also catches the case where...
422125232f6200f0490b7d7fb97722723eb8876d
Analyze and fix the following issue in the Linux kernel code: ubifs: Fix kernel-doc
Problem Details: Fix function name in fs/ubifs/io.c kernel-doc comment to remove some warnings found by clang(make W=1 LLVM=1). fs/ubifs/io.c:497: warning: expecting prototype for wbuf_timer_callback(). Prototype was for wbuf_timer_callback_nolock() instead fs/ubifs/io.c:513: warning: expecting prototype for new_wbuf_...
```diff diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c index 1607a3c76681..01d8eb170382 100644 --- a/fs/ubifs/io.c +++ b/fs/ubifs/io.c @@ -488,7 +488,7 @@ void ubifs_prep_grp_node(struct ubifs_info *c, void *node, int len, int last) } /** - * wbuf_timer_callback - write-buffer timer callback function. + * wbuf_timer_ca...
415c94532ebb2838dc9e2e5a5e609a6140caa5c5
Analyze and fix the following issue in the Linux kernel code: ubifs: Fix some kernel-doc comments
Problem Details: Remove warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. fs/ubifs/journal.c:1221: warning: Function parameter or member 'old_inode' not described in 'ubifs_jnl_rename' fs/ubifs/journal.c:1221: warning: Function parameter or member 'old_nm' not described in 'ubifs_jnl_re...
```diff diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index d02509920baf..dc52ac0f4a34 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c @@ -1201,9 +1201,13 @@ out_free: * ubifs_jnl_rename - rename a directory entry. * @c: UBIFS file-system description object * @old_dir: parent inode of directory en...
b5dd034f8f4a8405713842fb0a6f35e5062d95b7
Analyze and fix the following issue in the Linux kernel code: UBI: Fastmap: Fix kernel-doc
Problem Details: drivers/mtd/ubi/fastmap.c:104: warning: expecting prototype for new_fm_vhdr(). Prototype was for new_fm_vbuf() instead. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2289 Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Signed-off...
```diff diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c index ca2d9efe62c3..28c8151a0725 100644 --- a/drivers/mtd/ubi/fastmap.c +++ b/drivers/mtd/ubi/fastmap.c @@ -93,7 +93,7 @@ size_t ubi_calc_fm_size(struct ubi_device *ubi) /** - * new_fm_vhdr - allocate a new volume header for fastmap usage. ...
4d57a7333e26040f2b583983e1970d9d460e56b0
Analyze and fix the following issue in the Linux kernel code: ubi: ubi_wl_put_peb: Fix infinite loop when wear-leveling work failed
Problem Details: Following process will trigger an infinite loop in ubi_wl_put_peb(): ubifs_bgt ubi_bgt ubifs_leb_unmap ubi_leb_unmap ubi_eba_unmap_leb ubi_wl_put_peb wear_leveling_worker e1 = rb_entry(rb_first(&ubi->used) e2 = get_peb_for_wl(ubi) ubi_io_read_vid_hdr ...
```diff diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index f45df3b77373..9e14319225c9 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c @@ -976,11 +976,11 @@ out_error: spin_lock(&ubi->wl_lock); ubi->move_from = ubi->move_to = NULL; ubi->move_to_put = ubi->wl_scheduled = 0; + wl_entry_destr...
a240bc5c43130c6aa50831d7caaa02a1d84e1bce
Analyze and fix the following issue in the Linux kernel code: ubi: Fix UAF wear-leveling entry in eraseblk_count_seq_show()
Problem Details: Wear-leveling entry could be freed in error path, which may be accessed again in eraseblk_count_seq_show(), for example: __erase_worker eraseblk_count_seq_show wl = ubi->lookuptbl[*block_number] if (wl) wl_entry_destroy ubi->lookuptbl[e->pnum] =...
```diff diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 68eb0f21b3fe..f45df3b77373 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c @@ -890,8 +890,11 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk, err = do_sync_erase(ubi, e1, vol_id, lnum, 0); if (err) ...
76f9476ece445a07aeb72df9d896cd563fb5b50f
Analyze and fix the following issue in the Linux kernel code: ubi: fastmap: Fix missed fm_anchor PEB in wear-leveling after disabling fastmap
Problem Details: After disabling fastmap(ubi->fm_disabled = 1), fastmap won't be updated, fm_anchor PEB is missed being scheduled for erasing. Besides, fm_anchor PEB may have smallest erase count, it doesn't participate wear-leveling. The difference of erase count between fm_anchor PEB and other PEBs will be larger and...
```diff diff --git a/drivers/mtd/ubi/fastmap-wl.c b/drivers/mtd/ubi/fastmap-wl.c index 0ee452275578..863f571f1adb 100644 --- a/drivers/mtd/ubi/fastmap-wl.c +++ b/drivers/mtd/ubi/fastmap-wl.c @@ -146,13 +146,15 @@ void ubi_refill_pools(struct ubi_device *ubi) if (ubi->fm_anchor) { wl_tree_add(ubi->fm_anchor, &ubi->...
66f4742e93523ab2f062d9d9828b3e590bc61536
Analyze and fix the following issue in the Linux kernel code: ubifs: ubifs_releasepage: Remove ubifs_assert(0) to valid this process
Problem Details: There are two states for ubifs writing pages: 1. Dirty, Private 2. Not Dirty, Not Private The normal process cannot go to ubifs_releasepage() which means there exists pages being private but not dirty. Reproducer[1] shows that it could occur (which maybe related to [2]) with following process: P...
```diff diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 1f429260a85f..10c1779af9c5 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -1472,14 +1472,23 @@ static bool ubifs_release_folio(struct folio *folio, gfp_t unused_gfp_flags) struct inode *inode = folio->mapping->host; struct ubifs_info *c = inode->i_...
fb8bc4c74ae4526d9489362ab2793a936d072b84
Analyze and fix the following issue in the Linux kernel code: ubifs: ubifs_writepage: Mark page dirty after writing inode failed
Problem Details: There are two states for ubifs writing pages: 1. Dirty, Private 2. Not Dirty, Not Private There is a third possibility which maybe related to [1] that page is private but not dirty caused by following process: PA lock(page) ubifs_write_end attach_page_private // set Private __set_pag...
```diff diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index f2353dd676ef..1f429260a85f 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -1032,7 +1032,7 @@ static int ubifs_writepage(struct page *page, struct writeback_control *wbc) if (page->index >= synced_i_size >> PAGE_SHIFT) { err = inode->i_sb->s_op->...
122deabfe1428bffe95e2bf364ff8a5059bdf089
Analyze and fix the following issue in the Linux kernel code: ubifs: dirty_cow_znode: Fix memleak in error handling path
Problem Details: Following process will cause a memleak for copied up znode: dirty_cow_znode zn = copy_znode(c, znode); err = insert_old_idx(c, zbr->lnum, zbr->offs); if (unlikely(err)) return ERR_PTR(err); // No one refers to zn. Fix it by adding copied znode back to tnc, then it will be freed by ubifs_...
```diff diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c index 2df56bbc6865..2469f72eeaab 100644 --- a/fs/ubifs/tnc.c +++ b/fs/ubifs/tnc.c @@ -267,11 +267,18 @@ static struct ubifs_znode *dirty_cow_znode(struct ubifs_info *c, if (zbr->len) { err = insert_old_idx(c, zbr->lnum, zbr->offs); if (unlikely(err)) - retu...
944e096aa24071d3fe22822f6249d3ae309e39ea
Analyze and fix the following issue in the Linux kernel code: ubifs: Re-statistic cleaned znode count if commit failed
Problem Details: Dirty znodes will be written on flash in committing process with following states: process A | znode state ------------------------------------------------------ do_commit | DIRTY_ZNODE ubifs_tnc_start_commit | DIRTY_ZNODE get_znodes_to_commit | DIRTY_ZNODE | COW_ZNODE layout_...
```diff diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c index 488f3da7a6c6..2df56bbc6865 100644 --- a/fs/ubifs/tnc.c +++ b/fs/ubifs/tnc.c @@ -3053,6 +3053,21 @@ static void tnc_destroy_cnext(struct ubifs_info *c) cnext = cnext->cnext; if (ubifs_zn_obsolete(znode)) kfree(znode); + else if (!ubifs_zn_cow(znode)) ...
2de203d8ab51657664a60f2d4cd89cb7d75b7eac
Analyze and fix the following issue in the Linux kernel code: ubi: Fix permission display of the debugfs files
Problem Details: Some interface files in debugfs support the read method dfs_file_read(), but their rwx permissions is shown as unreadable. In the user mode, the following problem can be clearly seen: # ls -l /sys/kernel/debug/ubi/ubi0/ total 0 --w------- 1 root root 0 Oct 22 16:26 chk_fastmap --w------- 1 root r...
```diff diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c index fcca6942dbdd..27168f511d6d 100644 --- a/drivers/mtd/ubi/debug.c +++ b/drivers/mtd/ubi/debug.c @@ -504,6 +504,7 @@ int ubi_debugfs_init_dev(struct ubi_device *ubi) { unsigned long ubi_num = ubi->ubi_num; struct ubi_debug_info *d = &ubi->db...
c15859bfd326c10230f09cb48a17f8a35f190342
Analyze and fix the following issue in the Linux kernel code: ubi: Fix possible null-ptr-deref in ubi_free_volume()
Problem Details: It willl cause null-ptr-deref in the following case: uif_init() ubi_add_volume() cdev_add() -> if it fails, call kill_volumes() device_register() kill_volumes() -> if ubi_add_volume() fails call this function ubi_free_volume() cdev_del() device_unregister() -> trying to delete a n...
```diff diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index eaf3c0c86b2b..5e90a4423b69 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -470,6 +470,7 @@ static int uif_init(struct ubi_device *ubi) err = ubi_add_volume(ubi, ubi->volumes[i]); if (err) { ubi_err(ubi, "can...
7af73882dd1cea5d32ac0cc9eda263635295de50
Analyze and fix the following issue in the Linux kernel code: ubi: fastmap: Add fastmap control support for module parameter
Problem Details: The UBI driver can use the IOCTL to disable the fastmap after the mainline 669d204469c4 ("ubi: fastmap: Add fastmap control support for 'UBI_IOCATT' ioctl"). To destroy the fastmap on a old image, we need to reattach the device in user space. However, if the UBI driver build in kernel and the UBI volu...
```diff diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 2178eb4115b3..eaf3c0c86b2b 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -35,7 +35,7 @@ #define MTD_PARAM_LEN_MAX 64 /* Maximum number of comma-separated items in the 'mtd=' parameter */ -#define MTD_PARAM_MAX_COUNT...
4a1ff3c5d04b9079b4f768d9a71b51c4af578dd2
Analyze and fix the following issue in the Linux kernel code: ubifs: Fix memory leak in alloc_wbufs()
Problem Details: kmemleak reported a sequence of memory leaks, and show them as following: unreferenced object 0xffff8881575f8400 (size 1024): comm "mount", pid 19625, jiffies 4297119604 (age 20.383s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 ...
```diff diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index d0c9a09988bc..32cb14759796 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -833,7 +833,7 @@ static int alloc_wbufs(struct ubifs_info *c) INIT_LIST_HEAD(&c->jheads[i].buds_list); err = ubifs_wbuf_init(c, &c->jheads[i].wbuf); if (err) - ret...
1e591ea072df7211f64542a09482b5f81cb3ad27
Analyze and fix the following issue in the Linux kernel code: ubi: Fix unreferenced object reported by kmemleak in ubi_resize_volume()
Problem Details: There is a memory leaks problem reported by kmemleak: unreferenced object 0xffff888102007a00 (size 128): comm "ubirsvol", pid 32090, jiffies 4298464136 (age 2361.231s) hex dump (first 32 bytes): ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ ff ff ff ff ff ff ff ff ff ff ff ff f...
```diff diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c index 74637575346e..9fbc64b997ce 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c @@ -515,7 +515,7 @@ out_acc: return err; out_free: - kfree(new_eba_tbl); + ubi_eba_destroy_table(new_eba_tbl); return err; } ```
9af31d6ec1a4be4caab2550096c6bd2ba8fba472
Analyze and fix the following issue in the Linux kernel code: ubi: Fix use-after-free when volume resizing failed
Problem Details: There is an use-after-free problem reported by KASAN: ================================================================== BUG: KASAN: use-after-free in ubi_eba_copy_table+0x11f/0x1c0 [ubi] Read of size 8 at addr ffff888101eec008 by task ubirsvol/4735 CPU: 2 PID: 4735 Comm: ubirsvol Not tainte...
```diff diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c index 8fcc0bdf0635..74637575346e 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c @@ -464,7 +464,7 @@ int ubi_resize_volume(struct ubi_volume_desc *desc, int reserved_pebs) for (i = 0; i < -pebs; i++) { err = ubi_eba_unmap_leb(ubi, ...
e874dcde1cbf82c786c0e7f2899811c02630cc52
Analyze and fix the following issue in the Linux kernel code: ubifs: Reserve one leb for each journal head while doing budget
Problem Details: UBIFS calculates available space by c->main_bytes - c->lst.total_used (which means non-index lebs' free and dirty space is accounted into total available), then index lebs and four lebs (one for gc_lnum, one for deletions, two for journal heads) are deducted. In following situation, ubifs may get -ENOS...
```diff diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c index 986e6e4081c7..d76eb7b39f56 100644 --- a/fs/ubifs/budget.c +++ b/fs/ubifs/budget.c @@ -209,11 +209,10 @@ long long ubifs_calc_available(const struct ubifs_info *c, int min_idx_lebs) subtract_lebs += 1; /* - * The GC journal head LEB is not really ac...
25fce616a61fc2f1821e4a9ce212d0e064707093
Analyze and fix the following issue in the Linux kernel code: ubifs: do_rename: Fix wrong space budget when target inode's nlink > 1
Problem Details: If target inode is a special file (eg. block/char device) with nlink count greater than 1, the inode with ui->data will be re-written on disk. However, UBIFS losts target inode's data_len while doing space budget. Bad space budget may let make_reservation() return with -ENOSPC, which could turn ubifs t...
```diff diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 7a1dcd14e387..4509d9fa9e6e 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -1324,6 +1324,8 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry, if (unlink) { ubifs_assert(c, inode_is_locked(new_inode)); + /* Budget for old inode...
b248eaf049d9cdc5eb76b59399e4d3de233f02ac
Analyze and fix the following issue in the Linux kernel code: ubifs: Fix wrong dirty space budget for dirty inode
Problem Details: Each dirty inode should reserve 'c->bi.inode_budget' bytes in space budget calculation. Currently, space budget for dirty inode reports more space than what UBIFS actually needs to write. Fixes: 1e51764a3c2ac0 ("UBIFS: add new flash file system") Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> S...
```diff diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c index e8b9b756f0ac..986e6e4081c7 100644 --- a/fs/ubifs/budget.c +++ b/fs/ubifs/budget.c @@ -400,7 +400,7 @@ static int calc_dd_growth(const struct ubifs_info *c, dd_growth = req->dirtied_page ? c->bi.page_budget : 0; if (req->dirtied_ino) - dd_growth += ...
c04cc68da856eac2b59e2a421c3f81a2afc560db
Analyze and fix the following issue in the Linux kernel code: ubifs: Add comments and debug info for ubifs_xrename()
Problem Details: Just like other operations (eg. ubifs_create, do_rename), add comments and debug information for ubifs_xrename(). Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Richard Weinberger <richard@nod.at>
```diff diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 94634b872e38..7a1dcd14e387 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -1566,6 +1566,15 @@ static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry, ubifs_assert(c, fst_inode && snd_inode); + /* + * Budget request settings: chang...
1b2ba09060e41adb356b9ae58ef94a7390928004
Analyze and fix the following issue in the Linux kernel code: ubifs: Rectify space budget for ubifs_xrename()
Problem Details: There is no space budget for ubifs_xrename(). It may let make_reservation() return with -ENOSPC, which could turn ubifs to read-only mode in do_writepage() process. Fix it by adding space budget for ubifs_xrename(). Fetch a reproducer in [Link]. Link: https://bugzilla.kernel.org/show_bug.cgi?id=21656...
```diff diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index aaff3f3f0aa3..94634b872e38 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -1576,6 +1576,10 @@ static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry, return err; } + err = ubifs_budget_space(c, &req); + if (err) + goto out; + l...
c2c36cc6ca23e614f9e4238d0ecf48549ee9002a
Analyze and fix the following issue in the Linux kernel code: ubifs: Rectify space budget for ubifs_symlink() if symlink is encrypted
Problem Details: Fix bad space budget when symlink file is encrypted. Bad space budget may let make_reservation() return with -ENOSPC, which could turn ubifs to read-only mode in do_writepage() process. Fetch a reproducer in [Link]. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216490 Fixes: ca7f85be8d6cf9 ("ubif...
```diff diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 0f29cf201136..aaff3f3f0aa3 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -1151,7 +1151,6 @@ static int ubifs_symlink(struct user_namespace *mnt_userns, struct inode *dir, int err, sz_change, len = strlen(symname); struct fscrypt_str disk_link; struc...
203a55f04f66eea1a1ca7e5a302a7f5c99c62327
Analyze and fix the following issue in the Linux kernel code: ubifs: Fix memory leak in ubifs_sysfs_init()
Problem Details: When insmod ubifs.ko, a kmemleak reported as below: unreferenced object 0xffff88817fb1a780 (size 8): comm "insmod", pid 25265, jiffies 4295239702 (age 100.130s) hex dump (first 8 bytes): 75 62 69 66 73 00 ff ff ubifs... backtrace: [<ffffffff81b3fc4c>] slab_...
```diff diff --git a/fs/ubifs/sysfs.c b/fs/ubifs/sysfs.c index 06ad8fa1fcfb..54270ad36321 100644 --- a/fs/ubifs/sysfs.c +++ b/fs/ubifs/sysfs.c @@ -144,6 +144,8 @@ int __init ubifs_sysfs_init(void) kobject_set_name(&ubifs_kset.kobj, "ubifs"); ubifs_kset.kobj.parent = fs_kobj; ret = kset_register(&ubifs_kset); + if...
aa6d148e6d6270274e3d5a529b71c54cd329d17f
Analyze and fix the following issue in the Linux kernel code: ubifs: Fix build errors as symbol undefined
Problem Details: With CONFIG_UBIFS_FS_AUTHENTICATION not set, the compiler can assume that ubifs_node_check_hash() is never true and drops the call to ubifs_bad_hash(). Is CONFIG_CC_OPTIMIZE_FOR_SIZE enabled this optimization does not happen anymore. So When CONFIG_UBIFS_FS and CONFIG_CC_OPTIMIZE_FOR_SIZE is enabled b...
```diff diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 478bbbb5382f..2f1f31581094 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -1623,8 +1623,13 @@ static inline int ubifs_check_hmac(const struct ubifs_info *c, return crypto_memneq(expected, got, c->hmac_desc_len); } +#ifdef CONFIG_UBIFS_FS_AUTHE...
1b42b1a36fc946f0d7088425b90d491b4257ca3e
Analyze and fix the following issue in the Linux kernel code: ubi: ensure that VID header offset + VID header size <= alloc, size
Problem Details: Ensure that the VID header offset + VID header size does not exceed the allocated area to avoid slab OOB. BUG: KASAN: slab-out-of-bounds in crc32_body lib/crc32.c:111 [inline] BUG: KASAN: slab-out-of-bounds in crc32_le_generic lib/crc32.c:179 [inline] BUG: KASAN: slab-out-of-bounds in crc32_le_base+0x...
```diff diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index a901f8edfa41..2178eb4115b3 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -663,6 +663,12 @@ static int io_init(struct ubi_device *ubi, int max_beb_per1024) ubi->ec_hdr_alsize = ALIGN(UBI_EC_HDR_SIZE, ubi->hdrs_min_io_s...
23892d383bee15b64f5463bd7195615734bb2415
Analyze and fix the following issue in the Linux kernel code: jffs2: correct logic when creating a hole in jffs2_write_begin
Problem Details: Bug description and fix: 1. Write data to a file, say all 1s from offset 0 to 16. 2. Truncate the file to a smaller size, say 8 bytes. 3. Write new bytes (say 2s) from an offset past the original size of the file, say at offset 20, for 4 bytes. This is supposed to create a "hole" in the file, meani...
```diff diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index 3cf71befa475..96b0275ce957 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c @@ -137,19 +137,18 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping, struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); struct jffs2_sb_info *...
8e47363588377e1bdb65e2b020b409cfb44dd260
Analyze and fix the following issue in the Linux kernel code: thermal: intel: powerclamp: Fix cur_state for multi package system
Problem Details: The powerclamp cooling device cur_state shows actual idle observed by package C-state idle counters. But the implementation is not sufficient for multi package or multi die system. The cur_state value is incorrect. On these systems, these counters must be read from each package/die and somehow aggregat...
```diff diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c index b80e25ec1261..2f4cbfdf26a0 100644 --- a/drivers/thermal/intel/intel_powerclamp.c +++ b/drivers/thermal/intel/intel_powerclamp.c @@ -57,6 +57,7 @@ static unsigned int target_mwait; static struct dentry *deb...
ae98e57a6e829dee26c1573134a24709d2cb82a3
Analyze and fix the following issue in the Linux kernel code: thermal: intel: intel_pch: Rename board ID symbols
Problem Details: Use capitals in the names of the board ID symbols and add the PCH_ prefix to each of them for consistency. Also rename the board_ids enum accordingly. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> ...
```diff diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/intel/intel_pch_thermal.c index ffb2acd0fd45..12600bca89b6 100644 --- a/drivers/thermal/intel/intel_pch_thermal.c +++ b/drivers/thermal/intel/intel_pch_thermal.c @@ -135,38 +135,38 @@ static struct thermal_zone_device_ops tzd_ops = { .cr...
3337a6e04ddf2923a1bdcf3d31b3b52412bf82dd
Analyze and fix the following issue in the Linux kernel code: mtk_sgmii: enable PCS polling to allow SFP work
Problem Details: Currently there is no IRQ handling (even the SGMII supports it). Enable polling to support SFP ports. Fixes: 14a44ab0330d ("net: mtk_eth_soc: partially convert to phylink_pcs") Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Alexander Couzens <lynxis@fe80.eu> [ bmork: ch...
```diff diff --git a/drivers/net/ethernet/mediatek/mtk_sgmii.c b/drivers/net/ethernet/mediatek/mtk_sgmii.c index c4261069b521..bb00de1003ac 100644 --- a/drivers/net/ethernet/mediatek/mtk_sgmii.c +++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c @@ -187,6 +187,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss, struct device_no...
9d32637122de88f1ef614c29703f0e050cad342e
Analyze and fix the following issue in the Linux kernel code: net: mediatek: sgmii: fix duplex configuration
Problem Details: The logic of the duplex bit is inverted. Setting it means half duplex, not full duplex. Fix and rename macro to avoid confusion. Fixes: 7e538372694b ("net: ethernet: mediatek: Re-add support SGMII") Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Bjørn Mork <bjorn@mork...
```diff diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h index 01a38f5145b1..2d9186d32bc0 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -519,7 +519,7 @@ #define SGMII_SPEED_10 FIELD_PREP(SGMII_SPEED_...
7ff82416de8295c61423ef6fd75f052d3837d2f7
Analyze and fix the following issue in the Linux kernel code: net: mediatek: sgmii: ensure the SGMII PHY is powered down on configuration
Problem Details: The code expect the PHY to be in power down which is only true after reset. Allow changes of the SGMII parameters more than once. Only power down when reconfiguring to avoid bouncing the link when there's no reason to - based on code from Russell King. There are cases when the SGMII_PHYA_PWD register...
```diff diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h index 18a50529ce7b..01a38f5145b1 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -1036,11 +1036,13 @@ struct mtk_soc_data { * @regmap: ...
a35965625649b5b65153d51aed466c4b3008ce2e
Analyze and fix the following issue in the Linux kernel code: mailmap: add John Crispin's entry
Problem Details: John has not been CCed on some of the fixes which perhaps resulted in the lack of review tags: Subsystem MEDIATEK ETHERNET DRIVER Changes 50 / 295 (16%) Last activity: 2023-01-17 Felix Fietkau <nbd@nbd.name>: Author 8bd8dcc5e47f 2022-11-18 00:00:00 33 Tags 8bd8dcc5e47f 2022-11-18 00:00:0...
```diff diff --git a/.mailmap b/.mailmap index 8deff4cec169..ac3decd2c756 100644 --- a/.mailmap +++ b/.mailmap @@ -214,6 +214,7 @@ Jisheng Zhang <jszhang@kernel.org> <jszhang@marvell.com> Jisheng Zhang <jszhang@kernel.org> <Jisheng.Zhang@synaptics.com> Johan Hovold <johan@kernel.org> <jhovold@gmail.com> Johan Hovold...
0c598aed445eb45b0ee7ba405f7ece99ee349c30
Analyze and fix the following issue in the Linux kernel code: net: openvswitch: fix flow memory leak in ovs_flow_cmd_new
Problem Details: Syzkaller reports a memory leak of new_flow in ovs_flow_cmd_new() as it is not freed when an allocation of a key fails. BUG: memory leak unreferenced object 0xffff888116668000 (size 632): comm "syz-executor231", pid 1090, jiffies 4294844701 (age 18.871s) hex dump (first 32 bytes): 00 00 00 00 ...
```diff diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index a71795355aec..fcee6012293b 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -1004,14 +1004,14 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) key = kzalloc(sizeof(*key), GFP_KERNEL...
dd15480a3d67b9cf04a1f6f5d60f1c0dc018e22f
Analyze and fix the following issue in the Linux kernel code: perf stat: Hide invalid uncore event output for aggr mode
Problem Details: The current display code for perf stat iterates given cpus and build the aggr map to collect the event data for the aggregation mode. But uncore events have their own cpu maps and it won't guarantee that it'd match to the aggr map. For example, per-package uncore events would generate a single value ...
```diff diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index 8bd8b0142630..1b5cb20efd23 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -787,6 +787,51 @@ static void uniquify_counter(struct perf_stat_config *config, struct evsel *coun uniquify_event_n...
1df49ef9ee3179a213754a26cc64065e8aa24c0c
Analyze and fix the following issue in the Linux kernel code: perf tools docs: Use canonical ftrace path
Problem Details: The canonical location for the tracefs filesystem is at /sys/kernel/tracing. But, from Documentation/trace/ftrace.rst: Before 4.1, all ftrace tracing control files were within the debugfs file system, which is typically located at /sys/kernel/debug/tracing. For backward compatibility, when moun...
```diff diff --git a/tools/perf/Documentation/perf-list.txt b/tools/perf/Documentation/perf-list.txt index c5a3cb0f57c7..d5f78e125efe 100644 --- a/tools/perf/Documentation/perf-list.txt +++ b/tools/perf/Documentation/perf-list.txt @@ -232,7 +232,7 @@ This can be overridden by setting the kernel.perf_event_paranoid sys...
1c249565426e3a9940102c0ba9f63914f7cda73d
Analyze and fix the following issue in the Linux kernel code: perf symbols: Symbol lookup with kcore can fail if multiple segments match stext
Problem Details: This problem was encountered on an arm64 system with a lot of memory. Without kernel debug symbols installed, and with both kcore and kallsyms available, perf managed to get confused and returned "unknown" for all of the kernel symbols that it tried to look up. On this system, stext fell within the vm...
```diff diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index d05727fcb30d..317c0706852f 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -1377,10 +1377,23 @@ static int dso__load_kcore(struct dso *dso, struct map *map, /* Find the kernel map using the '_stext' symbol */ if...
3980ee9ad8575915cda3790447af700bb865b493
Analyze and fix the following issue in the Linux kernel code: perf probe: Fix usage when libtraceevent is missing
Problem Details: While parsing the tracepoint events in parse_events_add_tracepoint() function, code checks for HAVE_LIBTRACEEVENT support. This is needed since libtraceevent is necessary for tracepoint. But while adding probe points, check for LIBTRACEEVENT is not done in case of perf probe. Hence, in environment with...
```diff diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index ed73d0b89ca2..e72f6cea76f7 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c @@ -383,9 +383,18 @@ static int perf_add_probe_events(struct perf_probe_event *pevs, int npevs) /* Note that it is possible to skip a...
a1f47752fd6275b2502fb075945022d6cf264855
Analyze and fix the following issue in the Linux kernel code: net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC
Problem Details: According to my tests on MT7621AT and MT7623NI SoCs, hardware DSA untagging won't work on the second MAC. Therefore, disable this feature when the second MAC of the MT7621 and MT7623 SoCs is being used. Fixes: 2d7605a72906 ("net: ethernet: mtk_eth_soc: enable hardware DSA untagging") Link: https://lor...
```diff diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index e3de9a53b2d9..d56eda6397a4 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -3177,7 +3177,8 @@ static int mtk_open(struct net_device *dev) s...
5cd6d1d53a1f74222e73d8b42ab7ecf28ee2f34f
Analyze and fix the following issue in the Linux kernel code: dm integrity: Remove bi_sector that's only used by commented debug code
Problem Details: drivers/md/dm-integrity.c:1738:13: warning: variable 'bi_sector' set but not used. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3895 Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org...
```diff diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 1388ee35571e..c62c21aadf32 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -1735,7 +1735,6 @@ static void integrity_metadata(struct work_struct *w) } if (unlikely(dio->op == REQ_OP_DISCARD)) { - sector_t...
aa56b9b75996ff4c76a0a4181c2fa0206c3d91cc
Analyze and fix the following issue in the Linux kernel code: dm flakey: fix logic when corrupting a bio
Problem Details: If "corrupt_bio_byte" is set to corrupt reads and corrupt_bio_flags is used, dm-flakey would erroneously return all writes as errors. Likewise, if "corrupt_bio_byte" is set to corrupt writes, dm-flakey would return errors for all reads. Fix the logic so that if fc->corrupt_bio_byte is non-zero, dm-fla...
```diff diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c index 33608d436cec..335684a1aeaa 100644 --- a/drivers/md/dm-flakey.c +++ b/drivers/md/dm-flakey.c @@ -365,9 +365,11 @@ static int flakey_map(struct dm_target *ti, struct bio *bio) /* * Corrupt matching writes. */ - if (fc->corrupt_bio_byte...
63b114042d8a9c02d9939889177c36dbdb17a588
Analyze and fix the following issue in the Linux kernel code: virtio-net: Keep stop() to follow mirror sequence of open()
Problem Details: Cited commit in fixes tag frees rxq xdp info while RQ NAPI is still enabled and packet processing may be ongoing. Follow the mirror sequence of open() in the stop() callback. This ensures that when rxq info is unregistered, no rx packet processing is ongoing. Fixes: 754b8a21a96d ("virtio_net: setup x...
```diff diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 6df14dd5bf46..61e33e4dd0cd 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -2158,8 +2158,8 @@ static int virtnet_close(struct net_device *dev) cancel_delayed_work_sync(&vi->refill); for (i = 0; i < vi->max_queue...
218674a45930c700486d27b765bf2f1b43f8cbf7
Analyze and fix the following issue in the Linux kernel code: ASoC: mchp-spdifrx: Fix uninitialized use of mr in mchp_spdifrx_hw_params()
Problem Details: Clang warns: ../sound/soc/atmel/mchp-spdifrx.c:455:3: error: variable 'mr' is uninitialized when used here [-Werror,-Wuninitialized] mr |= SPDIFRX_MR_ENDIAN_BIG; ^~ ../sound/soc/atmel/mchp-spdifrx.c:432:8: note: initialize the variable 'mr' to silence this warni...
```diff diff --git a/sound/soc/atmel/mchp-spdifrx.c b/sound/soc/atmel/mchp-spdifrx.c index 526dd3a17471..eb0c0ef4541e 100644 --- a/sound/soc/atmel/mchp-spdifrx.c +++ b/sound/soc/atmel/mchp-spdifrx.c @@ -429,7 +429,7 @@ static int mchp_spdifrx_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai...
3c54a3ff0a2cdcd902482a62fef813f1d46e5eaf
Analyze and fix the following issue in the Linux kernel code: bus: mhi: ep: Fix off by one in mhi_ep_process_cmd_ring()
Problem Details: The > comparison should be changed to >= to prevent an out of bounds access into the mhi_cntrl->mhi_chan[] array. The mhi_cntrl->mhi_chan[] array is allocated in mhi_ep_chan_init() and has mhi_cntrl->max_chan elements. Fixes: 6de4941c0215 ("bus: mhi: ep: Check if the channel is supported by the contr...
```diff diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c index 528c00b232bf..dffe03658ff9 100644 --- a/drivers/bus/mhi/ep/main.c +++ b/drivers/bus/mhi/ep/main.c @@ -125,7 +125,7 @@ static int mhi_ep_process_cmd_ring(struct mhi_ep_ring *ring, struct mhi_ring_ele ch_id = MHI_TRE_GET_CMD_CHID(el); ...
353c7dd636ed12fdaedea782de612aceb1923ed9
Analyze and fix the following issue in the Linux kernel code: docs/mm: Physical Memory: remove useless markup
Problem Details: Jon says: > +See also :ref:`Page Reclaim <page_reclaim>`. Can also just be "See also Documentation/mm/page_reclaim.rst". The right things will happen in the HTML output, readers of the plain-text will know immediately where to go, and we don't have to add the label clutter. Remove referen...
```diff diff --git a/Documentation/core-api/dma-api.rst b/Documentation/core-api/dma-api.rst index c847a5b0a0d3..829f20a193ca 100644 --- a/Documentation/core-api/dma-api.rst +++ b/Documentation/core-api/dma-api.rst @@ -1,5 +1,3 @@ -.. _dma_api: - ============================================ Dynamic DMA mapping using ...
42ec40b0883c1cce58b06e8fa82049a61033151c
Analyze and fix the following issue in the Linux kernel code: iio: light: vcnl4000: Fix WARN_ON on uninitialized lock
Problem Details: There are different init functions for the sensors in this driver in which only one initializes the generic vcnl4000_lock. With commit e21b5b1f2669 ("iio: light: vcnl4000: Preserve conf bits when toggle power") the vcnl4040 sensor started to depend on the lock, but it was missed to initialize it in vcn...
```diff diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c index cc1a2062e76d..69c5bc987e26 100644 --- a/drivers/iio/light/vcnl4000.c +++ b/drivers/iio/light/vcnl4000.c @@ -199,7 +199,6 @@ static int vcnl4000_init(struct vcnl4000_data *data) data->rev = ret & 0xf; data->al_scale = 250000; - ...
d9b540ee461cca7edca0dd2c2a42625c6b9ffb8f
Analyze and fix the following issue in the Linux kernel code: iio: adis16480: select CONFIG_CRC32
Problem Details: In rare randconfig builds, the missing CRC32 helper causes a link error: ld.lld: error: undefined symbol: crc32_le >>> referenced by usercopy_64.c >>> vmlinux.o:(adis16480_trigger_handler) Fixes: 941f130881fa ("iio: adis16480: support burst read function") Signed-off-by: Arnd Bergmann <...
```diff diff --git a/drivers/iio/imu/Kconfig b/drivers/iio/imu/Kconfig index f1d7d4b5e222..c2f97629e9cd 100644 --- a/drivers/iio/imu/Kconfig +++ b/drivers/iio/imu/Kconfig @@ -47,6 +47,7 @@ config ADIS16480 depends on SPI select IIO_ADIS_LIB select IIO_ADIS_LIB_BUFFER if IIO_BUFFER + select CRC32 help Say ye...
f94a4f97f001d0b665723698c4b4b49174d60b90
Analyze and fix the following issue in the Linux kernel code: can: ems_pci: Initialize BAR registers
Problem Details: Fix the base register defines and their usage for all three card versions Signed-off-by: Gerhard Uttenthaler <uttenthaler@ems-wuensche.com> Link: https://lore.kernel.org/all/20230120112616.6071-4-uttenthaler@ems-wuensche.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
```diff diff --git a/drivers/net/can/sja1000/ems_pci.c b/drivers/net/can/sja1000/ems_pci.c index 80fa5e4c5eac..5748c24dd137 100644 --- a/drivers/net/can/sja1000/ems_pci.c +++ b/drivers/net/can/sja1000/ems_pci.c @@ -87,12 +87,23 @@ struct ems_pci_card { */ #define EMS_PCI_CDR (CDR_CBP | CDR_CLKOUT_MASK) ...
2b9ed3b9aaee323511b018a1a05adfcebd986dfc
Analyze and fix the following issue in the Linux kernel code: can: ems_pci: Fix code style, copyright and email address
Problem Details: Fix code style complained by checkpatch.pl, add Copyright and fix email address Signed-off-by: Gerhard Uttenthaler <uttenthaler@ems-wuensche.com> Link: https://lore.kernel.org/all/20230120112616.6071-2-uttenthaler@ems-wuensche.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
```diff diff --git a/drivers/net/can/sja1000/ems_pci.c b/drivers/net/can/sja1000/ems_pci.c index 4ab91759a5c6..c34788b9a6d5 100644 --- a/drivers/net/can/sja1000/ems_pci.c +++ b/drivers/net/can/sja1000/ems_pci.c @@ -3,6 +3,7 @@ * Copyright (C) 2007 Wolfgang Grandegger <wg@grandegger.com> * Copyright (C) 2008 Markus ...
5a6b64adc18d9adfb497a529ff004d59b6df151f
Analyze and fix the following issue in the Linux kernel code: gcc-plugins: drop -std=gnu++11 to fix GCC 13 build
Problem Details: The latest GCC 13 snapshot (13.0.1 20230129) gives the following: ``` cc1: error: cannot load plugin ./scripts/gcc-plugins/randomize_layout_plugin.so :./scripts/gcc-plugins/randomize_layout_plugin.so: undefined symbol: tree_code_type ``` This ends up being because of https://gcc.gnu.org/git/gitweb.cg...
```diff diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile index b34d11e22636..320afd3cf8e8 100644 --- a/scripts/gcc-plugins/Makefile +++ b/scripts/gcc-plugins/Makefile @@ -29,7 +29,7 @@ GCC_PLUGINS_DIR = $(shell $(CC) -print-file-name=plugin) plugin_cxxflags = -Wp,-MMD,$(depfile) $(KBUILD_HOSTCX...
3e73d3df4d3861265367b4df6dd7fc5789e05d3c
Analyze and fix the following issue in the Linux kernel code: can: rcar_canfd: Fix R-Car Gen4 CFCC.CFTML field width
Problem Details: On R-Car Gen4 CAN_FD variants, the Common FIFO TX Message Buffer Link (CFTML) field in the Common FIFO Configuration / Control Register (CCFC) register is one bit wider than on older variants. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/all/9c37aaa799a2391...
```diff diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c index ee7bbd9d1151..376a5d606acc 100644 --- a/drivers/net/can/rcar/rcar_canfd.c +++ b/drivers/net/can/rcar/rcar_canfd.c @@ -233,7 +233,8 @@ /* Common FIFO bits */ /* RSCFDnCFDCFCCk */ -#define RCANFD_CFCC_CFTML(gpriv, x) (((x...
0424281688f11bfe79b9461420ca3465995178cc
Analyze and fix the following issue in the Linux kernel code: can: rcar_canfd: Fix R-Car Gen4 DCFG.DSJW field width
Problem Details: On R-Car Gen4 CAN_FD variants, the Data Bit Rate Resynchronization Jump Width Control (DSJW) field in the Channel n Data Bitrate Configuration Register (DCFG) register is one bit wider than on older variants. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/all...
```diff diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c index aa7fcd4a47d3..ee7bbd9d1151 100644 --- a/drivers/net/can/rcar/rcar_canfd.c +++ b/drivers/net/can/rcar/rcar_canfd.c @@ -186,7 +186,7 @@ #define RCANFD_CERFL_ERR(x) ((x) & (0x7fff)) /* above bits 14:0 */ /* RSCFDnCFDCmDCF...
9be8c5583581244d8a77e41afa16b8b0a5ddabc0
Analyze and fix the following issue in the Linux kernel code: can: rcar_canfd: Fix R-Car V3U GAFLCFG field accesses
Problem Details: Each Global Acceptance Filter List Configuration Register (GAFLCFG) contains two fields, and stores the number of channel rules for one channel pair. As R-Car V3U and later can have more than 2 channels, the field selection should be based on the LSB (even or odd) of the channel number, instead of on ...
```diff diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c index 88de17d0bd79..77b21c82faf3 100644 --- a/drivers/net/can/rcar/rcar_canfd.c +++ b/drivers/net/can/rcar/rcar_canfd.c @@ -92,10 +92,10 @@ /* RSCFDnCFDGAFLCFG0 / RSCFDnGAFLCFG0 */ #define RCANFD_GAFLCFG_SETRNC(gpriv, n, x) \ ...
0a016639ef92b28eb74ba4fed21bee1f1328513a
Analyze and fix the following issue in the Linux kernel code: can: rcar_canfd: Fix R-Car V3U CAN mode selection
Problem Details: When adding support for R-Car V3U, the Global FD Configuration register (CFDGFDCFG) and the Channel-specific CAN-FD Configuration Registers (CFDCmFDCFG) were mixed up. Use the correct register, and apply the selected CAN mode to all available channels. Annotate the corresponding register bits, to mak...
```diff diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c index f6fa7157b99b..88de17d0bd79 100644 --- a/drivers/net/can/rcar/rcar_canfd.c +++ b/drivers/net/can/rcar/rcar_canfd.c @@ -197,8 +197,8 @@ #define RCANFD_DCFG_DBRP(x) (((x) & 0xff) << 0) /* RSCFDnCFDCmFDCFG */ -#define RCAN...
5def33df84d2326ebf5f29ae9ddc702a4593c337
Analyze and fix the following issue in the Linux kernel code: rtla/timerlat: Add auto-analysis support to timerlat top
Problem Details: Currently, timerlat top displays the timerlat tracer latency results, saving the intuitive timerlat trace for the developer to analyze. This patch goes a step forward in the automaton of the scheduling latency analysis by providing a summary of the root cause of a latency higher than the passed "stop ...
```diff diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src/timerlat_top.c index 334271935222..eea5b3357e27 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -10,10 +10,12 @@ #include <unistd.h> #include <stdio.h> #include <time.h> +#include <er...
8c1cbec9db1ab044167a7594c88bb5906c9d3ee4
Analyze and fix the following issue in the Linux kernel code: xhci: fix event ring segment table related masks and variables in header
Problem Details: xHC controller can supports up to 1024 interrupters. To fit these change the max_interrupters varable from u8 to u16. Add a separate mask for the reserve and preserve bits [5:0] in the erst base register and use it instead of the ERST_PRT_MASK. ERSR_PTR_MASK [3:0] is intended for masking bits in the e...
```diff diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 81ca2bc1f0be..679befa97c7a 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -2529,8 +2529,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) "// Set ERST base address for ir_set 0 = 0x%llx", ...
2e7c6652f9b86c01cbd4e988057a746a3a461969
Analyze and fix the following issue in the Linux kernel code: ASoC: SOF: amd: Fix for handling spurious interrupts from DSP
Problem Details: As interrupts are Level-triggered,unless and until we deassert the register the interrupts are generated which causes spurious interrupts unhandled. Now we deasserted the interrupt at top half which solved the below "nobody cared" warning. warning reported in dmesg: irq 80: nobody cared (try booting...
```diff diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c index 6bd2888fbb66..d5ccd4d09278 100644 --- a/sound/soc/sof/amd/acp.c +++ b/sound/soc/sof/amd/acp.c @@ -318,7 +318,6 @@ static irqreturn_t acp_irq_thread(int irq, void *context) { struct snd_sof_dev *sdev = context; const struct sof_amd_acp_des...
f492edb40b54862cbd65e6aa5eb39fa40f9949bf
Analyze and fix the following issue in the Linux kernel code: PCI: vmd: Add quirk to configure PCIe ASPM and LTR
Problem Details: PCIe ports reserved for VMD use are not visible to BIOS and therefore not configured to enable PCIe ASPM or LTR values (which BIOS will configure if they are not set). Lack of this programming results in high power consumption on laptops as reported in bugzilla. For affected products use pci_enable_li...
```diff diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c index 47fa3e5f2dc5..990630ec57c6 100644 --- a/drivers/pci/controller/vmd.c +++ b/drivers/pci/controller/vmd.c @@ -66,11 +66,22 @@ enum vmd_features { * interrupt handling. */ VMD_FEAT_CAN_BYPASS_MSI_REMAP = (1 << 4), + + /* + * E...
cf3e0251868c56b10ccb3e0b3628fcfb0c9c4ec5
Analyze and fix the following issue in the Linux kernel code: PM: tools: use canonical ftrace path
Problem Details: The canonical location for the tracefs filesystem is at /sys/kernel/tracing. But, from Documentation/trace/ftrace.rst: Before 4.1, all ftrace tracing control files were within the debugfs file system, which is typically located at /sys/kernel/debug/tracing. For backward compatibility, when moun...
```diff diff --git a/tools/power/pm-graph/sleepgraph.py b/tools/power/pm-graph/sleepgraph.py index c60c90f35d18..82c09cd25cc2 100755 --- a/tools/power/pm-graph/sleepgraph.py +++ b/tools/power/pm-graph/sleepgraph.py @@ -120,9 +120,9 @@ class SystemValues: cgexp = False testdir = '' outdir = '' - tpath = '/sys/kern...
c6adf659a8ba85913e16a571d5a9bcd17d3d1234
Analyze and fix the following issue in the Linux kernel code: can: isotp: check CAN address family in isotp_bind()
Problem Details: Add missing check to block non-AF_CAN binds. Syzbot created some code which matched the right sockaddr struct size but used AF_XDP (0x2C) instead of AF_CAN (0x1D) in the address family field: bind$xdp(r2, &(0x7f0000000540)={0x2c, 0x0, r4, 0x0, r2}, 0x10) ^^^^ This has ...
```diff diff --git a/net/can/isotp.c b/net/can/isotp.c index 608f8c24ae46..a18450ffae01 100644 --- a/net/can/isotp.c +++ b/net/can/isotp.c @@ -1225,6 +1225,9 @@ static int isotp_bind(struct socket *sock, struct sockaddr *uaddr, int len) if (len < ISOTP_MIN_NAMELEN) return -EINVAL; + if (addr->can_family != AF_CA...
be014c789c717a4328f49d58b53170923bc475f8
Analyze and fix the following issue in the Linux kernel code: thermal: intel: int340x: Assorted minor cleanups
Problem Details: Improve some inconsistent usage of white space in int340x_thermal_zone.c, fix up one coding style issue in it (missing braces around an else branch of a conditional) and while at it replace a !ACPI_FAILURE() check with an equivalent ACPI_SUCCESS() one. No intentional functional impact. Signed-off-by:...
```diff diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c index a675f79f792b..30c05b436700 100644 --- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c +++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c @...
fbe7e38f3e57e38916ae7f248fd6efafeb9ecdd3
Analyze and fix the following issue in the Linux kernel code: serial: 8250: Fix mismerge regarding serial_lsr_in()
Problem Details: The relevant history introducing serial_lsr_in() looks as follows: $ git log --graph --oneline --boundary 9fafe733514b..df36f3e3fbb7 -- drivers/tty/serial/8250/8250_port.c * df36f3e3fbb7 Merge tag 'v5.19-rc3' into tty-next |\ | * be03b0651ffd serial: 8250: Store to lsr_save_flags after lsr read ...
```diff diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 33be7aad11ef..e61753c295d5 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1512,8 +1512,6 @@ static inline void __stop_tx(struct uart_8250_port *p) u16 lsr = serial_lsr_...
49094d928618309877c50e589f23e639a3b0c453
Analyze and fix the following issue in the Linux kernel code: phy: mediatek: remove temporary variable @mask_
Problem Details: Remove the temporary @mask_, this may cause build warning when use clang compiler for powerpc, but can't reproduce it when compile for arm64. the build warning is caused by: "warning: result of comparison of constant 18446744073709551615 with expression of type (aka 'unsigned long') is always false [-...
```diff diff --git a/drivers/phy/mediatek/phy-mtk-io.h b/drivers/phy/mediatek/phy-mtk-io.h index d20ad5e5be81..58f06db822cb 100644 --- a/drivers/phy/mediatek/phy-mtk-io.h +++ b/drivers/phy/mediatek/phy-mtk-io.h @@ -39,8 +39,8 @@ static inline void mtk_phy_update_bits(void __iomem *reg, u32 mask, u32 val) /* field @mas...
352683ea52e3f299a72899c9ee059190c9f769a8
Analyze and fix the following issue in the Linux kernel code: drm/vc4: allow DRM_VC4_KUNIT_TEST to be a loadable module
Problem Details: In configurations with CONFIG_KUNIT=m, builting the unit test into the kernel causes a link failure: arm-linux-gnueabi-ld: drivers/gpu/drm/vc4/tests/vc4_mock.o: in function `__build_mock': vc4_mock.c:(.text+0x6e): undefined reference to `kunit_do_failed_assertion' arm-linux-gnueabi-ld: vc4_mock.c:(.te...
```diff diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig index f423941c028d..91dcf8d174d6 100644 --- a/drivers/gpu/drm/vc4/Kconfig +++ b/drivers/gpu/drm/vc4/Kconfig @@ -36,7 +36,7 @@ config DRM_VC4_HDMI_CEC and want to use CEC. config DRM_VC4_KUNIT_TEST - bool "KUnit tests for VC4" if !KUNI...
7e1790d26a92e05cc6a2d0bab98d8ea40ae28d9d
Analyze and fix the following issue in the Linux kernel code: ARM: dts: stm32: fix compatible for BSEC on STM32MP13
Problem Details: Use the correct compatible for stm32mp13 support. The BSEC driver for STM32MP15x is not compatible with STM32MP13x. For example the proprietary's smc STM32_SMC_BSEC is not supported in STM32MP13x OP-TEE, it is replaced by SM32MP BSEC Pseudo Trusted Application in OP-TEE to access to the secured IP BSE...
```diff diff --git a/arch/arm/boot/dts/stm32mp131.dtsi b/arch/arm/boot/dts/stm32mp131.dtsi index 2f186a0ae92e..5949473cbbfd 100644 --- a/arch/arm/boot/dts/stm32mp131.dtsi +++ b/arch/arm/boot/dts/stm32mp131.dtsi @@ -1226,7 +1226,7 @@ }; bsec: efuse@5c005000 { - compatible = "st,stm32mp15-bsec"; + compatible ...
329c9cd769c2e306957df031efff656c40922c76
Analyze and fix the following issue in the Linux kernel code: selftests: net: udpgso_bench_tx: Cater for pending datagrams zerocopy benchmarking
Problem Details: The test tool can check that the zerocopy number of completions value is valid taking into consideration the number of datagram send calls. This can catch the system into a state where the datagrams are still in the system (for example in a qdisk, waiting for the network interface to return a completio...
```diff diff --git a/tools/testing/selftests/net/udpgso_bench_tx.c b/tools/testing/selftests/net/udpgso_bench_tx.c index b47b5c32039f..477392715a9a 100644 --- a/tools/testing/selftests/net/udpgso_bench_tx.c +++ b/tools/testing/selftests/net/udpgso_bench_tx.c @@ -62,6 +62,7 @@ static int cfg_payload_len = (1472 * 42); ...
dafe93b9ee21028d625dce347118b82659652eff
Analyze and fix the following issue in the Linux kernel code: selftests: net: udpgso_bench: Fix racing bug between the rx/tx programs
Problem Details: "udpgro_bench.sh" invokes udpgso_bench_rx/udpgso_bench_tx programs subsequently and while doing so, there is a chance that the rx one is not ready to accept socket connections. This racing bug could fail the test with at least one of the following: ./udpgso_bench_tx: connect: Connection refused ./udpg...
```diff diff --git a/tools/testing/selftests/net/udpgso_bench.sh b/tools/testing/selftests/net/udpgso_bench.sh index dc932fd65363..640bc43452fa 100755 --- a/tools/testing/selftests/net/udpgso_bench.sh +++ b/tools/testing/selftests/net/udpgso_bench.sh @@ -7,6 +7,7 @@ readonly GREEN='\033[0;92m' readonly YELLOW='\033[0;...
db9b47ee9f5f375ab0c5daeb20321c75b4fa657d
Analyze and fix the following issue in the Linux kernel code: selftests: net: udpgso_bench_rx/tx: Stop when wrong CLI args are provided
Problem Details: Leaving unrecognized arguments buried in the output, can easily hide a CLI/script typo. Avoid this by exiting when wrong arguments are provided to the udpgso_bench test programs. Fixes: 3a687bef148d ("selftests: udp gso benchmark") Signed-off-by: Andrei Gherzan <andrei.gherzan@canonical.com> Cc: Wille...
```diff diff --git a/tools/testing/selftests/net/udpgso_bench_rx.c b/tools/testing/selftests/net/udpgso_bench_rx.c index d0895bd1933f..4058c7451e70 100644 --- a/tools/testing/selftests/net/udpgso_bench_rx.c +++ b/tools/testing/selftests/net/udpgso_bench_rx.c @@ -336,6 +336,8 @@ static void parse_opts(int argc, char **a...
c03c80e3a03ffb4f790901d60797e9810539d946
Analyze and fix the following issue in the Linux kernel code: selftests: net: udpgso_bench_rx: Fix 'used uninitialized' compiler warning
Problem Details: This change fixes the following compiler warning: /usr/include/x86_64-linux-gnu/bits/error.h:40:5: warning: ‘gso_size’ may be used uninitialized [-Wmaybe-uninitialized] 40 | __error_noreturn (__status, __errnum, __format, __va_arg_pack ()); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
```diff diff --git a/tools/testing/selftests/net/udpgso_bench_rx.c b/tools/testing/selftests/net/udpgso_bench_rx.c index 6a193425c367..d0895bd1933f 100644 --- a/tools/testing/selftests/net/udpgso_bench_rx.c +++ b/tools/testing/selftests/net/udpgso_bench_rx.c @@ -250,7 +250,7 @@ static int recv_msg(int fd, char *buf, in...
366384e495511bea8583e44173629a3012d62db0
Analyze and fix the following issue in the Linux kernel code: ARM: dts: stm32: Update part number NVMEM description on stm32mp131
Problem Details: The STM32MP13x Device Part Number (also named RPN in reference manual) only uses the first 12 bits in OTP4, all the other bit are reserved and they can be different of zero; they must be masked in NVMEM result, so the number of bits must be defined in the nvmem cell description. Fixes: 1da8779c0029 ("...
```diff diff --git a/arch/arm/boot/dts/stm32mp131.dtsi b/arch/arm/boot/dts/stm32mp131.dtsi index f50051e81ee3..2f186a0ae92e 100644 --- a/arch/arm/boot/dts/stm32mp131.dtsi +++ b/arch/arm/boot/dts/stm32mp131.dtsi @@ -1233,6 +1233,7 @@ part_number_otp: part_number_otp@4 { reg = <0x4 0x2>; + bits = <0 12>; ...
b4c58d540777124f31ab0cb37a14c6573438d381
Analyze and fix the following issue in the Linux kernel code: spi: intel: Fix device private data and PR_NUM for Broxton controllers
Problem Details: Some private data fields have to change from bxt_info to cnl_info. Here is the list of Device IDs with the respective documentation taken for validation: 0xa0a4 - Intel® 500 Series Chipset Family On-Package PCH 0x02a4 - Intel® 400 Series Chipset Family On-Package PCH 0x06a4 - Intel® 400 Ser...
```diff diff --git a/drivers/spi/spi-intel-pci.c b/drivers/spi/spi-intel-pci.c index f0d532ea40e8..10fa3a7fa4f5 100644 --- a/drivers/spi/spi-intel-pci.c +++ b/drivers/spi/spi-intel-pci.c @@ -60,12 +60,12 @@ static int intel_spi_pci_probe(struct pci_dev *pdev, } static const struct pci_device_id intel_spi_pci_ids[] ...
2a096315be7d8ccad883203876c4b53e7b024f12
Analyze and fix the following issue in the Linux kernel code: ASoC: codecs: aw88395: Fix spelling mistake "cersion" -> "version"
Problem Details: There are spelling mistakes in dev_err messages. Fix them. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20230202103236.270057-1-colin.i.king@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
```diff diff --git a/sound/soc/codecs/aw88395/aw88395_lib.c b/sound/soc/codecs/aw88395/aw88395_lib.c index 34ae405bb43d..64dde972f3f0 100644 --- a/sound/soc/codecs/aw88395/aw88395_lib.c +++ b/sound/soc/codecs/aw88395/aw88395_lib.c @@ -890,7 +890,7 @@ int aw88395_dev_cfg_load(struct aw_device *aw_dev, struct aw_containe...
5579a966229c3365d0e2c91e9a96fc40e293dffa
Analyze and fix the following issue in the Linux kernel code: ASoC: amd: ps: Add a module parameter to influence pdm_gain
Problem Details: In case of regressions for any users that the new pdm_gain value is too high and for additional debugging, introduce a module parameter that would let them configure it. This parameter should be removed in the future: * If it's determined that the parameter is not needed, just hardcode the correct...
```diff diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h index 893a0455cf24..6bf29b520511 100644 --- a/sound/soc/amd/ps/acp63.h +++ b/sound/soc/amd/ps/acp63.h @@ -29,7 +29,7 @@ #define ACP_ERROR_STAT 29 #define PDM_DECIMATION_FACTOR 2 #define ACP_PDM_CLK_FREQ_MASK 7 -#define ACP_WOV_MISC_CTRL_MASK 0x...