id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
bb6705c3f93bed2af03d43691743d4c43e3c8e6f
Analyze and fix the following issue in the Linux kernel code: bpf: add check for invalid name in btf_name_valid_section()
Problem Details: If the length of the name string is 1 and the value of name[0] is NULL byte, an OOB vulnerability occurs in btf_name_valid_section() and the return value is true, so the invalid name passes the check. To solve this, you need to check if the first position is NULL byte and if the first character is pri...
```diff diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index e3377dd61f7e..a4e4f8d43ecf 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -823,9 +823,11 @@ static bool btf_name_valid_section(const struct btf *btf, u32 offset) const char *src = btf_str_by_offset(btf, offset); const char *src_limit; + if (!...
2edb4f0ede44725ad88534e73ba15213cbc7d556
Analyze and fix the following issue in the Linux kernel code: arm64: dts: rockchip: remove duplicate nodes from dts for ROCK 4SE
Problem Details: these nodes just define same properties in rk3399-rock-pi-4.dtsi. remove them from rk3399-rock-4se.dts. sha256sum rk3399-rock-4se.dtb generates same hash value before/after this change. Fixes: 86a0e14a82ea ("arm64: dts: rockchip: Add Radxa ROCK 4SE") Signed-off-by: FUKAUMI Naoki <naoki@radxa.com> Lin...
```diff diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-4se.dts b/arch/arm64/boot/dts/rockchip/rk3399-rock-4se.dts index 9dd26150c369..a8b8d4acc337 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-rock-4se.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-4se.dts @@ -17,14 +17,6 @@ }; }; -&pinctrl { - usb2 ...
02baa0a2a677cf543899bc3eb43ed92caf4aba7a
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix procmap_query()'s params mismatch and compilation warning
Problem Details: When the PROCMAP_QUERY is not defined, a compilation error occurs due to the mismatch of the procmap_query()'s params, procmap_query() only be called in the file where the function is defined, modify the params so they can match. We get a warning when build samples/bpf: trace_helpers.c:252:5: warn...
```diff diff --git a/tools/testing/selftests/bpf/trace_helpers.c b/tools/testing/selftests/bpf/trace_helpers.c index 1bfd881c0e07..2d742fdac6b9 100644 --- a/tools/testing/selftests/bpf/trace_helpers.c +++ b/tools/testing/selftests/bpf/trace_helpers.c @@ -249,7 +249,7 @@ out: #ifdef PROCMAP_QUERY int env_verbosity __w...
bd60cae2932cd123d867bf93bdadc4bf545fcdce
Analyze and fix the following issue in the Linux kernel code: arm64: dts: rockchip: rk3588s fix sdio pins to pull up
Problem Details: The sdio requires the cmd and data pins to pull up by soc. Signed-off-by: Alex Zhao <zzc@rock-chips.com> [adapted to pinctrl filename change] Signed-off-by: Chris Morgan <macromorgan@hotmail.com> Link: https://lore.kernel.org/r/20240829204517.398669-2-macroalpha82@gmail.com Signed-off-by: Heiko Stuebn...
```diff diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi index 30db12c4fc82..d1368418502a 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi @@ -2449,15 +2449,15 @@ ...
93f5fb809b8336143a6668c38dba1f4c7ffe5cab
Analyze and fix the following issue in the Linux kernel code: arm64: dts: rockchip: Add missing tshut props to tsadc on quartz64-b
Problem Details: Add the missing TSADC properties `rockchip,hw-tshut-mode` and `rockchip,hw-tshut-polarity` to the Pine64 Quartz64 Model B. This fixes the following warnings: rockchip-thermal fe710000.tsadc: Missing tshut mode property, using default (gpio) rockchip-thermal fe710000.tsadc: Missing tshut-polarity ...
```diff diff --git a/arch/arm64/boot/dts/rockchip/rk3566-quartz64-b.dts b/arch/arm64/boot/dts/rockchip/rk3566-quartz64-b.dts index 13e599a85eb8..c164074ddf54 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-quartz64-b.dts +++ b/arch/arm64/boot/dts/rockchip/rk3566-quartz64-b.dts @@ -648,6 +648,8 @@ }; &tsadc { + roc...
3a1fb526c2482b2f61c9813e9e14fcdab4ffa390
Analyze and fix the following issue in the Linux kernel code: platform/x86: thinkpad_acpi: Fix uninitialized symbol 's' warning
Problem Details: When the TPACPI_FAN_WR_ACPI_FANW branch is taken s stays uninitialized and would be later used in a debug print. Since the registers are always set to the same two static values inside the branch s is initialized to 0. Fixes: 57d0557dfa49 ("platform/x86: thinkpad_acpi: Add Thinkpad Edge E531 fan supp...
```diff diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 8f7053920884..4c1b0553f872 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -8318,7 +8318,7 @@ static int fan_set_level_safe(int level) static int fan_set_enable(void)...
bb9c2e5492a88e255305d0dfae33e34f0e8bbec6
Analyze and fix the following issue in the Linux kernel code: platform/x86: x86-android-tablets: Fix spelling in the comments
Problem Details: Fix spelling across comments (besides obvious grammar issues): - spell words in full, e.g., 'img' --> 'image' - refer to 'gpio-keys' consistently - refer to acpi_power_off() clearly as to function - make sure that the first line is only for the affected model(s) - miscellaneous improvements Signed-off...
```diff diff --git a/drivers/platform/x86/x86-android-tablets/Kconfig b/drivers/platform/x86/x86-android-tablets/Kconfig index b591419de80c..88d9e8f2ff24 100644 --- a/drivers/platform/x86/x86-android-tablets/Kconfig +++ b/drivers/platform/x86/x86-android-tablets/Kconfig @@ -20,4 +20,4 @@ config X86_ANDROID_TABLETS ...
a093cb667c3ff5eadd4b23ddf996d9ccae9b7ac6
Analyze and fix the following issue in the Linux kernel code: platform/x86: ideapad-laptop: Make the scope_guard() clear of its scope
Problem Details: First of all, it's a bit counterintuitive to have something like int err; ... scoped_guard(...) err = foo(...); if (err) return err; Second, with a particular kernel configuration and compiler version in one of such cases the objtool is not happy: ideapad-laptop.o: warning: objtool: .text....
```diff diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index 35c75bcff195..c64dfc56651d 100644 --- a/drivers/platform/x86/ideapad-laptop.c +++ b/drivers/platform/x86/ideapad-laptop.c @@ -554,13 +554,14 @@ static ssize_t camera_power_show(struct device *dev, char *buf) ...
2e01ac83c1c7166e58043ff2bdb0dc7dbfcfd11a
Analyze and fix the following issue in the Linux kernel code: extcon: lc824206xa: Fix build error of POWER_SUPPLY_PROP_USB_TYPE
Problem Details: commit 364ea7ccaef9("power: supply: Change usb_types from an array into a bitmask") changes usb_types from an array into a bitmask. Fix the build error of usb_types variables. Link: https://lore.kernel.org/lkml/20240904164325.48386-1-chanwoo@kernel.org/ Reviewed-by: Hans de Goede <hdegoede@redhat.com>...
```diff diff --git a/drivers/extcon/extcon-lc824206xa.c b/drivers/extcon/extcon-lc824206xa.c index d58a2c369018..56938748aea8 100644 --- a/drivers/extcon/extcon-lc824206xa.c +++ b/drivers/extcon/extcon-lc824206xa.c @@ -393,14 +393,6 @@ static int lc824206xa_psy_get_prop(struct power_supply *psy, return 0; } -stati...
4bfc9c553f5ea8cbfe085824f3283885cf173c20
Analyze and fix the following issue in the Linux kernel code: drm/xe/display: Avoid encoder_suspend at runtime suspend
Problem Details: Fix circular locking dependency on runtime suspend. <4> [74.952215] ====================================================== <4> [74.952217] WARNING: possible circular locking dependency detected <4> [74.952219] 6.10.0-rc7-xe #1 Not tainted <4> [74.952221] -----------------------------------------------...
```diff diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c index d83046c34f97..c860fda410c8 100644 --- a/drivers/gpu/drm/xe/display/xe_display.c +++ b/drivers/gpu/drm/xe/display/xe_display.c @@ -331,10 +331,10 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime) ...
2ab9d830262c132ab5db2f571003d80850d56b2a
Analyze and fix the following issue in the Linux kernel code: perf/aux: Fix AUX buffer serialization
Problem Details: Ole reported that event->mmap_mutex is strictly insufficient to serialize the AUX buffer, add a per RB mutex to fully serialize it. Note that in the lock order comment the perf_event::mmap_mutex order was already wrong, that is, it nesting under mmap_lock is not new with this patch. Fixes: 45bfb2e504...
```diff diff --git a/kernel/events/core.c b/kernel/events/core.c index c973e3c11e03..8a6c6bbcd658 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -1255,8 +1255,9 @@ static void put_ctx(struct perf_event_context *ctx) * perf_event_context::mutex * perf_event::child_mutex; * perf_event_c...
82122d1f54ec2244fb9c367ee2390b51ce08cf44
Analyze and fix the following issue in the Linux kernel code: drm/xe: Add missing runtime reference to wedged upon gt_reset
Problem Details: Fixes this missed case: xe 0000:00:02.0: [drm] Missing outer runtime PM protection WARNING: CPU: 99 PID: 1455 at drivers/gpu/drm/xe/xe_pm.c:564 xe_pm_runtime_get_noresume+0x48/0x60 [xe] Call Trace: <TASK> ? show_regs+0x67/0x70 ? __warn+0x94/0x1b0 ? xe_pm_runtime_get_noresume+0x48/0x60 [xe] ? report_bu...
```diff diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c index 18cd3deb1498..b8c73f69fbaf 100644 --- a/drivers/gpu/drm/xe/xe_gt.c +++ b/drivers/gpu/drm/xe/xe_gt.c @@ -753,12 +753,13 @@ static int gt_reset(struct xe_gt *gt) xe_gt_info(gt, "reset started\n"); + xe_pm_runtime_get(gt_to_xe(gt)); +...
dce35dd27684640508ff330b8235c4671159743e
Analyze and fix the following issue in the Linux kernel code: spi: spidev_fdx: Fix the wrong format specifier
Problem Details: The unsigned int should use "%u" instead of "%d". Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com> Link: https://patch.msgid.link/20240904073550.103618-1-zhangjiao2@cmss.chinamobile.com Signed-off-by: Mark Brown <broonie@kernel.org>
```diff diff --git a/tools/spi/spidev_fdx.c b/tools/spi/spidev_fdx.c index 7d2a867cd4ae..bc9c4f6c3ba8 100644 --- a/tools/spi/spidev_fdx.c +++ b/tools/spi/spidev_fdx.c @@ -99,7 +99,7 @@ static void dumpstat(const char *name, int fd) return; } - printf("%s: spi mode 0x%x, %d bits %sper word, %d Hz max\n", + printf...
79a31ce03f416cc2b9374b3838c60985bc2cb443
Analyze and fix the following issue in the Linux kernel code: dt-bindings: extcon: convert extcon-usb-gpio.txt to yaml format
Problem Details: Convert binding doc extcon-usb-gpio.txt to yaml format to fix below warning: arch/arm64/boot/dts/freescale/imx8mp-msc-sm2s-ep1.dtb: /extcon-usb0: failed to match any schema with compatible: ['linux,extcon-usb-gpio'] Additional change: - rename id-gpio to id-gpios - rename vbus-gpio to vbus-gpios ...
```diff diff --git a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt deleted file mode 100644 index dfc14f71e81f..000000000000 --- a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt +++ /dev/null @@ -1,21 +0,0 @@ -USB GPIO Extcon de...
38f6c92ee15ddf16b1661830a637c312d90be6b7
Analyze and fix the following issue in the Linux kernel code: dt-bindings: extcon: ptn5150: add child node port
Problem Details: Add child node 'port' to allow connect to usb controller to do role-switch if id pin of ptn5150 have not connected to chip's usb ID function pin. Fix below warning: arch/arm64/boot/dts/freescale/imx8mn-var-som-symphony.dtb: typec@3d: 'port' does not match any of the regexes: 'pinctrl-[0-9]+' f...
```diff diff --git a/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml b/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml index d5cfa32ea52d..072b3c0c5fd0 100644 --- a/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml +++ b/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml @...
086a3c40ebd02a4ac38121cf909326407b2883bc
Analyze and fix the following issue in the Linux kernel code: iommu/tegra241-cmdqv: Fix ioremap() error handling in probe()
Problem Details: The ioremap() function doesn't return error pointers, it returns NULL on error so update the error handling. Also just return directly instead of calling iounmap() on the NULL pointer. Calling iounmap(NULL) doesn't cause a problem on ARM but on other architectures it can trigger a warning so it'a bad...
```diff diff --git a/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c b/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c index 03fd13c21dcc..240b54192177 100644 --- a/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c +++ b/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c @@ -772,9 +772,9 @@ __tegra241_cmdqv_probe(struct arm_smm...
eeb8fdfcf0901578c26ecfb11e814f36bc9a92f5
Analyze and fix the following issue in the Linux kernel code: arm64: Expose the end of the linear map in PHYSMEM_END
Problem Details: The memory hot-plug and resource management code needs to know the largest address which can fit in the linear map, so set PHYSMEM_END for that purpose. This fixes a crash at boot when amdgpu tries to create DEVICE_PRIVATE_MEMORY and is given a physical address by the resource management code which is...
```diff diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 54fb014eba05..0480c61dbb4f 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -110,6 +110,8 @@ #define PAGE_END (_PAGE_END(VA_BITS_MIN)) #endif /* CONFIG_KASAN */ +#define PHYSMEM_END __...
7eced90b202d63cdc1b9b11b1353adb1389830f9
Analyze and fix the following issue in the Linux kernel code: arm64: trans_pgd: mark PTEs entries as valid to avoid dead kexec()
Problem Details: The reasons for PTEs in the kernel direct map to be marked invalid are not limited to kfence / debug pagealloc machinery. In particular, memfd_secret() also steals pages with set_direct_map_invalid_noflush(). When building the transitional page tables for kexec from the current kernel's page tables, t...
```diff diff --git a/arch/arm64/mm/trans_pgd.c b/arch/arm64/mm/trans_pgd.c index 5139a28130c0..0f7b484cb2ff 100644 --- a/arch/arm64/mm/trans_pgd.c +++ b/arch/arm64/mm/trans_pgd.c @@ -42,14 +42,16 @@ static void _copy_pte(pte_t *dst_ptep, pte_t *src_ptep, unsigned long addr) * the temporary mappings we use during re...
2b59ffad47db1c46af25ccad157bb3b25147c35c
Analyze and fix the following issue in the Linux kernel code: jfs: Fix uninit-value access of new_ea in ea_buffer
Problem Details: syzbot reports that lzo1x_1_do_compress is using uninit-value: ===================================================== BUG: KMSAN: uninit-value in lzo1x_1_do_compress+0x19f9/0x2510 lib/lzo/lzo1x_compress.c:178 ... Uninit was stored to memory at: ea_put fs/jfs/xattr.c:639 [inline] ... Local variable...
```diff diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c index 2999ed5d83f5..0fb05e314edf 100644 --- a/fs/jfs/xattr.c +++ b/fs/jfs/xattr.c @@ -434,6 +434,8 @@ static int ea_get(struct inode *inode, struct ea_buffer *ea_buf, int min_size) int rc; int quota_allocation = 0; + memset(&ea_buf->new_ea, 0, sizeof(ea_buf->ne...
87fa4bd351a51ec1eb2d4854f4112c7811fef519
Analyze and fix the following issue in the Linux kernel code: cpufreq: Fix the cacography in powernv-cpufreq.c
Problem Details: The word 'swtich' is wrong, so fix it. Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
```diff diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c index 50c62929f7ca..c1b6280de5dc 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -692,7 +692,7 @@ static void gpstate_timer_handler(struct timer_list *t) } /* - * If PMCR was last ...
abc00ffda43bd4ba85896713464c7510c39f8165
Analyze and fix the following issue in the Linux kernel code: cpufreq: ti-cpufreq: Introduce quirks to handle syscon fails appropriately
Problem Details: Commit b4bc9f9e27ed ("cpufreq: ti-cpufreq: add support for omap34xx and omap36xx") introduced special handling for OMAP3 class devices where syscon node may not be present. However, this also creates a bug where the syscon node is present, however the offset used to read is beyond the syscon defined ra...
```diff diff --git a/drivers/cpufreq/ti-cpufreq.c b/drivers/cpufreq/ti-cpufreq.c index 220fff7a302e..804329e81eb8 100644 --- a/drivers/cpufreq/ti-cpufreq.c +++ b/drivers/cpufreq/ti-cpufreq.c @@ -90,6 +90,9 @@ struct ti_cpufreq_soc_data { unsigned long efuse_shift; unsigned long rev_offset; bool multi_regulator; +...
2b7ec33e534f7a10033a5cf07794acf48b182bbe
Analyze and fix the following issue in the Linux kernel code: cpufreq: loongson3: Use raw_smp_processor_id() in do_service_request()
Problem Details: Use raw_smp_processor_id() instead of plain smp_processor_id() in do_service_request(), otherwise we may get some errors with the driver enabled: BUG: using smp_processor_id() in preemptible [00000000] code: (udev-worker)/208 caller is loongson3_cpufreq_probe+0x5c/0x250 [loongson3_cpufreq] Reported...
```diff diff --git a/drivers/cpufreq/loongson3_cpufreq.c b/drivers/cpufreq/loongson3_cpufreq.c index 5f79b6de127c..6b5e6798d9a2 100644 --- a/drivers/cpufreq/loongson3_cpufreq.c +++ b/drivers/cpufreq/loongson3_cpufreq.c @@ -176,7 +176,7 @@ static DEFINE_PER_CPU(struct loongson3_freq_data *, freq_data); static inline in...
24f9bfb847b7340b91e35742adf0ab87440e7079
Analyze and fix the following issue in the Linux kernel code: cpufreq: Fix warning on unused of_device_id tables for !CONFIG_OF
Problem Details: !CONFIG_OF builds cause warnings on unused of_device_id tables. This is due to of_match_node() being a macro rather than static inline function. Add a __maybe_unused annotation to the of_device_id tables. Fixes: c7582ec85342 ("cpufreq: Drop CONFIG_ARM and CONFIG_ARM64 dependency on Arm drivers") Repor...
```diff diff --git a/drivers/cpufreq/apple-soc-cpufreq.c b/drivers/cpufreq/apple-soc-cpufreq.c index af34c22fa273..4dcacab9b4bf 100644 --- a/drivers/cpufreq/apple-soc-cpufreq.c +++ b/drivers/cpufreq/apple-soc-cpufreq.c @@ -85,7 +85,7 @@ static const struct apple_soc_cpufreq_info soc_default_info = { .cur_pstate_mask ...
49243adc715e6ae34d6cc003827e63bcf5b3a21d
Analyze and fix the following issue in the Linux kernel code: cpufreq/amd-pstate: Add the missing cpufreq_cpu_put()
Problem Details: Fix the reference counting of cpufreq_policy object in amd_pstate_update() function by adding the missing cpufreq_cpu_put(). Fixes: e8f555daacd3 ("cpufreq/amd-pstate: fix setting policy current frequency value") Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com> Reviewed-by: Perry Yuan <perr...
```diff diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 68c616b572f2..eff039ba49ee 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -554,12 +554,15 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf, } if (value == prev) - retu...
359414b33e00bae91e4eabf3e4ef8e76024c7673
Analyze and fix the following issue in the Linux kernel code: perf/arm-cmn: Ensure dtm_idx is big enough
Problem Details: While CMN_MAX_DIMENSION was bumped to 12 for CMN-650, that only supports up to a 10x10 mesh, so bumping dtm_idx to 256 bits at the time worked out OK in practice. However CMN-700 did finally support up to 144 XPs, and thus needs a worst-case 288 bits of dtm_idx for an aggregated XP event on a maxed-out...
```diff diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c index 4e2338afe669..48863b31ccfb 100644 --- a/drivers/perf/arm-cmn.c +++ b/drivers/perf/arm-cmn.c @@ -35,6 +35,9 @@ #define CMN_MAX_XPS (CMN_MAX_DIMENSION * CMN_MAX_DIMENSION) #define CMN_MAX_DTMS (CMN_MAX_XPS + (CMN_MAX_DIMENSION - 1) * 4) +/...
88b63a82c84ed9bbcbdefb10cb6f75dd1dd04887
Analyze and fix the following issue in the Linux kernel code: perf/arm-cmn: Fix CCLA register offset
Problem Details: Apparently pmu_event_sel is offset by 8 for all CCLA nodes, not just the CCLA_RNI combination type. Fixes: 23760a014417 ("perf/arm-cmn: Add CMN-700 support") Acked-by: Mark Rutland <mark.rutland@arm.com> Reviewed-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> Signed-off-by: Robin Murphy <robin.murp...
```diff diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c index b59ae8513dce..4e2338afe669 100644 --- a/drivers/perf/arm-cmn.c +++ b/drivers/perf/arm-cmn.c @@ -70,7 +70,8 @@ /* Technically this is 4 bits wide on DNs, but we only use 2 there anyway */ #define CMN__PMU_OCCUP1_ID GENMASK_ULL(34, 32) -/* HN...
e79634b53e398966c49f803c49701bc74dc3ccf8
Analyze and fix the following issue in the Linux kernel code: perf/arm-cmn: Refactor node ID handling. Again.
Problem Details: The scope of the "extra device ports" configuration is not made clear by the CMN documentation - so far we've assumed it applies globally, based on the sole example which suggests as much. However it transpires that this is incorrect, and the format does in fact vary based on each individual XP's port ...
```diff diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c index c932d9d355cf..b59ae8513dce 100644 --- a/drivers/perf/arm-cmn.c +++ b/drivers/perf/arm-cmn.c @@ -24,14 +24,6 @@ #define CMN_NI_NODE_ID GENMASK_ULL(31, 16) #define CMN_NI_LOGICAL_ID GENMASK_ULL(47, 32) -#define CMN_NODEID_DEVID(reg) ((reg)...
b4886fab6fb620b96ad7eeefb9801c42dfa91741
Analyze and fix the following issue in the Linux kernel code: KVM: Add a module param to allow enabling virtualization when KVM is loaded
Problem Details: Add an on-by-default module param, enable_virt_at_load, to let userspace force virtualization to be enabled in hardware when KVM is initialized, i.e. just before /dev/kvm is exposed to userspace. Enabling virtualization during KVM initialization allows userspace to avoid the additional latency when cr...
```diff diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 09126bb8cc9f..1b52b1b7bbc4 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2648,6 +2648,23 @@ Default is Y (on). + k...
44d17459626052a2390457e550a12cb973506b2f
Analyze and fix the following issue in the Linux kernel code: KVM: Use dedicated mutex to protect kvm_usage_count to avoid deadlock
Problem Details: Use a dedicated mutex to guard kvm_usage_count to fix a potential deadlock on x86 due to a chain of locks and SRCU synchronizations. Translating the below lockdep splat, CPU1 #6 will wait on CPU0 #1, CPU0 #8 will wait on CPU2 #3, and CPU2 #7 will wait on CPU1 #4 (if there's a writer, due to the fairne...
```diff diff --git a/Documentation/virt/kvm/locking.rst b/Documentation/virt/kvm/locking.rst index 02880d5552d5..c0cb5ce51c1e 100644 --- a/Documentation/virt/kvm/locking.rst +++ b/Documentation/virt/kvm/locking.rst @@ -9,7 +9,7 @@ KVM Lock Overview The acquisition orders for mutexes are as follows: -- cpus_read_lo...
f66b63ef10d65cf8ce57a7341262308443705628
Analyze and fix the following issue in the Linux kernel code: dt-bindings: PCI: layerscape-pci: Change property 'fsl,pcie-scfg' type
Problem Details: The fsl,pcie-scfg requires an argument when there are more than one PCIe instances. Thus, change it to the phandle-array type and use items to describe what each field means. This also fixes the following warning: arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dtb: pcie@3400000: fsl,pcie-scfg:0: [2...
```diff diff --git a/Documentation/devicetree/bindings/pci/fsl,layerscape-pcie.yaml b/Documentation/devicetree/bindings/pci/fsl,layerscape-pcie.yaml index 3a76d662309d..be79712836c4 100644 --- a/Documentation/devicetree/bindings/pci/fsl,layerscape-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/fsl,layerscape-pci...
1a1bf58897d20fc38b454dfecd2771e142d36966
Analyze and fix the following issue in the Linux kernel code: dt-bindings: PCI: layerscape-pci: Replace fsl,lx2160a-pcie with fsl,lx2160ar2-pcie
Problem Details: The fsl,lx2160a-pcie compatible is used for mobivel according to the Documentation/devicetree/bindings/pci/layerscape-pcie-gen4.txt file. Whereas the fsl,layerscape-pcie is used for DesignWare PCIe controller binding. So change it to fsl,lx2160ar2-pcie and allow a fall back to fsl,ls2088a-pcie. Whil...
```diff diff --git a/Documentation/devicetree/bindings/pci/fsl,layerscape-pcie.yaml b/Documentation/devicetree/bindings/pci/fsl,layerscape-pcie.yaml index 793986c5af7f..daeab5c0758d 100644 --- a/Documentation/devicetree/bindings/pci/fsl,layerscape-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/fsl,layerscape-pci...
697ba0b6ec4ae04afb67d3911799b5e2043b4455
Analyze and fix the following issue in the Linux kernel code: block: fix integer overflow in BLKSECDISCARD
Problem Details: I independently rediscovered commit 22d24a544b0d49bbcbd61c8c0eaf77d3c9297155 block: fix overflow in blk_ioctl_discard() but for secure erase. Same problem: uint64_t r[2] = {512, 18446744073709551104ULL}; ioctl(fd, BLKSECDISCARD, r); will enter near infinite loop inside blkdev_issue_secure_eras...
```diff diff --git a/block/ioctl.c b/block/ioctl.c index e8e4a4190f18..44257bdfeacb 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -126,7 +126,7 @@ static int blk_ioctl_discard(struct block_device *bdev, blk_mode_t mode, return -EINVAL; filemap_invalidate_lock(bdev->bd_mapping); - err = truncate_bdev_range(bd...
30eb2080fe2043c3e61c1ae4bb6917800b10fb08
Analyze and fix the following issue in the Linux kernel code: PCI: brcmstb: PCI: brcmstb: Make HARD_DEBUG, INTR2_CPU_BASE offsets SoC-specific
Problem Details: Do preparatory work for the 7712 SoC, which is introduced in a future commit. Our HW design has changed two register offsets for the 7712, where previously it was a common value for all Broadcom SoCs with PCIe cores. Specifically, the two offsets are to the registers HARD_DEBUG and INTR2_CPU_BASE. L...
```diff diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 926644eff39d..9d31dd29e831 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -122,7 +122,6 @@ #define PCIE_MEM_WIN0_LIMIT_HI(win) \ PCIE_MISC_CPU_2_PCIE_MEM_WIN0_L...
76f258bf3f2aae570209319944703a92ac64e29e
Analyze and fix the following issue in the Linux kernel code: printk: nbcon: Introduce printer kthreads
Problem Details: Provide the main implementation for running a printer kthread per nbcon console that is takeover/handover aware. This includes: - new mandatory write_thread() callback - kthread creation - kthread main printing loop - kthread wakeup mechanism - kthread shutdown kthread creation is a bit tricky becaus...
```diff diff --git a/include/linux/console.h b/include/linux/console.h index 88050d30a9cc..788ce9c829f6 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -16,7 +16,9 @@ #include <linux/atomic.h> #include <linux/bits.h> +#include <linux/irq_work.h> #include <linux/rculist.h> +#include <linux/rcu...
e37577ebbf1e875f8cc6159f25a1b559018d087f
Analyze and fix the following issue in the Linux kernel code: printk: Fail pr_flush() if before SYSTEM_SCHEDULING
Problem Details: A follow-up change adds pr_flush() to console unregistration. However, with boot consoles unregistration can happen very early if there are also regular consoles registering as well. In this case the pr_flush() is not important because all consoles are flushed when checking the initial console sequence...
```diff diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 6accd1704e73..acf668001096 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -3991,6 +3991,10 @@ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progre u64 diff; u64 seq; + /* Sorry, pr_flush() w...
0d437918fb6473d25fb83188c2d6040f47acfbcd
Analyze and fix the following issue in the Linux kernel code: ARM: 9414/1: Fix build issue with LD_DEAD_CODE_DATA_ELIMINATION
Problem Details: There is a build issue with LD segmentation fault, while CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is not enabled, as bellow. scripts/link-vmlinux.sh: line 49: 3796 Segmentation fault (core dumped) ${ld} ${ldflags} -o ${output} ${wl}--whole-archive ${objs} ${wl}--no-whole-archive ${wl}--start-group ${l...
```diff diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 54b2bb817a7f..173159e93c99 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -117,7 +117,7 @@ config ARM select HAVE_KERNEL_XZ select HAVE_KPROBES if !XIP_KERNEL && !CPU_ENDIAN_BE32 && !CPU_V7M select HAVE_KRETPROBES if HAVE_KPROBES - select HAV...
2be6190cd75cd2029ced5ccef057e15939f48c4a
Analyze and fix the following issue in the Linux kernel code: block: fix comment to use set_current_state
Problem Details: The explanatory comment used `set_task_state` instead of `set_current_state` which is the function actually used in the code. Signed-off-by: Alvaro Parker <alparkerdf@gmail.com> Link: https://lore.kernel.org/r/20240903172214.520086-1-alparkerdf@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
```diff diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c index dd7310c94713..2cfb297d9a62 100644 --- a/block/blk-rq-qos.c +++ b/block/blk-rq-qos.c @@ -263,7 +263,7 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data, has_sleeper = !prepare_to_wait_exclusive(&rqw->wait, &data.wq, TASK_UNINTERRUPTIB...
b858a36fe9a1261dfd097aec855161ad135bed60
Analyze and fix the following issue in the Linux kernel code: bio-integrity: don't restrict the size of integrity metadata
Problem Details: bio_integrity_add_page restricts the size of the integrity metadata to queue_max_hw_sectors(q). This restriction is not needed because oversized bios are split automatically. This restriction causes problems with dm-integrity 'inline' mode - if we send a large bio to dm-integrity and the bio's metadata...
```diff diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 8d1fb38f745f..96a2653905ae 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -167,10 +167,6 @@ int bio_integrity_add_page(struct bio *bio, struct page *page, struct request_queue *q = bdev_get_queue(bio->bi_bdev); struct bio_in...
e58f5142f88320a5b1449f96a146f2f24615c5c7
Analyze and fix the following issue in the Linux kernel code: ublk_drv: fix NULL pointer dereference in ublk_ctrl_start_recovery()
Problem Details: When two UBLK_CMD_START_USER_RECOVERY commands are submitted, the first one sets 'ubq->ubq_daemon' to NULL, and the second one triggers WARN in ublk_queue_reinit() and subsequently a NULL pointer dereference issue. Fix it by adding the check in ublk_ctrl_start_recovery() and return immediately in case...
```diff diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index 890c08792ba8..1d53a3f48a0e 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -2663,6 +2663,8 @@ static int ublk_ctrl_start_recovery(struct ublk_device *ub, mutex_lock(&ub->mutex); if (!ublk_can_use_recovery(ub)) ...
5854809b51f4e3868202d9b45e628133d76b48cd
Analyze and fix the following issue in the Linux kernel code: rpmb: fix error path in rpmb_dev_register()
Problem Details: Until this patch was rpmb_dev_register() always freeing rdev in the error path. However, past device_register() it must not do that since the memory is now managed by the device even if it failed to register properly. So fix this by doing a put_device() before returning the error code. Fixes the smatc...
```diff diff --git a/drivers/misc/rpmb-core.c b/drivers/misc/rpmb-core.c index c8888267c222..bc68cde1a8bf 100644 --- a/drivers/misc/rpmb-core.c +++ b/drivers/misc/rpmb-core.c @@ -187,17 +187,15 @@ struct rpmb_dev *rpmb_dev_register(struct device *dev, rdev->dev.parent = dev; ret = device_register(&rdev->dev); - i...
1a5efc9e13f357abc396dbf445b25d08914c8060
Analyze and fix the following issue in the Linux kernel code: libsubcmd: Don't free the usage string
Problem Details: Currently, commands which depend on 'parse_options_subcommand()' don't show the usage string, and instead show '(null)' $ ./perf sched Usage: (null) -D, --dump-raw-trace dump raw trace in ASCII -f, --force don't complain, do it -i, --input <file> input file name -v,...
```diff diff --git a/tools/lib/subcmd/parse-options.c b/tools/lib/subcmd/parse-options.c index 4b60ec03b0bb..eb896d30545b 100644 --- a/tools/lib/subcmd/parse-options.c +++ b/tools/lib/subcmd/parse-options.c @@ -633,10 +633,11 @@ int parse_options_subcommand(int argc, const char **argv, const struct option *o const ...
6571354269f87ddbe0d0b8c890119326145b08d0
Analyze and fix the following issue in the Linux kernel code: can: rockchip_canfd: rkcanfd_handle_rx_int_one(): implement workaround for erratum 5: check for empty FIFO
Problem Details: The rk3568 CAN-FD errata sheet as of Tue 07 Nov 2023 11:25:31 +08:00 says: | Erratum 5: Counters related to the TXFIFO and RXFIFO exhibit | abnormal counting behavior. | | Due to a bug in the cross-asynchronous logic of the enable signals | for rx_fifo_cnt and txe_fifo_frame_cnt counters, the counts o...
```diff diff --git a/drivers/net/can/rockchip/rockchip_canfd-rx.c b/drivers/net/can/rockchip/rockchip_canfd-rx.c index 5398aff0d180..609282359bca 100644 --- a/drivers/net/can/rockchip/rockchip_canfd-rx.c +++ b/drivers/net/can/rockchip/rockchip_canfd-rx.c @@ -47,6 +47,16 @@ rkcanfd_fifo_header_to_cfd_header(const struct...
b6ecc662037694488bfff7c9fd21c405df8411f2
Analyze and fix the following issue in the Linux kernel code: net: mana: Fix error handling in mana_create_txq/rxq's NAPI cleanup
Problem Details: Currently napi_disable() gets called during rxq and txq cleanup, even before napi is enabled and hrtimer is initialized. It causes kernel panic. ? page_fault_oops+0x136/0x2b0 ? page_counter_cancel+0x2e/0x80 ? do_user_addr_fault+0x2f2/0x640 ? refill_obj_stock+0xc4/0x110 ? exc_page_fault+0x71/0x...
```diff diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c index 39f56973746d..3d151700f658 100644 --- a/drivers/net/ethernet/microsoft/mana/mana_en.c +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c @@ -1872,10 +1872,12 @@ static void mana_destroy_txq(struct m...
c4d37c54c3739530f8585ccf064fb712913f8375
Analyze and fix the following issue in the Linux kernel code: drm/i915/display: Fix BMG CCS modifiers
Problem Details: Let I915_FORMAT_MOD_4_TILED_BMG_CCS show up as supported modifier Fixes: 97c6efb36497 ("drm/i915/display: Plane capability for 64k phys alignment") Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwo...
```diff diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c index 9452cad41d07..17d4c880ecc4 100644 --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c @@ -2453,6 +2453,9 @@ static u8 skl_get_p...
8db70faeab9005cbab36e05ba94383075b5cb5db
Analyze and fix the following issue in the Linux kernel code: cpu: Fix W=1 build kernel-doc warning
Problem Details: Building the kernel with W=1 generates the following warning: kernel/cpu.c:2693: warning: This comment starts with '/**', but isn't a kernel-doc comment. The function topology_is_core_online() is a simple helper function and doesn't need a kernel-doc comment. Use a normal comment instead....
```diff diff --git a/kernel/cpu.c b/kernel/cpu.c index c16a9b66baba..0c9c5dfc8ddd 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -2705,9 +2705,7 @@ int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval) return ret; } -/** - * Check if the core a CPU belongs to is online - */ +/* Check if the core a CPU belongs to ...
79f8b28e85f83563c86f528b91eff19c0c4d1177
Analyze and fix the following issue in the Linux kernel code: timers: Annotate possible non critical data race of next_expiry
Problem Details: Global timers could be expired remotely when the target CPU is idle. After a remote timer expiry, the remote timer_base->next_expiry value is updated while holding the timer_base->lock. When the formerly idle CPU becomes active at the same time and checks whether timers need to expire, this check is do...
```diff diff --git a/kernel/time/timer.c b/kernel/time/timer.c index d8eb368a5a5b..311ea459b976 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -672,7 +672,7 @@ static void enqueue_timer(struct timer_base *base, struct timer_list *timer, * Set the next expiry time and kick the CPU so it * can reev...
32c055ef563c3a4a73a477839f591b1b170bde8e
Analyze and fix the following issue in the Linux kernel code: clk: imx6ul: fix clock parent for IMX6UL_CLK_ENETx_REF_SEL
Problem Details: Commit 4e197ee880c24ecb63f7fe17449b3653bc64b03c ("clk: imx6ul: add ethernet refclock mux support") sets the internal clock as default ethernet clock. Since IMX6UL_CLK_ENET_REF cannot be parent for IMX6UL_CLK_ENET1_REF_SEL, the call to clk_set_parent() fails. IMX6UL_CLK_ENET1_REF_125M is the correct pa...
```diff diff --git a/drivers/clk/imx/clk-imx6ul.c b/drivers/clk/imx/clk-imx6ul.c index f9394e94f69d..05c7a82b751f 100644 --- a/drivers/clk/imx/clk-imx6ul.c +++ b/drivers/clk/imx/clk-imx6ul.c @@ -542,8 +542,8 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) clk_set_parent(hws[IMX6UL_CLK_ENFC_SE...
2910a7fa1be090fc7637cef0b2e70bcd15bf5469
Analyze and fix the following issue in the Linux kernel code: iommu/amd: Do not set the D bit on AMD v2 table entries
Problem Details: The manual says that bit 6 is IGN for all Page-Table Base Address pointers, don't set it. Fixes: aaac38f61487 ("iommu/amd: Initial support for AMD IOMMU v2 page table") Reviewed-by: Vasant Hegde <vasant.hegde@amd.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/14-v...
```diff diff --git a/drivers/iommu/amd/io_pgtable_v2.c b/drivers/iommu/amd/io_pgtable_v2.c index 77cc1b4a3f02..25b9042fa453 100644 --- a/drivers/iommu/amd/io_pgtable_v2.c +++ b/drivers/iommu/amd/io_pgtable_v2.c @@ -51,7 +51,7 @@ static inline u64 set_pgtable_attr(u64 *page) u64 prot; prot = IOMMU_PAGE_PRESENT | I...
a06dcb6b7897152e4dafdc9d4d84e9a35d0ae94a
Analyze and fix the following issue in the Linux kernel code: iommu/amd: Fix typo of , instead of ;
Problem Details: Generates the same code, but is not the expected C style. Fixes: aaac38f61487 ("iommu/amd: Initial support for AMD IOMMU v2 page table") Reviewed-by: Vasant Hegde <vasant.hegde@amd.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/11-v2-831cdc4d00f3+1a315-amd_iopgtbl...
```diff diff --git a/drivers/iommu/amd/io_pgtable_v2.c b/drivers/iommu/amd/io_pgtable_v2.c index ed2c1faae6d5..910fe1879f3e 100644 --- a/drivers/iommu/amd/io_pgtable_v2.c +++ b/drivers/iommu/amd/io_pgtable_v2.c @@ -375,9 +375,9 @@ static struct io_pgtable *v2_alloc_pgtable(struct io_pgtable_cfg *cfg, void *coo pgtabl...
322d889ae7d39f8538a6deac35869aa3be1855bd
Analyze and fix the following issue in the Linux kernel code: iommu/amd: Remove amd_iommu_domain_update() from page table freeing
Problem Details: It is a serious bug if the domain is still mapped to any DTEs when it is freed as we immediately start freeing page table memory, so any remaining HW touch will UAF. If it is not mapped then dev_list is empty and amd_iommu_domain_update() does nothing. Remove it and add a WARN_ON() to catch this clas...
```diff diff --git a/drivers/iommu/amd/io_pgtable.c b/drivers/iommu/amd/io_pgtable.c index 03a3b09f0512..0743b698128d 100644 --- a/drivers/iommu/amd/io_pgtable.c +++ b/drivers/iommu/amd/io_pgtable.c @@ -577,9 +577,6 @@ static void v1_free_pgtable(struct io_pgtable *iop) /* Update data structure */ amd_iommu_domai...
7a41dcb52f9de6079621fc31c3b84c7fc290934b
Analyze and fix the following issue in the Linux kernel code: iommu/amd: Set the pgsize_bitmap correctly
Problem Details: When using io_pgtable the correct pgsize_bitmap is stored in the cfg, both v1_alloc_pgtable() and v2_alloc_pgtable() set it correctly. This fixes a bug where the v2 pgtable had the wrong pgsize as protection_domain_init_v2() would set it and then do_iommu_domain_alloc() immediately resets it. Remove ...
```diff diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 70213f94e24c..c90a53a0385d 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -2264,26 +2264,11 @@ void protection_domain_free(struct protection_domain *domain) kfree(domain); } -static int protection_domain_ini...
b0a6c883bcd42eeb0850135e529b34b64d57673c
Analyze and fix the following issue in the Linux kernel code: iommu/amd: Allocate the page table root using GFP_KERNEL
Problem Details: Domain allocation is always done under a sleepable context, the v1 path and other drivers use GFP_KERNEL already. Fix the v2 path to also use GFP_KERNEL. Fixes: 0d571dcbe7c6 ("iommu/amd: Allocate page table using numa locality info") Reviewed-by: Vasant Hegde <vasant.hegde@amd.com> Signed-off-by: Jaso...
```diff diff --git a/drivers/iommu/amd/io_pgtable_v2.c b/drivers/iommu/amd/io_pgtable_v2.c index 664e91c88748..6088822180e1 100644 --- a/drivers/iommu/amd/io_pgtable_v2.c +++ b/drivers/iommu/amd/io_pgtable_v2.c @@ -362,7 +362,7 @@ static struct io_pgtable *v2_alloc_pgtable(struct io_pgtable_cfg *cfg, void *coo struct...
f68db46a0977858f8a52987acc54454afd4c2ed5
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx: rename gpio hog as <gpio name>-hog
Problem Details: Rename admin_led_lower to admin-led-lower-hog. Rename gpio rs485_en as rs485-en-hog. Rename gpio uart4_rs485_en to uart4-rs485-en-hog. Fix below warning: arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dtb: gpio@76: 'admin_led_lower' does not match any of the regexes: '^(hog-[0-9]+|.+-hog(-[0-9]+)?)...
```diff diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts b/arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts index bea9e8bcafc4..bc0d89427fbe 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts @@ -220,7 +220,7 @@ #gpio-cells = ...
96aaa0a893d16026ff77152ec27a3fa8e135b865
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx8mm-beacon-kit: add DVDD-supply and DOVDD-supply
Problem Details: According to binding doc, DVDD-supply and DOVDD-supply is required properties. Add these to fix below warning: arch/arm64/boot/dts/freescale/imx8mm-beacon-kit.dtb: camera@10: 'DVDD-supply' is a required proper Signed-off-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Adam Ford <aford173@gmail.com> Signe...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi index 6086dae2e5fb..ea1d5b9c6bae 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi @@ -56,6 ...
6f1d1dc17e46dc6e04f0fd6e1c6c9076d4970947
Analyze and fix the following issue in the Linux kernel code: arm64: dts: s32v234: remove fallback compatible string arm,cortex-a9-gic
Problem Details: Remove fallback comaptible string arm,cortex-a9-gic to fix below warning: /home/lizhi/source/linux-upstream-dts/arch/arm64/boot/dts/freescale/s32v234-evb.dtb: interrupt-controller@7d001000: compatible: 'oneOf' conditional failed, one must be fixed: ['arm,cortex-a15-gic', 'arm,cortex-a9-gic...
```diff diff --git a/arch/arm64/boot/dts/freescale/s32v234.dtsi b/arch/arm64/boot/dts/freescale/s32v234.dtsi index 42409ec56792..bf608ded5dda 100644 --- a/arch/arm64/boot/dts/freescale/s32v234.dtsi +++ b/arch/arm64/boot/dts/freescale/s32v234.dtsi @@ -89,7 +89,7 @@ }; gic: interrupt-controller@7d001000 { - compat...
cb2633ee47d92029de74ab67d2a1fe1368d611a8
Analyze and fix the following issue in the Linux kernel code: arm64: dts: fsl-ls1088a-ten64: change to low case hex value
Problem Details: Change to low case for hex value to fix below warning: arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dtb: flash@0: partitions: Unevaluated properties are not allowed ('partition@5C0000' was unexpected) Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
```diff diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts b/arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts index d4867d6cf47c..bea9e8bcafc4 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts @@ -323,9 +323,9 @@ reg = <0x580...
5c7a868e297fcd3982162d5e3f9da5202103650b
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx8mp-venice: add vddl and vana for sensor@10
Problem Details: Add vddl and vana for sensor@10 to fix below warning: arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-imx219.dtb: sensor@10: 'VANA-supply' is a required property Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
```diff diff --git a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-imx219.dtso b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-imx219.dtso index 4eaf8aabcbff..c09aa80d2ba2 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-imx219.dtso +++ b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw7...
e1a23f2ba98d4d04999da01b667f765b9666b445
Analyze and fix the following issue in the Linux kernel code: arm64: dts: fsl-lx2160a-tqmlx2160a: change "vcc" to "vdd" for hub*
Problem Details: According to binging doc usb/ti,usb8041.yaml and in drivers/usb/misc/onboard_usb_dev.h ti_tusb8041_data = { .supply_names = { "vdd" },}; It should vdd-supply instead vcc-supply. Fixes: 04b77e0124ef ("arm64: dts: freescale: add fsl-lx2160a-mblx2160a board") Reviewed-by: Alexander Stein <alexander.ste...
```diff diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a-tqmlx2160a-mblx2160a.dts b/arch/arm64/boot/dts/freescale/fsl-lx2160a-tqmlx2160a-mblx2160a.dts index da0f58e26b9a..f6a4f8d54301 100644 --- a/arch/arm64/boot/dts/freescale/fsl-lx2160a-tqmlx2160a-mblx2160a.dts +++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a-tq...
f3ab34595c530815810b743a85502cb52c923335
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx8mm-venice-gw7902(3): add #address-cells for gsc@20
Problem Details: Add #address-cells and #size-cells for gsc@20 node to fix below warning: arch/arm64/boot/dts/freescale/imx8mm-venice-gw7902.dtb: gsc@20: '#address-cells' is a required property Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
```diff diff --git a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw7902.dts b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw7902.dts index 1d56f2a6c06a..c11260c26d0b 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw7902.dts +++ b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw7902.dts @@ -314,6 +314,8 @@ in...
beb9c79ef91d668680b09112769f18270ecf1602
Analyze and fix the following issue in the Linux kernel code: arm64: dts: fsl-ls1028: add missed supply for wm8904
Problem Details: Add A(CP, DB, DC, MIC)VDD-supply for wm8904 to fix below warning: arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28-var3-ads2.dtb: audio-codec@1a: 'AVDD-supply' is a required property Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
```diff diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28-var3-ads2.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28-var3-ads2.dts index 195bdbafdf7c..d9fac647f432 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28-var3-ads2.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls10...
82cf5d1fb908bca8a98300219bfe68aaa1d2a4e2
Analyze and fix the following issue in the Linux kernel code: arm64: dts: layerscape: rename mdio-mux-emi to mdio-mux@<addr>
Problem Details: Rename node name mdio-mux-emi<n>@<addr> to mdio-mux@<addr>. Fix below warning: arch/arm64/boot/dts/freescale/fsl-ls1046a-qds.dtb: board-control@2,0: 'mdio-mux-emi1@54' does not match any of the regexes: '^mdio-mux@[a-f0-9,]+$', 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/board/fsl,...
```diff diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts b/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts index 11b1356e95d5..e850551b16ac 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts @@ -211,7 +211,7 @@ }; &fpga { - mdio-mux...
6daeee3e422ac4c978cad7a526b1aa664dab0e4a
Analyze and fix the following issue in the Linux kernel code: arm64: dts: fsl-ls1012a-frdm: move clock-sc16is7xx under root node
Problem Details: Move fixed clock "clock-sc16is7x" from dspi to root node to fix below warning: arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dtb: serial@0: Unevaluated properties are not allowed ('clock-sc16is7xx' was unexpected) Acked-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Frank Li...
```diff diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts b/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts index 2517528f684f..75081ce3e9a6 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts @@ -20,6 +20,12 @@ clock-frequency = <...
d509a067be0443e06ba78c972c7cbb1fb6a0e3cc
Analyze and fix the following issue in the Linux kernel code: arm64: dts: fsl-ls1043a: move "fsl,ls1043a-qdma" ahead "fsl,ls1021a-qdma"
Problem Details: Move fsl,ls1043a-qdma ahead fallback string fsl,ls1021a-qdma. Fix warning: dma-controller@8380000: compatible: 'oneOf' conditional failed, one must be fixed: ['fsl,ls1021a-qdma', 'fsl,ls1043a-qdma'] is too long Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Fran...
```diff diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi index cf92badc6655..e3b4cd269d2d 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi @@ -955,7 +955,7 @@ }; qdma: dma-controller@83800...
3157f6cd7159384445ba9d6ec49d7a730f5ee4bd
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx8-ss-img: remove undocument slot for jpeg
Problem Details: Remove undocument 'slot' property. It is default 0 at driver. We can remove it safely. Fix below warning: arch/arm64/boot/dts/freescale/imx8dx-colibri-iris.dtb: jpegdec@58400000: 'slot' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Shaw...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx8-ss-img.dtsi b/arch/arm64/boot/dts/freescale/imx8-ss-img.dtsi index 77d2928997b4..d39242c1b9f7 100644 --- a/arch/arm64/boot/dts/freescale/imx8-ss-img.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8-ss-img.dtsi @@ -26,7 +26,6 @@ img_subsys: bus@58000000 { assigned-...
293aa9ec694e633bff83ab93715a2684e15fe214
Analyze and fix the following issue in the Linux kernel code: iommu/amd: Handle error path in amd_iommu_probe_device()
Problem Details: Do not try to set max_pasids in error path as dev_data is not allocated. Fixes: a0c47f233e68 ("iommu/amd: Introduce iommu_dev_data.max_pasids") Signed-off-by: Vasant Hegde <vasant.hegde@amd.com> Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Link: https://lore.kernel.org/r/20240828...
```diff diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index f90fd106906c..51b226b9e727 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -2187,11 +2187,12 @@ static struct iommu_device *amd_iommu_probe_device(struct device *dev) dev_err(dev, "Failed to initialize - trying...
d205c06a326e435057c807bf1e962327de53bb52
Analyze and fix the following issue in the Linux kernel code: soc: fsl: cpm1: qmc: Fix dependency on fsl_soc.h
Problem Details: QMC driver requires fsl_soc.h to use function get_immrbase(). This header is provided by powerpc architecture and the functions it declares are defined only when FSL_SOC is selected. Today the dependency is the following: depends on CPM1 || QUICC_ENGINE || \ (FSL_SOC && (CPM || QUICC_ENGINE) &&...
```diff diff --git a/drivers/soc/fsl/qe/Kconfig b/drivers/soc/fsl/qe/Kconfig index 5e3c996eb19e..eb03f42ab978 100644 --- a/drivers/soc/fsl/qe/Kconfig +++ b/drivers/soc/fsl/qe/Kconfig @@ -48,8 +48,7 @@ config CPM_TSA config CPM_QMC tristate "CPM/QE QMC support" depends on OF && HAS_IOMEM - depends on CPM1 || QUICC_...
532f0d109658232b44dc36b1656c92ec4d1cb28b
Analyze and fix the following issue in the Linux kernel code: drm/bridge/tdp158: fix build failure
Problem Details: ARCH=arm build fails with: CC [M] drivers/gpu/drm/bridge/ti-tdp158.o ../drivers/gpu/drm/bridge/ti-tdp158.c: In function ‘tdp158_enable’: ../drivers/gpu/drm/bridge/ti-tdp158.c:31:9: error: implicit declaration of function ‘gpiod_set_value_cansleep’ [-Werror=implicit-function-declaration] 31 | ...
```diff diff --git a/drivers/gpu/drm/bridge/ti-tdp158.c b/drivers/gpu/drm/bridge/ti-tdp158.c index 4ee0ad29874d..3472ed5924e8 100644 --- a/drivers/gpu/drm/bridge/ti-tdp158.c +++ b/drivers/gpu/drm/bridge/ti-tdp158.c @@ -2,10 +2,13 @@ /* * Copyright 2024 Freebox SAS */ -#include <drm/drm_bridge.h> -#include <drm/drm...
461ed4aad0189eee670c980656de93bf6fa3a3dc
Analyze and fix the following issue in the Linux kernel code: drm/mm: annotate drm_mm_node_scanned_block() with __maybe_unused
Problem Details: Clang build with CONFIG_DRM_DEBUG_MM=n, CONFIG_WERROR=y, and W=1 leads to: CC [M] drivers/gpu/drm/drm_mm.o ../drivers/gpu/drm/drm_mm.c:614:20: error: function 'drm_mm_node_scanned_block' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static inline bool drm_mm_node_s...
```diff diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index 1ed68d3cd80b..ca254611b382 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c @@ -611,7 +611,7 @@ int drm_mm_insert_node_in_range(struct drm_mm * const mm, } EXPORT_SYMBOL(drm_mm_insert_node_in_range); -static inline bo...
53bd7c1c0077db533472ae32799157758302ef48
Analyze and fix the following issue in the Linux kernel code: drm/mm: Mark drm_mm_interval_tree*() functions with __maybe_unused
Problem Details: The INTERVAL_TREE_DEFINE() uncoditionally provides a bunch of helper functions which in some cases may be not used. This, in particular, prevents kernel builds with clang, `make W=1` and CONFIG_WERROR=y: .../drm/drm_mm.c:152:1: error: unused function 'drm_mm_interval_tree_insert' [-Werror,-Wunused-fun...
```diff diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index 5ace481c1901..1ed68d3cd80b 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c @@ -151,7 +151,7 @@ static void show_leaks(struct drm_mm *mm) { } INTERVAL_TREE_DEFINE(struct drm_mm_node, rb, u64, __subtree_last, - ...
9313d139aa25e572d860f6f673b73a20f32d7f93
Analyze and fix the following issue in the Linux kernel code: usb: gadget: dummy_hcd: execute hrtimer callback in softirq context
Problem Details: Commit a7f3813e589f ("usb: gadget: dummy_hcd: Switch to hrtimer transfer scheduler") switched dummy_hcd to use hrtimer and made the timer's callback be executed in the hardirq context. With that change, __usb_hcd_giveback_urb now gets executed in the hardirq context, which causes problems for KCOV and...
```diff diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index f37b0d8386c1..ff7bee78bcc4 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -1304,7 +1304,8 @@ static int dummy_urb_enqueue( /* kick the scheduler, it'll do the rest */ if ...
1403c8b14765eab805377dd3b75e96ace8747aed
Analyze and fix the following issue in the Linux kernel code: IB/core: Fix ib_cache_setup_one error flow cleanup
Problem Details: When ib_cache_update return an error, we exit ib_cache_setup_one instantly with no proper cleanup, even though before this we had already successfully done gid_table_setup_one, that results in the kernel WARN below. Do proper cleanup using gid_table_cleanup_one before returning the err in order to fix...
```diff diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index 6791df64a5fe..b7c078b7f7cf 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c @@ -1640,8 +1640,10 @@ int ib_cache_setup_one(struct ib_device *device) rdma_for_each_port (device, p) { err =...
112e6e83a894260cc7efe79a1fc47d4d51461742
Analyze and fix the following issue in the Linux kernel code: IB/mlx5: Fix UMR pd cleanup on error flow of driver init
Problem Details: The cited commit moves the pd allocation from function mlx5r_umr_resource_cleanup() to a new function mlx5r_umr_cleanup(). So the fix in commit [1] is broken. In error flow, will hit panic [2]. Fix it by checking pd pointer to avoid panic if it is NULL; [1] RDMA/mlx5: Fix UMR cleanup on error flow of...
```diff diff --git a/drivers/infiniband/hw/mlx5/umr.c b/drivers/infiniband/hw/mlx5/umr.c index eb74c163fd83..887fd6fa3ba9 100644 --- a/drivers/infiniband/hw/mlx5/umr.c +++ b/drivers/infiniband/hw/mlx5/umr.c @@ -224,6 +224,9 @@ int mlx5r_umr_init(struct mlx5_ib_dev *dev) void mlx5r_umr_cleanup(struct mlx5_ib_dev *dev...
a794331325f143bd010a91aa078547fee7fe907e
Analyze and fix the following issue in the Linux kernel code: gpio: stmpe: Fix IRQ related error messages
Problem Details: First of all, remove duplicate message that platform_get_irq() does already print. Second, correct the error message when unable to register a handler, which is broken in two ways: 1) the misleading 'get' vs. 'register'; 2) missing '\n' at the end. (Yes, for the curious ones, the dev_*() cases do not ...
```diff diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index abd42a975b09..4e171f9075bf 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -464,6 +464,7 @@ static void stmpe_gpio_disable(void *stmpe) static int stmpe_gpio_probe(struct platform_device *pdev) { + struct devi...
6f1833b8208c3b9e59eff10792667b6639365146
Analyze and fix the following issue in the Linux kernel code: mm: memory_hotplug: unify Huge/LRU/non-LRU movable folio isolation
Problem Details: Use the isolate_folio_to_list() to unify hugetlb/LRU/non-LRU folio isolation, which cleanup code a bit and save a few calls to compound_head(). [wangkefeng.wang@huawei.com: various fixes] Link: https://lkml.kernel.org/r/20240829150500.2599549-1-wangkefeng.wang@huawei.com Link: https://lkml.kernel.or...
```diff diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 6bdac4cddd9f..4c6e3b181204 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1772,15 +1772,14 @@ found: static void do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) { + struct folio *folio; unsigned long pfn; - struc...
9bfbaa5e44c52422a046ce291469c8ebeb6c475d
Analyze and fix the following issue in the Linux kernel code: mm/damon: move kunit tests to tests/ subdirectory with _kunit suffix
Problem Details: There was a discussion about better places for kunit test code[1] and test file name suffix[2]. Folowwing the conclusion, move kunit tests for DAMON to mm/damon/tests/ subdirectory and rename those. [1] https://lore.kernel.org/CABVgOS=pUdWb6NDHszuwb1HYws4a1-b1UmN=i8U_ED7HbDT0mg@mail.gmail.com [2] htt...
```diff diff --git a/mm/damon/core.c b/mm/damon/core.c index 7a87628b76ab..086294279b07 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -2205,4 +2205,4 @@ static int __init damon_init(void) subsys_initcall(damon_init); -#include "core-test.h" +#include "tests/core-kunit.h" diff --git a/mm/damon/dbgfs.c b/mm/...
61879eed1f180ff92c2324b24d06eeddcc9256bd
Analyze and fix the following issue in the Linux kernel code: mm/damon/dbgfs-test: skip dbgfs_set_init_regions() test if PADDR is not registered
Problem Details: The test depends on registration of DAMON_OPS_PADDR. It would be registered only when CONFIG_DAMON_PADDR is set. DAMON core kunit tests do fake ops registration for such case. However, the functions for such fake ops registration is not available to DAMON debugfs interface. Just skip the test in th...
```diff diff --git a/mm/damon/dbgfs-test.h b/mm/damon/dbgfs-test.h index 9bd5dca5d4ad..d2ecfcc8db86 100644 --- a/mm/damon/dbgfs-test.h +++ b/mm/damon/dbgfs-test.h @@ -116,6 +116,11 @@ static void damon_dbgfs_test_set_init_regions(struct kunit *test) int i, rc; char buf[256]; + if (!damon_is_registered_ops(DAMON_O...
8e34bac5a268b2fb3a88231a9b94cada8adcc8c0
Analyze and fix the following issue in the Linux kernel code: mm/damon/dbgfs-test: skip dbgfs_set_targets() test if PADDR is not registered
Problem Details: The test depends on registration of DAMON_OPS_PADDR. It would be registered only when CONFIG_DAMON_PADDR is set. DAMON core kunit tests do fake ops registration for such case. However, the functions for such fake ops registration is not available to DAMON debugfs interface. Just skip the test in th...
```diff diff --git a/mm/damon/dbgfs-test.h b/mm/damon/dbgfs-test.h index 2d85217f5ba4..9bd5dca5d4ad 100644 --- a/mm/damon/dbgfs-test.h +++ b/mm/damon/dbgfs-test.h @@ -73,6 +73,11 @@ static void damon_dbgfs_test_set_targets(struct kunit *test) struct damon_ctx *ctx = dbgfs_new_ctx(); char buf[64]; + if (!damon_is_...
e43772dcdf21a8cdf3666ee35b2a7166ad39b255
Analyze and fix the following issue in the Linux kernel code: mm/damon/core-test: fix damon_test_ops_registration() for DAMON_VADDR unset case
Problem Details: DAMON core kunit test can be executed without CONFIG_DAMON_VADDR. In the case, vaddr DAMON ops is not registered. Meanwhile, ops registration kunit test assumes the vaddr ops is registered. Check and handle the case by registrering fake vaddr ops inside the test code. Link: https://lkml.kernel.org/...
```diff diff --git a/mm/damon/core-test.h b/mm/damon/core-test.h index ef36d586d6ee..ae03df71737e 100644 --- a/mm/damon/core-test.h +++ b/mm/damon/core-test.h @@ -247,8 +247,16 @@ static void damon_test_ops_registration(struct kunit *test) { struct damon_ctx *c = damon_new_ctx(); struct damon_operations ops = {.id...
582c04b07fa91665b4f38682c290fb9f0b085c7e
Analyze and fix the following issue in the Linux kernel code: selftests/damon: cleanup __pycache__/ with 'make clean'
Problem Details: Python-based tests creates __pycache__/ directory. Remove it with 'make clean' by defining it as EXTRA_CLEAN. Link: https://lkml.kernel.org/r/20240827030336.7930-3-sj@kernel.org Fixes: b5906f5f7359 ("selftests/damon: add a test for update_schemes_tried_regions sysfs command") Signed-off-by: SeongJae ...
```diff diff --git a/tools/testing/selftests/damon/Makefile b/tools/testing/selftests/damon/Makefile index 1e2e98cc809d..5b2a6a5dd1af 100644 --- a/tools/testing/selftests/damon/Makefile +++ b/tools/testing/selftests/damon/Makefile @@ -25,4 +25,6 @@ TEST_PROGS += debugfs_target_ids_pid_leak.sh TEST_PROGS += sysfs_updat...
9cb75552f421c5e9667bc19fb430063cb023c219
Analyze and fix the following issue in the Linux kernel code: selftests/damon: add access_memory_even to .gitignore
Problem Details: Patch series "misc fixups for DAMON {self,kunit} tests". This patchset is for minor fixups of DAMON selftests and kunit tests. First three patches make DAMON selftests more cleanly maintained (patches 1 and 2) without unnecessary warnings (patch 3). Following six patches remove unnecessary test case...
```diff diff --git a/tools/testing/selftests/damon/.gitignore b/tools/testing/selftests/damon/.gitignore index e65ef9d9cedc..2ab675fecb6b 100644 --- a/tools/testing/selftests/damon/.gitignore +++ b/tools/testing/selftests/damon/.gitignore @@ -3,3 +3,4 @@ huge_count_read_write debugfs_target_ids_read_before_terminate_r...
f22cde4371f3c624e947a35b075c06c771442a43
Analyze and fix the following issue in the Linux kernel code: sched/numa: Fix the vma scan starving issue
Problem Details: Problem statement: Since commit fc137c0ddab2 ("sched/numa: enhance vma scanning logic"), the Numa vma scan overhead has been reduced a lot. Meanwhile, the reducing of the vma scan might create less Numa page fault information. The insufficient information makes it harder for the Numa balancer to make...
```diff diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 20ea6d085305..a1b756f927b2 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3187,6 +3187,15 @@ static bool vma_is_accessed(struct mm_struct *mm, struct vm_area_struct *vma) return true; } + /* + * This vma has not been accessed f...
073c78edf5bbd32046a117fc7f71312dc3d2c607
Analyze and fix the following issue in the Linux kernel code: memory tier: fix deadlock warning while onlining pages
Problem Details: commit 823430c8e9d9 ("memory tier: consolidate the initialization of memory tiers") introduces a locking change that use guard(mutex) to instead of mutex_lock/unlock() for memory_tier_lock. It unexpectedly expanded the locked region to include the hotplug_memory_notifier(), as a result, it triggers an...
```diff diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c index 2a642ea86cb2..ed7607f692bd 100644 --- a/mm/memory-tiers.c +++ b/mm/memory-tiers.c @@ -914,13 +914,14 @@ static int __init memory_tier_init(void) WARN_ON(!node_demotion); #endif - guard(mutex)(&memory_tier_lock); + mutex_lock(&memory_tier_lock); /* ...
7de8728f55ffd6497d4ef590218fad8da7f1af92
Analyze and fix the following issue in the Linux kernel code: mm: vmalloc: refactor vm_area_alloc_pages() function
Problem Details: The aim is to simplify and making the vm_area_alloc_pages() function less confusing as it became more clogged nowadays: - eliminate a "bulk_gfp" variable and do not overwrite a gfp flag for bulk allocator; - drop __GFP_NOFAIL flag for high-order-page requests on upper layer. It becomes less spread...
```diff diff --git a/mm/vmalloc.c b/mm/vmalloc.c index dfa8f09e7e9d..264a2627bea4 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -3515,8 +3515,6 @@ vm_area_alloc_pages(gfp_t gfp, int nid, unsigned int order, unsigned int nr_pages, struct page **pages) { unsigned int nr_allocated = 0; - gfp_t alloc_gfp = gfp; - b...
01c373e9a5ce2273812eaf83036c5357829fb3f7
Analyze and fix the following issue in the Linux kernel code: mm: rework vm_ops->close() handling on VMA merge
Problem Details: In commit 714965ca8252 ("mm/mmap: start distinguishing if vma can be removed in mergeability test") we relaxed the VMA merge rules for VMAs possessing a vm_ops->close() hook, permitting this operation in instances where we wouldn't delete the VMA as part of the merge operation. This was later correcte...
```diff diff --git a/mm/vma.c b/mm/vma.c index 393bef832604..8d1686fc8d5a 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -10,14 +10,6 @@ static inline bool is_mergeable_vma(struct vma_merge_struct *vmg, bool merge_next) { struct vm_area_struct *vma = merge_next ? vmg->next : vmg->prev; - /* - * If the vma has a ->close o...
4e52a60ac5c079000add146ca39b0edcc30f74cd
Analyze and fix the following issue in the Linux kernel code: tools: improve vma test Makefile
Problem Details: Patch series "mm: remove vma_merge()", v3. The infamous vma_merge() function has been the cause of a great deal of pain, bugs and confusion for a very long time. It is subtle, contains many corner cases, tries to do far too much and is as a result very fragile. The fact that the function requires th...
```diff diff --git a/tools/testing/vma/Makefile b/tools/testing/vma/Makefile index bfc905d222cf..860fd2311dcc 100644 --- a/tools/testing/vma/Makefile +++ b/tools/testing/vma/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later -.PHONY: default +.PHONY: default clean default: vma @@ -9,7 +9,9 @@ ...
20831cd6f814eade5e2fffce41352d8e8de1e764
Analyze and fix the following issue in the Linux kernel code: mm/vma: drop incorrect comment from vms_gather_munmap_vmas()
Problem Details: The comment has been outdated since 6b73cff239e52 ("mm: change munmap splitting order and move_vma()"). The move_vma() was altered to fix the fragile state of the accounting since then. Link: https://lkml.kernel.org/r/20240830040101.822209-21-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett <Li...
```diff diff --git a/mm/vma.c b/mm/vma.c index 3350fe2088bc..1736bb237b2c 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -755,13 +755,8 @@ int vms_gather_munmap_vmas(struct vma_munmap_struct *vms, /* * If we need to split any vma, do it now to save pain later. - * - * Note: mremap's move_vma VM_ACCOUNT handling assum...
4f87153e82c4906e917d273ab7accd0d540aab35
Analyze and fix the following issue in the Linux kernel code: mm: change failure of MAP_FIXED to restoring the gap on failure
Problem Details: Prior to call_mmap(), the vmas that will be replaced need to clear the way for what may happen in the call_mmap(). This clean up work includes clearing the ptes and calling the close() vm_ops. Some users do more setup than can be restored by calling the vm_ops open() function. It is safer to store t...
```diff diff --git a/mm/mmap.c b/mm/mmap.c index 405e0432c78e..e1e5c78b6c3c 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1623,8 +1623,7 @@ unacct_error: vm_unacct_memory(charged); abort_munmap: - if (vms.nr_pages) - abort_munmap_vmas(&mas_detach, vms.closed_vm_ops); + vms_abort_munmap_vmas(&vms, &mas_detach); gat...
b7012d513f81959596a01083415597edb04cf509
Analyze and fix the following issue in the Linux kernel code: mm/vma: correctly position vma_iterator in __split_vma()
Problem Details: Patch series "Avoid MAP_FIXED gap exposure", v8. It is now possible to walk the vma tree using the rcu read locks and is beneficial to do so to reduce lock contention. Doing so while a MAP_FIXED mapping is executing means that a reader may see a gap in the vma tree that should never logically exist -...
```diff diff --git a/mm/vma.c b/mm/vma.c index 5850f7c0949b..066de79b7b73 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -177,7 +177,7 @@ void unmap_region(struct mm_struct *mm, struct ma_state *mas, /* * __split_vma() bypasses sysctl_max_map_count checking. We use this where it * has already been checked or doesn't mak...
5a53623d0fe658b1b8699632ac8ed7dd0d9b2e97
Analyze and fix the following issue in the Linux kernel code: Documentation/cgroup-v2: clarify that zswap.writeback is ignored if zswap is disabled
Problem Details: As discussed in [1], zswap-related settings natually lose their effect when zswap is disabled, specifically zswap.writeback here. Be explicit about this behavior. [1] https://lore.kernel.org/linux-kernel/CAKEwX=Mhbwhh-=xxCU-RjMXS_n=RpV3Gtznb2m_3JgL+jzz++g@mail.gmail.com/ [akpm@linux-foundation.org: ...
```diff diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst index d3344218010c..3dad62b1e11c 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -1755,6 +1755,8 @@ The following nested keys are defined. Note that this is su...
435b3894e74256cc93772b7e586d848a5c3433ee
Analyze and fix the following issue in the Linux kernel code: mm:page_alloc: fix the NULL ac->nodemask in __alloc_pages_slowpath()
Problem Details: should_reclaim_retry() is not ALLOC_CPUSET aware and that means that it considers reclaimability of NUMA nodes which are outside of the cpuset. If other nodes have a lot of reclaimable memory then should_reclaim_retry would instruct page allocator to retry even though there is no memory reclaimable on...
```diff diff --git a/mm/compaction.c b/mm/compaction.c index d1041fbce679..a2b16b08cbbf 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -23,6 +23,7 @@ #include <linux/freezer.h> #include <linux/page_owner.h> #include <linux/psi.h> +#include <linux/cpuset.h> #include "internal.h" #ifdef CONFIG_COMPACTION @@...
b843786b0bd01ced7fcdbf3b033d68db2f7c61b2
Analyze and fix the following issue in the Linux kernel code: mm: swapfile: fix SSD detection with swapfile on btrfs
Problem Details: We've been noticing a trend of significant lock contention in the swap subsystem as core counts have been increasing in our fleet. It turns out that our swapfiles on btrfs on flash were in fact using the old swap code for rotational storage. This turns out to be a detection issue in the swapon sequen...
```diff diff --git a/mm/swapfile.c b/mm/swapfile.c index 8ff58be40544..03dc77457510 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -3198,29 +3198,15 @@ static unsigned long read_swap_header(struct swap_info_struct *si, static int setup_swap_map_and_extents(struct swap_info_struct *si, union swap_header *swap_...
c41a701d18efe6b8aa402efab16edbaba50c9548
Analyze and fix the following issue in the Linux kernel code: selftests/mm: fix charge_reserved_hugetlb.sh test
Problem Details: Currently, running the charge_reserved_hugetlb.sh selftest we can sometimes observe something like: $ ./charge_reserved_hugetlb.sh -cgroup-v2 ... write_result is 0 After write: hugetlb_usage=0 reserved_usage=10485760 killing write_to_hugetlbfs Received 2. Deleting the memory Detach...
```diff diff --git a/tools/testing/selftests/mm/charge_reserved_hugetlb.sh b/tools/testing/selftests/mm/charge_reserved_hugetlb.sh index d680c00d2853..67df7b47087f 100755 --- a/tools/testing/selftests/mm/charge_reserved_hugetlb.sh +++ b/tools/testing/selftests/mm/charge_reserved_hugetlb.sh @@ -254,7 +254,7 @@ function ...
bf03c806993091d8fb2fc0e98f07a8ef251c78f3
Analyze and fix the following issue in the Linux kernel code: mm: remove PageActive
Problem Details: Patch series "Simplify the page flags a little". In the course of our folio conversions, we have made many page flags only used on folios, so we can now remove the page-based accessors. This should cut down compile time a little, and prevent new users from cropping up. There is more that could be do...
```diff diff --git a/arch/powerpc/mm/pgtable-frag.c b/arch/powerpc/mm/pgtable-frag.c index 8c31802f97e8..e89f64a0f24a 100644 --- a/arch/powerpc/mm/pgtable-frag.c +++ b/arch/powerpc/mm/pgtable-frag.c @@ -136,10 +136,10 @@ void pte_fragment_free(unsigned long *table, int kernel) #ifdef CONFIG_TRANSPARENT_HUGEPAGE void ...
4ffca5a96678c9fe1a39ec1e9c8fd326b57ea8a7
Analyze and fix the following issue in the Linux kernel code: mm: support only one page_type per page
Problem Details: By using a few values in the top byte, users of page_type can store up to 24 bits of additional data in page_type. It also reduces the code size as (with replacement of READ_ONCE() with data_race()), the kernel can check just a single byte. eg: ffffffff811e3a79: 8b 47 30 mov ...
```diff diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 0b5484fdbca1..7a1b2948b075 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -923,42 +923,29 @@ PAGEFLAG_FALSE(HasHWPoisoned, has_hwpoisoned) #endif /* - * For pages that are never mapped to userspace, - * p...
f28bdd1b17ec187eaa34845814afaaff99832762
Analyze and fix the following issue in the Linux kernel code: selftests/mm: add more mseal traversal tests
Problem Details: Add more mseal traversal tests across VMAs, where we could possibly screw up sealing checks. These test more across-vma traversal for mprotect, munmap and madvise. Particularly, we test for the case where a regular VMA is followed by a sealed VMA. [akpm@linux-foundation.org: remove incorrect comment...
```diff diff --git a/tools/testing/selftests/mm/mseal_test.c b/tools/testing/selftests/mm/mseal_test.c index bd0bfda7aae7..e7ed720e9677 100644 --- a/tools/testing/selftests/mm/mseal_test.c +++ b/tools/testing/selftests/mm/mseal_test.c @@ -777,6 +777,42 @@ static void test_seal_mprotect_partial_mprotect(bool seal) REP...
cd5f3193b432cd70cc1c19aba790300dd11ae934
Analyze and fix the following issue in the Linux kernel code: mm: remove migration for HugePage in isolate_single_pageblock()
Problem Details: The gigantic page size may larger than memory block size, so memory offline always fails in this case after commit b2c9e2fbba32 ("mm: make alloc_contig_range work at pageblock granularity"), offline_pages start_isolate_page_range start_isolate_page_range(isolate_before=true) isolate [isola...
```diff diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 39fb8c07aeb7..7e04047977cf 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -403,30 +403,8 @@ static int isolate_single_pageblock(unsigned long boundary_pfn, int flags, unsigned long head_pfn = page_to_pfn(head); unsigned long nr_...
ef5f379de302884b9b7ad9b62587a942a9f0bb55
Analyze and fix the following issue in the Linux kernel code: mm: always inline _compound_head() with CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP=y
Problem Details: We already force-inline page_fixed_fake_head(), page_is_fake_head() and PageTail(), however the compiler might decide that _compound_head() is not worthy to be inlined, because of page_fixed_fake_head(). The result is that, for example, PageAnonExclusive() now might involve a function call when checki...
```diff diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 17175a328e6b..2515ae85f191 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -232,7 +232,7 @@ static __always_inline int page_is_fake_head(const struct page *page) return page_fixed_fake_head(page) != page; }...
8c8685928910d0aae477dc7683037c3fcb3a904a
Analyze and fix the following issue in the Linux kernel code: mm/kmemleak: use IS_ERR_PCPU() for pointer in the percpu address space
Problem Details: Use IS_ERR_PCPU() instead of IS_ERR() for pointers in the percpu address space. The patch also fixes following sparse warnings: kmemleak.c:1063:39: warning: cast removes address space '__percpu' of expression kmemleak.c:1138:37: warning: cast removes address space '__percpu' of expression Link: http...
```diff diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 6b498c6d9c34..0400f5e8ac60 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -1070,8 +1070,8 @@ void __ref kmemleak_alloc_percpu(const void __percpu *ptr, size_t size, { pr_debug("%s(0x%px, %zu)\n", __func__, ptr, size); - if (kmemleak_enabled && ptr && !IS_...
1a83a716ec233990e1fd5b6fbb1200ade63bf450
Analyze and fix the following issue in the Linux kernel code: mm: krealloc: consider spare memory for __GFP_ZERO
Problem Details: As long as krealloc() is called with __GFP_ZERO consistently, starting with the initial memory allocation, __GFP_ZERO should be fully honored. However, if for an existing allocation krealloc() is called with a decreased size, it is not ensured that the spare portion the allocation is zeroed. Thus, if...
```diff diff --git a/mm/slab_common.c b/mm/slab_common.c index 40b582a014b8..cff602cedf8e 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -1273,6 +1273,13 @@ __do_krealloc(const void *p, size_t new_size, gfp_t flags) /* If the object still fits, repoison it precisely. */ if (ks >= new_size) { + /* Zero o...
463586e9ff398f951a9a63d98a3b93f44434d20c
Analyze and fix the following issue in the Linux kernel code: mm/cma: add cma_{alloc,free}_folio()
Problem Details: With alloc_contig_range() and free_contig_range() supporting large folios, CMA can allocate and free large folios too, by cma_alloc_folio() and cma_free_folio(). [yuzhao@google.com: fix WARN in cma_alloc_folio()] Link: https://lkml.kernel.org/r/Zsd0PgAQmbpR8jS6@google.com Link: https://lkml.kernel.o...
```diff diff --git a/include/linux/cma.h b/include/linux/cma.h index 9db877506ea8..d15b64f51336 100644 --- a/include/linux/cma.h +++ b/include/linux/cma.h @@ -52,4 +52,20 @@ extern bool cma_release(struct cma *cma, const struct page *pages, unsigned long extern int cma_for_each_area(int (*it)(struct cma *cma, void *da...