id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
3abfcfd847717d232e36963f31a361747c388fe7
Analyze and fix the following issue in the Linux kernel code: perf dwarf-aux: Fix off-by-one in die_get_varname()
Problem Details: The die_get_varname() returns "(unknown_type)" string if it failed to find a type for the variable. But it had a space before the opening parenthesis and it made the closing parenthesis cut off due to the off-by-one in the string length (14). Signed-off-by: Namhyung Kim <namhyung@kernel.org> Fixes: 8...
```diff diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c index b07414409771..3bff67874563 100644 --- a/tools/perf/util/dwarf-aux.c +++ b/tools/perf/util/dwarf-aux.c @@ -1103,7 +1103,7 @@ int die_get_varname(Dwarf_Die *vr_die, struct strbuf *buf) ret = die_get_typename(vr_die, buf); if (ret < 0...
9e936277d990552c955f4a20ad33d4cb1319b25b
Analyze and fix the following issue in the Linux kernel code: ata: ahci: Cleanup ahci_reset_controller()
Problem Details: Fix multi-line comment style in ahci_reset_controller() and change the code to return early if ahci_skip_host_reset is true, reducing indentation by one level for the bulk of the function code. No functional changes. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Niklas Cassel <nikla...
```diff diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 9c2cb6cbea76..06aec35f88f2 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -975,44 +975,43 @@ int ahci_reset_controller(struct ata_host *host) void __iomem *mmio = hpriv->mmio; u32 tmp; - /* we must be in AHCI mode, before ...
b40de51e3b6737a7bd41045e0cd3f78b75c35b24
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: msm8916/39: Rename wcnss pinctrl
Problem Details: All the pinctrl now uses consistent _default/_sleep suffix so rename the WCNSS pinctrl to be named consistently. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230529-msm8916-pinctrl-v1-5-11f540b51c93@gerhold...
```diff diff --git a/arch/arm64/boot/dts/qcom/msm8916-pins.dtsi b/arch/arm64/boot/dts/qcom/msm8916-pins.dtsi index 2cfaed37cb59..bf7e664c8350 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-pins.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-pins.dtsi @@ -488,7 +488,7 @@ }; }; - wcnss_pin_a: wcnss-active-state { + wc...
c943e4c58b2ffb0dcd497f8b12f284f5e8fc477e
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: msm8916/39: Consolidate SDC pinctrl
Problem Details: MSM8939 has the SDC pinctrl consolidated in two &sdcN_default and &sdcN_sleep states, while MSM8916 has all pins separated. Make this consistent by consolidating them for MSM8916 well. Use this as a chance to define default pinctrl in the SoC.dtsi and only let boards that add additional definitions (s...
```diff diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dts b/arch/arm64/boot/dts/qcom/apq8016-sbc.dts index b8537fe576a8..23e3b86186ac 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dts +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dts @@ -370,18 +370,14 @@ &sdhc_1 { status = "okay"; - - pinctrl-names = "defaul...
dfbda20dabaa1f284abd550035db5887384c8e4c
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: msm8916/39: Fix SD card detect pinctrl
Problem Details: The current SD card detect pinctrl setup configures bias-pull-up for the "default" (active) case and bias-disable for the "sleep" case. Before commit b5c833b703cc ("mmc: sdhci-msm: Set IO pins in low power state during suspend") the pull up was permanently active. Since then it is only active when a va...
```diff diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dts b/arch/arm64/boot/dts/qcom/apq8016-sbc.dts index 56dfca61253e..b8537fe576a8 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dts +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dts @@ -380,8 +380,8 @@ status = "okay"; pinctrl-names = "default", "sleep"; - ...
d59b294874c7f51317dc7edfc12ff950260ed2b9
Analyze and fix the following issue in the Linux kernel code: ARM: dts: qcom: msm8974: rename labels for DSI nodes
Problem Details: Currently in board files MDSS and HDMI nodes stay apart, because labels for HDMI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node aliases from dsi_* to mdss_dsi_*. Signe...
```diff diff --git a/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts b/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts index d021cf7ae1c2..e0679436000b 100644 --- a/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts +++ b/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts @@ -71,7 +71,15 @@ }; }; -&dsi0 { +&gpu { + status =...
f43b6dc7d56ecbd96d8dfb3c3225c46e18f1b842
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: msm8996: rename labels for HDMI nodes
Problem Details: Currently in board files MDSS and HDMI nodes stay apart, because labels for HDMI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change HDMI node labels from hdmi_* to mdss_hdmi_*. Sig...
```diff diff --git a/arch/arm64/boot/dts/qcom/apq8096-db820c.dts b/arch/arm64/boot/dts/qcom/apq8096-db820c.dts index b599909c4463..537547b97459 100644 --- a/arch/arm64/boot/dts/qcom/apq8096-db820c.dts +++ b/arch/arm64/boot/dts/qcom/apq8096-db820c.dts @@ -208,25 +208,6 @@ status = "okay"; }; -&hdmi { - status = "ok...
e47a7f571d57d383f345e85c47a05ef1801b278c
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sm8250: rename labels for DSI nodes
Problem Details: Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-o...
```diff diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts index dfcaac266456..9022ad726741 100644 --- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts +++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts @@ -535,30 +535,6 @@ firmware-name = "qcom/sm8250/cdsp.mbn"; }; -&dsi0 { - s...
8fe25ba3ffec7e8e2345d0163990b77a4092e456
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sdm845: rename labels for DSI nodes
Problem Details: Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-o...
```diff diff --git a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi index d05c511718df..1ce413263b7f 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi @@ -636,25 +636,6 @@ }; }; -&dsi0 { - status = "okay"; - vdda-supply...
8e61d532370eb6946d97e39d270129e9442fb326
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sdm630: rename labels for DSI nodes
Problem Details: Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-o...
```diff diff --git a/arch/arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts b/arch/arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts index 7459525d9982..0b23d5bb3f26 100644 --- a/arch/arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts +++ b/arch/arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts @@ -134,7 +134,7 @@ reg = <0>; ...
c3c466d9f305291366f0af0650e62bf8a6c31501
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sc8180x: rename labels for DSI nodes
Problem Details: Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-o...
```diff diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi index 33493032b6e5..d3ae18535636 100644 --- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi +++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi @@ -2733,14 +2733,14 @@ port@1 { reg = <1>; dpu_intf1_out: endpoint { - ...
71c97412f1d77314434c4097b0ed12646a0403b0
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sc7280: rename labels for DSI nodes
Problem Details: Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-o...
```diff diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi index f836b45de508..4a7bf9704af1 100644 --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi @@ -3879,7 +3879,7 @@ port@0 { reg = <0>; dpu_intf1_out: endpoint { - r...
2b616f86d51ba534ba41b175846e7f9b3afb6e15
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sc7180: rename labels for DSI nodes
Problem Details: Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-o...
```diff diff --git a/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts b/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts index 2a80f4090085..b637b4270f88 100644 --- a/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts +++ b/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts @@ -143,21 +143,6 @@ }; }; -&dsi0 { - vdda-s...
8b764ed0d04621cd3859a351c7d5cc14e87f6c4a
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: msm8996: rename labels for DSI nodes
Problem Details: Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-o...
```diff diff --git a/arch/arm64/boot/dts/qcom/msm8996-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/msm8996-oneplus-common.dtsi index 2adadc1e5b7c..ec5457508fe6 100644 --- a/arch/arm64/boot/dts/qcom/msm8996-oneplus-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8996-oneplus-common.dtsi @@ -164,21 +164,6 @@ vdda-suppl...
8b87d0585ca6ca0c646d685f29c9a25ade3cb95c
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: msm8953: rename labels for DSI nodes
Problem Details: Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-o...
```diff diff --git a/arch/arm64/boot/dts/qcom/msm8953.dtsi b/arch/arm64/boot/dts/qcom/msm8953.dtsi index f42a1e376340..ddde5f2baeb8 100644 --- a/arch/arm64/boot/dts/qcom/msm8953.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8953.dtsi @@ -764,10 +764,10 @@ #power-domain-cells = <1>; clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>...
e88c533d8a2a0fe84bb54cff1569bd079ad3512c
Analyze and fix the following issue in the Linux kernel code: clk: qcom: gcc-sm6115: Add missing PLL config properties
Problem Details: When the driver was ported upstream, PLL ctl register values were omitted. Add them to ensure the PLLs are fully configured like we expect them to. Fixes: cbe63bfdc54f ("clk: qcom: Add Global Clock controller (GCC) driver for SM6115") Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by...
```diff diff --git a/drivers/clk/qcom/gcc-sm6115.c b/drivers/clk/qcom/gcc-sm6115.c index 5f09aefa7fb9..033e308ff865 100644 --- a/drivers/clk/qcom/gcc-sm6115.c +++ b/drivers/clk/qcom/gcc-sm6115.c @@ -119,6 +119,8 @@ static const struct alpha_pll_config gpll10_config = { .vco_mask = GENMASK(21, 20), .main_output_mask...
11a1397bbf69e408223bb691858a0fcd295a8f76
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sm8550: Add missing interconnect path to USB HC
Problem Details: The USB HC node is missing the interconnect paths, so add them. Fixes: 7f7e5c1b037f ("arm64: dts: qcom: sm8550: Add USB PHYs and controller nodes") Signed-off-by: Abel Vesa <abel.vesa@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org...
```diff diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi index a6be0b54ba00..ccf21d99cb8f 100644 --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi @@ -2869,6 +2869,10 @@ resets = <&gcc GCC_USB30_PRIM_BCR>; + interconnects = <&aggre1_n...
5ae7899765607e97e5eb34486336898c8d9ec654
Analyze and fix the following issue in the Linux kernel code: clk: qcom: gcc-ipq6018: remove duplicate initializers
Problem Details: A recent change added new initializers for .config_ctl_val and .config_ctl_hi_val but left the old values in place: drivers/clk/qcom/gcc-ipq6018.c:4155:27: error: initialized field overwritten [-Werror=override-init] 4155 | .config_ctl_val = 0x240d4828, | ^~~~~...
```diff diff --git a/drivers/clk/qcom/gcc-ipq6018.c b/drivers/clk/qcom/gcc-ipq6018.c index 48f9bff7c80f..86b43175b042 100644 --- a/drivers/clk/qcom/gcc-ipq6018.c +++ b/drivers/clk/qcom/gcc-ipq6018.c @@ -4150,8 +4150,6 @@ static struct clk_branch gcc_dcc_clk = { static const struct alpha_pll_config ubi32_pll_config = {...
223ce29c8b7e5b00f01a68387aabeefd77d97f06
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sm8250-edo: Panel framebuffer is 2.5k instead of 4k
Problem Details: The framebuffer configuration for edo pdx203, written in edo dtsi (which is overwritten in pdx206 dts for its smaller panel) has to use a 1096x2560 configuration as this is what the panel (and framebuffer area) has been initialized to. Downstream userspace also has access to (and uses) this 2.5k mode ...
```diff diff --git a/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi b/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi index 8d4352c8c543..8ab82bacba81 100644 --- a/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi @@ -26,9 +26,10 @@ framebuffer...
460af1f9d9e62acce4a21f9bd00b5bcd5963bcd4
Analyze and fix the following issue in the Linux kernel code: md/raid1-10: limit the number of plugged bio
Problem Details: bio can be added to plug infinitely, and following writeback test can trigger huge amount of plugged bio: Test script: modprobe brd rd_nr=4 rd_size=10485760 mdadm -CR /dev/md0 -l10 -n4 /dev/ram[0123] --assume-clean --bitmap=internal echo 0 > /proc/sys/vm/dirty_background_ratio fio -filename=/dev/md0 -...
```diff diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c index c62bcb17c67b..169ebe296f2d 100644 --- a/drivers/md/raid1-10.c +++ b/drivers/md/raid1-10.c @@ -21,6 +21,7 @@ #define IO_MADE_GOOD ((struct bio *)2) #define BIO_SPECIAL(bio) ((unsigned long)bio <= 2) +#define MAX_PLUG_BIO 32 /* for managing r...
9efcc2c3df7612eea02daa159ae7c6ac44420513
Analyze and fix the following issue in the Linux kernel code: md/raid1-10: don't handle pluged bio by daemon thread
Problem Details: current->bio_list will be set under submit_bio() context, in this case bitmap io will be added to the list and wait for current io submission to finish, while current io submission must wait for bitmap io to be done. commit 874807a83139 ("md/raid1{,0}: fix deadlock in bitmap_unplug.") fix the deadlock ...
```diff diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c index 52469e460dab..c62bcb17c67b 100644 --- a/drivers/md/raid1-10.c +++ b/drivers/md/raid1-10.c @@ -152,3 +152,17 @@ static inline bool raid1_add_bio_to_plug(struct mddev *mddev, struct bio *bio, return true; } + +/* + * current->bio_list will be s...
7db922bae3abdf0a1db81ef7228cc0b996a0c1e3
Analyze and fix the following issue in the Linux kernel code: md/raid1-10: submit write io directly if bitmap is not enabled
Problem Details: Commit 6cce3b23f6f8 ("[PATCH] md: write intent bitmap support for raid10") add bitmap support, and it changed that write io is submitted through daemon thread because bitmap need to be updated before write io. And later, plug is used to fix performance regression because all the write io will go to dem...
```diff diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index ad5a3456cd8a..3ee590cf12a7 100644 --- a/drivers/md/md-bitmap.c +++ b/drivers/md/md-bitmap.c @@ -1016,7 +1016,6 @@ static int md_bitmap_file_test_bit(struct bitmap *bitmap, sector_t block) return set; } - /* this gets called when the md dev...
010444623e7f4da6b4a4dd603a7da7469981e293
Analyze and fix the following issue in the Linux kernel code: md/raid10: prevent soft lockup while flush writes
Problem Details: Currently, there is no limit for raid1/raid10 plugged bio. While flushing writes, raid1 has cond_resched() while raid10 doesn't, and too many writes can cause soft lockup. Follow up soft lockup can be triggered easily with writeback test for raid10 with ramdisks: watchdog: BUG: soft lockup - CPU#10 s...
```diff diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index d738f89800c8..09017a43cea5 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -929,6 +929,7 @@ static void flush_pending_writes(struct r10conf *conf) else submit_bio_noacct(bio); bio = next; + cond_resched(); } blk_fini...
2ae6aaf76912bae53c74b191569d2ab484f24bf3
Analyze and fix the following issue in the Linux kernel code: md/raid10: fix io loss while replacement replace rdev
Problem Details: When removing a disk with replacement, the replacement will be used to replace rdev. During this process, there is a brief window in which both rdev and replacement are read as NULL in raid10_write_request(). This will result in io not being submitted but it should be. //remove //write raid10_r...
```diff diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 1b953e788ce1..d738f89800c8 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -779,8 +779,16 @@ static struct md_rdev *read_balance(struct r10conf *conf, disk = r10_bio->devs[slot].devnum; rdev = rcu_dereference(conf->mirrors[disk].re...
8d355a46c1e0cea59be3ea8395409a5e6eeed946
Analyze and fix the following issue in the Linux kernel code: md/raid10: Do not add spare disk when recovery fails
Problem Details: In raid10_sync_request(), if data cannot be read from any disk for recovery, it will go to 'giveup' and let 'chunks_skipped' + 1. After multiple 'giveup', when 'chunks_skipped >= geo.raid_disks', it will return 'max_sector', indicating that the recovery has been completed. However, the recovery is just...
```diff diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index ab0e2485b2b7..1b953e788ce1 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3311,6 +3311,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, int chunks_skipped = 0; sector_t chunk_mask = conf->geo.chunk_...
4d8a5754a694062f349b8bf66856561e3840c7e5
Analyze and fix the following issue in the Linux kernel code: md/raid10: clean up md_add_new_disk()
Problem Details: Commit 1a855a060665 ("md: fix bug with re-adding of partially recovered device.") only add device which is set to In_sync. But it let devices without metadata cannot be added when they should be. Commit bf572541ab44 ("md: fix regression with re-adding devices to arrays with no metadata") fix the above...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index a6ede3d1c99e..0aec2954e161 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -6746,7 +6746,6 @@ int md_add_new_disk(struct mddev *mddev, struct mdu_disk_info_s *info) if (info->state & (1<<MD_DISK_SYNC) && info->raid_disk < mddev->raid_disks)...
34817a2441747b48e444cb0e05d84e14bc9443da
Analyze and fix the following issue in the Linux kernel code: md/raid10: fix null-ptr-deref of mreplace in raid10_sync_request
Problem Details: There are two check of 'mreplace' in raid10_sync_request(). In the first check, 'need_replace' will be set and 'mreplace' will be used later if no-Faulty 'mreplace' exists, In the second check, 'mreplace' will be set to NULL if it is Faulty, but 'need_replace' will not be changed accordingly. null-ptr-...
```diff diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 0ae7e52983fa..51552280b325 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3441,7 +3441,6 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, int must_sync; int any_working; int need_recover = 0; ...
4469315439827290923fce4f3f672599cabeb366
Analyze and fix the following issue in the Linux kernel code: md: protect md_thread with rcu
Problem Details: Currently, there are many places that md_thread can be accessed without protection, following are known scenarios that can cause null-ptr-dereference or uaf: 1) sync_thread that is allocated and started from md_start_sync() 2) mddev->thread can be accessed directly from timeout_store() and md_bitma...
```diff diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index 23522df41ca5..ad5a3456cd8a 100644 --- a/drivers/md/md-bitmap.c +++ b/drivers/md/md-bitmap.c @@ -1237,13 +1237,19 @@ static bitmap_counter_t *md_bitmap_get_counter(struct bitmap_counts *bitmap, static void mddev_set_timeout(struct mddev *mddev, ...
4eeb6535cd51100460ec8873bb68addef17b3e81
Analyze and fix the following issue in the Linux kernel code: md/bitmap: factor out a helper to set timeout
Problem Details: Register/unregister 'mddev->thread' are both under 'reconfig_mutex', however, some context didn't hold the mutex to access mddev->thread, which can cause null-ptr-deference: 1) md_bitmap_daemon_work() can be called from md_check_recovery() where 'reconfig_mutex' is not held, deference 'mddev->thread' ...
```diff diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index 4b5ba81c53be..23522df41ca5 100644 --- a/drivers/md/md-bitmap.c +++ b/drivers/md/md-bitmap.c @@ -1234,11 +1234,22 @@ static bitmap_counter_t *md_bitmap_get_counter(struct bitmap_counts *bitmap, sector_t offset, sector_t *blocks, ...
e5e9b9cb71a09d86d5e8d147e6a6457e1f8887b5
Analyze and fix the following issue in the Linux kernel code: md: factor out a helper to wake up md_thread directly
Problem Details: md_wakeup_thread() can't wakeup md_thread->tsk if md_thread->run is still in progress, and in some cases md_thread->tsk need to be woke up directly, like md_set_readonly() and do_md_stop(). Commit 9dfbdafda3b3 ("md: unlock mddev before reap sync_thread in action_store") introduce a new scenario where ...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 724c7414b241..9d54de3441ef 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -92,6 +92,7 @@ static int remove_and_add_spares(struct mddev *mddev, struct md_rdev *this); static void mddev_detach(struct mddev *mddev); static void export_rdev(struct ...
3ce94ce5d05ae89190a23f6187f64d8f4b2d3782
Analyze and fix the following issue in the Linux kernel code: md: fix duplicate filename for rdev
Problem Details: Commit 5792a2856a63 ("[PATCH] md: avoid a deadlock when removing a device from an md array via sysfs") delays the deletion of rdev, however, this introduces a window that rdev can be added again while the deletion is not done yet, and sysfs will complain about duplicate filename. Follow up patches try...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 49c83ed08937..724c7414b241 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -87,11 +87,11 @@ static struct module *md_cluster_mod; static DECLARE_WAIT_QUEUE_HEAD(resync_wait); static struct workqueue_struct *md_wq; static struct workqueue_struct *md_m...
1ffc85d9298e0ca0137ba65c93a786143fe167b8
Analyze and fix the following issue in the Linux kernel code: bpf: Verify scalar ids mapping in regsafe() using check_ids()
Problem Details: Make sure that the following unsafe example is rejected by verifier: 1: r9 = ... some pointer with range X ... 2: r6 = ... unbound scalar ID=a ... 3: r7 = ... unbound scalar ID=b ... 4: if (r6 > r7) goto +1 5: r6 = r7 6: if (r6 > X) goto ... --- checkpoint --- 7: r9 += r7 8: *(u64 *)r9 = Y This examp...
```diff diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h index 22fb13c738a9..f70f9ac884d2 100644 --- a/include/linux/bpf_verifier.h +++ b/include/linux/bpf_verifier.h @@ -313,11 +313,6 @@ struct bpf_idx_pair { u32 idx; }; -struct bpf_id_pair { - u32 old; - u32 cur; -}; - #define MAX_CALL_F...
84a62b445c86d0f2c9831290ffecee7269f18254
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: add a test for subprogram extables
Problem Details: In certain situations a program with subprograms may have a NULL extable entry. This should not happen, and when it does, it turns a single trap into multiple. Add a test case for further debugging and to prevent regressions. The test-case contains three essentially identical versions of the same te...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/subprogs_extable.c b/tools/testing/selftests/bpf/prog_tests/subprogs_extable.c new file mode 100644 index 000000000000..3afd9f775f68 --- /dev/null +++ b/tools/testing/selftests/bpf/prog_tests/subprogs_extable.c @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL...
0108a4e9f3584a7a2c026d1601b0682ff7335d95
Analyze and fix the following issue in the Linux kernel code: bpf: ensure main program has an extable
Problem Details: When subprograms are in use, the main program is not jit'd after the subprograms because jit_subprogs sets a value for prog->bpf_func upon success. Subsequent calls to the JIT are bypassed when this value is non-NULL. This leads to a situation where the main program and its func[0] counterpart are bo...
```diff diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 0dd8adc7a159..cf5f230360f5 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -17217,9 +17217,10 @@ static int jit_subprogs(struct bpf_verifier_env *env) } /* finally lock prog and jit images for all functions and - * populat...
f8b20a405428803bd9881881d8242c9d72c6b2b2
Analyze and fix the following issue in the Linux kernel code: md/raid10: fix wrong setting of max_corr_read_errors
Problem Details: There is no input check when echo md/max_read_errors and overflow might occur. Add check of input number. Fixes: 1e50915fe0bb ("raid: improve MD/raid10 handling of correctable read errors.") Signed-off-by: Li Nan <linan122@huawei.com> Reviewed-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Song Liu <...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 2fc8d25f6e80..49c83ed08937 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -4468,6 +4468,8 @@ max_corrected_read_errors_store(struct mddev *mddev, const char *buf, size_t len rv = kstrtouint(buf, 10, &n); if (rv < 0) return rv; + if (n > INT_MAX)...
6beb489b2eed25978523f379a605073f99240c50
Analyze and fix the following issue in the Linux kernel code: md/raid10: fix overflow of md/safe_mode_delay
Problem Details: There is no input check when echo md/safe_mode_delay in safe_delay_store(). And msec might also overflow when HZ < 1000 in safe_delay_show(), Fix it by checking overflow in safe_delay_store() and use unsigned long conversion in safe_delay_show(). Fixes: 72e02075a33f ("md: factor out parsing of fixed-p...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 36af585b0e96..2fc8d25f6e80 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -3784,8 +3784,9 @@ int strict_strtoul_scaled(const char *cp, unsigned long *res, int scale) static ssize_t safe_delay_show(struct mddev *mddev, char *page) { - int msec = (mdd...
868bba54a3bcbfc34314e963d5a7e66717f39d4e
Analyze and fix the following issue in the Linux kernel code: md/raid5: fix a deadlock in the case that reshape is interrupted
Problem Details: If reshape is in progress and io across reshape_position is issued, such io will wait for reshape to make progress(see details in the case that make_stripe_request() return STRIPE_SCHEDULE_AND_RETRY). It has been reported several times that if system reboot while growing raid5 to raid6, array assemble...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 2f29d4e365c5..36af585b0e96 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -9100,6 +9100,7 @@ void md_do_sync(struct md_thread *thread) spin_unlock(&mddev->lock); wake_up(&resync_wait); + wake_up(&mddev->sb_wait); md_wakeup_thread(mddev->thread)...
431e61257d631157e1d374f1368febf37aa59f7c
Analyze and fix the following issue in the Linux kernel code: md: export md_is_rdwr() and is_md_suspended()
Problem Details: The two apis will be used later to fix a deadlock in raid456, there are no functional changes. Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Song Liu <song@kernel.org> Link: https://lore.kernel.org/r/20230512015610.821290-4-yukuai1@huaweicloud.com
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index b7f83784710b..fb060e381ae7 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -93,18 +93,6 @@ static int remove_and_add_spares(struct mddev *mddev, struct md_rdev *this); static void mddev_detach(struct mddev *mddev); -enum md_ro_state { - MD_RDWR...
873f50ece41aad5c4f788a340960c53774b5526e
Analyze and fix the following issue in the Linux kernel code: md: fix data corruption for raid456 when reshape restart while grow up
Problem Details: Currently, if reshape is interrupted, echo "reshape" to sync_action will restart reshape from scratch, for example: echo frozen > sync_action echo reshape > sync_action This will corrupt data before reshape_position if the array is growing, fix the problem by continue reshape from reshape_position. ...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index ca0de7ddd943..b7f83784710b 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -4806,11 +4806,21 @@ action_store(struct mddev *mddev, const char *page, size_t len) return -EINVAL; err = mddev_lock(mddev); if (!err) { - if (test_bit(MD_RECOVERY_R...
46038b30b308c3ebf49e79548f109d00a8d74b31
Analyze and fix the following issue in the Linux kernel code: md/raid5: don't allow replacement while reshape is in progress
Problem Details: If reshape is interrupted(for example, echo frozen to sync_action), then rdev replacement can be set. It's safe because reshape is always prior to resync in md_check_recovery(). However, if system reboots, then kernel will complain cannot handle concurrent replacement and reshape and this array is not ...
```diff diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 4739ed891e75..5950932323fc 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -8377,6 +8377,7 @@ static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev) p = conf->disks + disk; tmp = rdev_mdlock_deref(mddev, p->rdev); if (...
301867b1c16805aebbc306aafa6ecdc68b73c7e5
Analyze and fix the following issue in the Linux kernel code: md/raid10: check slab-out-of-bounds in md_bitmap_get_counter
Problem Details: If we write a large number to md/bitmap_set_bits, md_bitmap_checkpage() will return -EINVAL because 'page >= bitmap->pages', but the return value was not checked immediately in md_bitmap_get_counter() in order to set *blocks value and slab-out-of-bounds occurs. Move check of 'page >= bitmap->pages' to...
```diff diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index bc8d7565171d..358a06495902 100644 --- a/drivers/md/md-bitmap.c +++ b/drivers/md/md-bitmap.c @@ -54,14 +54,7 @@ __acquires(bitmap->lock) { unsigned char *mappage; - if (page >= bitmap->pages) { - /* This can happen if bitmap_start_sync goes...
561055b810cac89a4b903a53ebdf34f2cc6e2b3d
Analyze and fix the following issue in the Linux kernel code: drm/i915/mtl/gsc: Add a gsc_info debugfs
Problem Details: Add a new debugfs to dump information about the GSC. This includes: - the FW path and SW tracking status; - the release, security and compatibility versions; - the HECI1 status registers. Note that those are the same registers that the mei driver dumps in their own status sysfs on DG2 (where mei owns...
```diff diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile index c58d7b193664..7a3d5da3ca50 100644 --- a/drivers/gpu/drm/i915/Makefile +++ b/drivers/gpu/drm/i915/Makefile @@ -196,7 +196,8 @@ i915-y += \ gt/uc/intel_gsc_fw.o \ gt/uc/intel_gsc_proxy.o \ gt/uc/intel_gsc_uc.o \ - gt/uc...
56fafa569764d8f29613f126840b743bef28a2be
Analyze and fix the following issue in the Linux kernel code: drm/i915/mtl/gsc: extract release and security versions from the gsc binary
Problem Details: The release and security versions of the GSC binary are not used at runtime to decide interface compatibility (there is a separate version for that), but they're still useful for debug, so it is still worth extracting them and printing them out in dmesg. To get to these version, we need to navigate th...
```diff diff --git a/drivers/gpu/drm/i915/gt/uc/intel_gsc_binary_headers.h b/drivers/gpu/drm/i915/gt/uc/intel_gsc_binary_headers.h index 714f0c256118..6d009a905269 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_gsc_binary_headers.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_gsc_binary_headers.h @@ -8,6 +8,74 @@ #include ...
b267a67000d45452524f72c47e12a189a9a341c5
Analyze and fix the following issue in the Linux kernel code: drm/i915/gsc: fixes and updates for GSC memory allocation
Problem Details: A few fixes/updates are required around the GSC memory allocation and it is easier to do them all at the same time. The changes are as follows: 1 - Switch the memory allocation to stolen memory. We need to avoid accesses from GSC FW to normal memory after the suspend function has completed and to do s...
```diff diff --git a/drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c index 60e9c6c9e775..e6fa7745ff77 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c @@ -3,6 +3,7 @@ * Copyright © 2022 Intel Corporation */ +#include "gem/...
85041e12418fd0c08ff972b7729f7971afb361f8
Analyze and fix the following issue in the Linux kernel code: nios2: dts: Fix tse_mac "max-frame-size" property
Problem Details: The given value of 1518 seems to refer to the layer 2 ethernet frame size without 802.1Q tag. Actual use of the "max-frame-size" including in the consumer of the "altr,tse-1.0" compatible is the MTU. Fixes: 95acd4c7b69c ("nios2: Device tree support") Fixes: 61c610ec61bb ("nios2: Add Max10 device tree"...
```diff diff --git a/arch/nios2/boot/dts/10m50_devboard.dts b/arch/nios2/boot/dts/10m50_devboard.dts index 56339bef3247..0e7e5b0dd685 100644 --- a/arch/nios2/boot/dts/10m50_devboard.dts +++ b/arch/nios2/boot/dts/10m50_devboard.dts @@ -97,7 +97,7 @@ rx-fifo-depth = <8192>; tx-fifo-depth = <8192>; address-bit...
1c8267cd14ed6a592a2c2a8eb0fefad4eabe5b4f
Analyze and fix the following issue in the Linux kernel code: soc: qcom: icc-bwmon: Fix MSM8998 count unit
Problem Details: MSM8998's BWMON counts in megabytes. Fix it. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230531-topic-msm8998-bwmon-v1-1-454f9d550ee5@linar...
```diff diff --git a/drivers/soc/qcom/icc-bwmon.c b/drivers/soc/qcom/icc-bwmon.c index fd58c5b69897..6c6da73214e4 100644 --- a/drivers/soc/qcom/icc-bwmon.c +++ b/drivers/soc/qcom/icc-bwmon.c @@ -806,7 +806,7 @@ static int bwmon_remove(struct platform_device *pdev) static const struct icc_bwmon_data msm8998_bwmon_dat...
4b2c7ac8e469ab7f92e50c34ad4012a77e79d078
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sm8550: Flush RSC sleep & wake votes
Problem Details: The rpmh driver will cache sleep and wake votes until the cluster power-domain is about to enter idle, to avoid unnecessary writes. So associate the apps_rsc with the cluster pd, so that it can be notified about this event. Without this, only AMC votes are being commited. Fixes: ffc50b2d3828 ("arm64:...
```diff diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi index f00721fe4208..a6be0b54ba00 100644 --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi @@ -3697,6 +3697,7 @@ qcom,drv-id = <2>; qcom,tcs-config = <ACTIVE_TCS 3>, <SLEEP_TCS ...
255c53df8ec3ea9f00765eb3dac02ccb705704dd
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sm6350: Flush RSC sleep & wake votes
Problem Details: The rpmh driver will cache sleep and wake votes until the cluster power-domain is about to enter idle, to avoid unnecessary writes. So associate the apps_rsc with the cluster pd, so that it can be notified about this event. Without this, only AMC votes are being commited. Fixes: 5f82b9cda61e ("arm64:...
```diff diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi b/arch/arm64/boot/dts/qcom/sm6350.dtsi index a0e64f888de6..68e07025aab5 100644 --- a/arch/arm64/boot/dts/qcom/sm6350.dtsi +++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi @@ -2046,6 +2046,7 @@ qcom,drv-id = <2>; qcom,tcs-config = <ACTIVE_TCS 2>, <SLEEP_TCS 3>,...
91e83140b5dd5598fbcfada3ee1f8b2b410c3731
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sdm845: Flush RSC sleep & wake votes
Problem Details: The rpmh driver will cache sleep and wake votes until the cluster power-domain is about to enter idle, to avoid unnecessary writes. So associate the apps_rsc with the cluster pd, so that it can be notified about this event. Without this, only AMC votes are being commited. Fixes: c83545d95376 ("arm64:...
```diff diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi index f1dfdd129eab..cf5898b0c17f 100644 --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi @@ -5129,6 +5129,7 @@ <SLEEP_TCS 3>, <WAKE_TCS 3>, <CONTROL_TCS 1>; ...
7b04cbd81b0e60c5151a310e7b730dc4a951a211
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sdm670: Flush RSC sleep & wake votes
Problem Details: The rpmh driver will cache sleep and wake votes until the cluster power-domain is about to enter idle, to avoid unnecessary writes. So associate the apps_rsc with the cluster pd, so that it can be notified about this event. Without this, only AMC votes are being commited. Fixes: 07c8ded6e373 ("arm64:...
```diff diff --git a/arch/arm64/boot/dts/qcom/sdm670.dtsi b/arch/arm64/boot/dts/qcom/sdm670.dtsi index c5f839dd1c6e..624aef6a4a60 100644 --- a/arch/arm64/boot/dts/qcom/sdm670.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm670.dtsi @@ -1264,6 +1264,7 @@ <SLEEP_TCS 3>, <WAKE_TCS 3>, <CONTROL_TCS 1>; ...
442d55d099ed72d96aee996e56f802b5cf885f39
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sc8180x: Flush RSC sleep & wake votes
Problem Details: The rpmh driver will cache sleep and wake votes until the cluster power-domain is about to enter idle, to avoid unnecessary writes. So associate the apps_rsc with the cluster pd, so that it can be notified about this event. Without this, only AMC votes are being commited. Fixes: 8575f197b077 ("arm64:...
```diff diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi index 5276d4bfdf4e..33493032b6e5 100644 --- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi +++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi @@ -3496,6 +3496,7 @@ <WAKE_TCS 1>, <CONTROL_TCS 0>; label = "apps_rsc...
ab033e7846f91953244d0626b28ce66412b813b3
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: qdu1000: Flush RSC sleep & wake votes
Problem Details: The rpmh driver will cache sleep and wake votes until the cluster power-domain is about to enter idle, to avoid unnecessary writes. So associate the apps_rsc with the cluster pd, so that it can be notified about this event. Without this, only AMC votes are being commited. Fixes: 6bd20c54b589 ("arm64:...
```diff diff --git a/arch/arm64/boot/dts/qcom/qdu1000.dtsi b/arch/arm64/boot/dts/qcom/qdu1000.dtsi index bc16d12432c1..471a5741396c 100644 --- a/arch/arm64/boot/dts/qcom/qdu1000.dtsi +++ b/arch/arm64/boot/dts/qcom/qdu1000.dtsi @@ -1242,6 +1242,7 @@ qcom,tcs-config = <ACTIVE_TCS 2>, <SLEEP_TCS 3>, <WA...
6a22e017f952ecaf4bb510cd0939259470a27b06
Analyze and fix the following issue in the Linux kernel code: nios2: Replace all non-returning strlcpy with strscpy
Problem Details: strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return...
```diff diff --git a/arch/nios2/kernel/cpuinfo.c b/arch/nios2/kernel/cpuinfo.c index 203870c4b86d..338849c430a5 100644 --- a/arch/nios2/kernel/cpuinfo.c +++ b/arch/nios2/kernel/cpuinfo.c @@ -47,7 +47,7 @@ void __init setup_cpuinfo(void) str = of_get_property(cpu, "altr,implementation", &len); if (str) - strlcpy(...
ea2062dd1f0384ae1b136d333ee4ced15bedae38
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: fix the system hang while disable PSR
Problem Details: [Why] When the PSR enabled. If you try to adjust the timing parameters, it may cause system hang. Because the timing mismatch with the DMCUB settings. [How] Disable the PSR before adjusting timing parameters. Cc: Mario Limonciello <mario.limonciello@amd.com> Cc: Alex Deucher <alexander.deucher@amd.co...
```diff diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 2b8d42de1f73..7acd73e5004f 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -8204,6 +8204,12 @@ static void amdgpu_dm_...
7ac9be96b0113a34c33110b32912642bdc8ff33d
Analyze and fix the following issue in the Linux kernel code: drm/radeon: Disable outputs when releasing fbdev client
Problem Details: Disable the modesetting pipeline before release the radeon's fbdev client. Fixes the following error: [ 17.217408] WARNING: CPU: 5 PID: 1464 at drivers/gpu/drm/ttm/ttm_bo.c:326 ttm_bo_release+0x27e/0x2d0 [ttm] [ 17.217418] Modules linked in: edac_mce_amd radeon(+) drm_ttm_helper ttm video drm_suba...
```diff diff --git a/drivers/gpu/drm/radeon/radeon_fbdev.c b/drivers/gpu/drm/radeon/radeon_fbdev.c index fe76e29910ef..8f6c3aef0962 100644 --- a/drivers/gpu/drm/radeon/radeon_fbdev.c +++ b/drivers/gpu/drm/radeon/radeon_fbdev.c @@ -307,6 +307,7 @@ static void radeon_fbdev_client_unregister(struct drm_client_dev *client)...
7ab1a4913d0051cf5196ef7987b5fa42c25e13b6
Analyze and fix the following issue in the Linux kernel code: drm/amd: Tighten permissions on VBIOS flashing attributes
Problem Details: Non-root users shouldn't be able to try to trigger a VBIOS flash or query the flashing status. This should be reserved for users with the appropriate permissions. Cc: stable@vger.kernel.org Fixes: 8424f2ccb3c0 ("drm/amdgpu/psp: Add vbflash sysfs interface support") Reviewed-by: Alex Deucher <alexande...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index cf2ffe6fe4a2..a150b7a4b4aa 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -3602,13 +3602,13 @@ static ssize_t amdgpu_psp_vbflash_status(struct device *dev, ...
3eb1a3a04056ba3df3205e169b8acc9da0c65a94
Analyze and fix the following issue in the Linux kernel code: drm/amd: Make sure image is written to trigger VBIOS image update flow
Problem Details: The VBIOS image update flow requires userspace to: 1) Write the image to `psp_vbflash` 2) Read `psp_vbflash` 3) Poll `psp_vbflash_status` to check for completion If userspace reads `psp_vbflash` before writing an image, it's possible that it causes problems that can put the dGPU into an invalid state....
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 9d7e6e0e73ed..cf2ffe6fe4a2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -3548,6 +3548,9 @@ static ssize_t amdgpu_psp_vbflash_read(struct file *filp, struc...
55b94bb8c42464bad3d2217f6874aa1a85664eac
Analyze and fix the following issue in the Linux kernel code: drm/nouveau: add nv_encoder pointer check for NULL
Problem Details: Pointer nv_encoder could be dereferenced at nouveau_connector.c in case it's equal to NULL by jumping to goto label. This patch adds a NULL-check to avoid it. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 3195c5f9784a ("drm/nouveau: set encoder for lvds") Signed-off-by: Nat...
```diff diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 5dbf025e6873..f75c6f09dd2a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -730,7 +730,8 @@ out: #endif nouveau_connector_set_edid(nv_co...
1dbcf770cc2d15baf8a1e8174d6fd014a68b45ca
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: Reset CP_VMID_PREEMPT after trailing fence signaled
Problem Details: When MEC executes unmap_queue for mid command buffer preemption, it will kick the write pointer of the gfx ring, set CP_VMID_PREEMPT to trigger the preemption and wait for CP_VMID_PREEMPT becomes zero after the preemption done. There is a race condition that PFP may excute the resetting command before ...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index e7f2b7bf0ff5..6c1e923bc7ce 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -5369,10 +5369,6 @@ static int gfx_v9_0_ring_preempt_ib(struct amdgpu_ring *ring) amdgpu...
20a2ce87fbaf81e4c3dcb631d738e423959eb320
Analyze and fix the following issue in the Linux kernel code: drm/nouveau/dp: check for NULL nv_connector->native_mode
Problem Details: Add checking for NULL before calling nouveau_connector_detect_depth() in nouveau_connector_get_modes() function because nv_connector->native_mode could be dereferenced there since connector pointer passed to nouveau_connector_detect_depth() and the same value of nv_connector->native_mode is used there....
```diff diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 086b66b60d91..5dbf025e6873 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -966,7 +966,7 @@ nouveau_connector_get_modes(struct drm_connector ...
7bc4d3089a50050d4df0af63423a5d907c3bdb1a
Analyze and fix the following issue in the Linux kernel code: rtla/hwnoise: Reduce runtime to 75%
Problem Details: osnoise runs 100% of time by default. It makes sense because osnoise is preemptive. hwnoise checks preemption once a second, so it reduces system progress. Reduce runtime to 75% to avoid problems by default. I added a Fixes as it might avoid problems for first time users as it lands on distros. Link:...
```diff diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/osnoise_top.c index 85abba568faf..f7c959be8677 100644 --- a/tools/tracing/rtla/src/osnoise_top.c +++ b/tools/tracing/rtla/src/osnoise_top.c @@ -348,8 +348,14 @@ struct osnoise_top_params *osnoise_top_parse_args(int argc, char **argv) i...
eee43699217504ba69cadefc85c6992df555e33f
Analyze and fix the following issue in the Linux kernel code: spi: dw: Replace incorrect spi_get_chipselect with set
Problem Details: Commit 445164e8c136 ("spi: dw: Replace spi->chip_select references with function calls") replaced direct access to spi.chip_select with spi_*_chipselect calls but incorrectly replaced a set instance with a get instance, replace the incorrect instance. Fixes: 445164e8c136 ("spi: dw: Replace spi->chip_s...
```diff diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c index 5f2aee69c1c1..15f5e9cb54ad 100644 --- a/drivers/spi/spi-dw-mmio.c +++ b/drivers/spi/spi-dw-mmio.c @@ -274,7 +274,7 @@ static void dw_spi_elba_set_cs(struct spi_device *spi, bool enable) */ spi_set_chipselect(spi, 0, 0); dw_spi_set_c...
3e253b21693d08126c828cddcb4fd3949898f773
Analyze and fix the following issue in the Linux kernel code: ASoC: tlv320aic32x4: pll: Remove impossible condition in clk_aic32x4_pll_determine_rate()
Problem Details: Smatch warns: sound/soc/codecs/tlv320aic32x4-clk.c:219 clk_aic32x4_pll_determine_rate() warn: unsigned 'rate' is never less than zero. Cc: Maxime Ripard <maxime@cerno.tech> Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202306101217.08CRVGcK-lkp@intel.com...
```diff diff --git a/sound/soc/codecs/tlv320aic32x4-clk.c b/sound/soc/codecs/tlv320aic32x4-clk.c index a7ec501b4c69..c116e82f712d 100644 --- a/sound/soc/codecs/tlv320aic32x4-clk.c +++ b/sound/soc/codecs/tlv320aic32x4-clk.c @@ -208,18 +208,14 @@ static int clk_aic32x4_pll_determine_rate(struct clk_hw *hw, struct...
be8fa5fd0a48fd2decc4de81ffe72bb3ceacecd9
Analyze and fix the following issue in the Linux kernel code: clk: Fix best_parent_rate after moving code into a separate function
Problem Details: best_parent_rate entry is still being used in the code and needs to be always updated regardless of the CLK_SET_RATE_NO_REPARENT flag. Fixes: 1b4e99fda73f ("clk: Move no reparent case into a separate function") Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Link: https://lore.kernel.org/r/...
```diff diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index ffc9f03840b7..7ac9f7a8cb84 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -629,6 +629,7 @@ clk_core_determine_rate_no_reparent(struct clk_hw *hw, best = clk_core_get_rate_nolock(core); } + req->best_parent_rate = best; req->rate = best...
3aed112953b1877ede66ae77afa4e5a5024be7cb
Analyze and fix the following issue in the Linux kernel code: soc: qcom: Fix a IS_ERR() vs NULL bug in probe
Problem Details: The devm_ioremap() function returns NULL on error, it never returns error pointers. Fixes: a77b2a0b1280 ("soc: qcom: Introduce RPM master stats driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <anderss...
```diff diff --git a/drivers/soc/qcom/rpm_master_stats.c b/drivers/soc/qcom/rpm_master_stats.c index 6dd98b9f7129..9ca13bcf67d3 100644 --- a/drivers/soc/qcom/rpm_master_stats.c +++ b/drivers/soc/qcom/rpm_master_stats.c @@ -105,7 +105,7 @@ static int master_stats_probe(struct platform_device *pdev) } data[i].bas...
2d7b1a31ffb865d1f8e95e985cdbd0df72f671cf
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sc8180x: Move DisplayPort for MMCX
Problem Details: The DisplayPort blocks are powered by MMCX and should be described as such to ensure that power votes are done on the right resource. This also solves the problem that sync_state is unaware of the DP controllers needing MMCX to be kept alive during boot. As such this change also fixes occasionally see...
```diff diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi index 88015742315b..5276d4bfdf4e 100644 --- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi +++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi @@ -2966,7 +2966,7 @@ #sound-dai-cells = <0>; operating-points-v2 = <&dp0_opp_tab...
e537d5ef47097360d8df524c748f3df451383dcd
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sc8180x: Fix adreno smmu compatible
Problem Details: The adreno smmu should be compatible with qcom,adreno-smmu as well for per-process page tables to work. Fixes: 8575f197b077 ("arm64: dts: qcom: Introduce the SC8180x platform") Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed...
```diff diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi index e8613a00fcab..88015742315b 100644 --- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi +++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi @@ -2310,7 +2310,8 @@ }; adreno_smmu: iommu@2ca0000 { - compatible = "qcom,sc8180x-...
a277430b3836cdfb994f45cc87d1bd56c4d490aa
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sc8180x-primus: dispcc is already okay
Problem Details: &dispcc status was changed to okay by default in the platform, no need to do it again in the board. Fixes: 2ce38cc1e8fe ("arm64: dts: qcom: sc8180x: Introduce Primus") Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: ...
```diff diff --git a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts index cca663bcb92d..fc038474cb71 100644 --- a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts +++ b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts @@ -291,10 +291,6 @@ }; }; -&dispcc { - status = "okay"; -}; - ...
bbde65f9da9291a77636e1467b28f27ced1b4ece
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sm8550: fix low_svs RPMhPD labels
Problem Details: "low" was written "lov", fix this. Fixes: 99d33ee61cb0 ("arm64: dts: qcom: sm8550: Add missing RPMhPD OPP levels") Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.ke...
```diff diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi index 20924d570c07..981d439dc95c 100644 --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi @@ -3640,15 +3640,15 @@ opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>; }; - rpmhp...
f04325e4d4d66e63fc4e474ff54835a28b3ff29e
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sa8540p-ride: Specify ethernet phy OUI
Problem Details: With wider usage on more boards, there have been reports of the following: [ 315.016174] qcom-ethqos 20000.ethernet eth0: no phy at addr -1 [ 315.016179] qcom-ethqos 20000.ethernet eth0: __stmmac_open: Cannot attach to PHY (error: -19) which has been fairly random and isolated to specific b...
```diff diff --git a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts index 21e9eaf914dd..5a26974dcf8f 100644 --- a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts +++ b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts @@ -171,6 +171,7 @@ /* Marvell 88EA1512 */ rgmii_phy: phy@8 { + com...
95011f267c44a4d1f9ca1769e8a29ab2c559e004
Analyze and fix the following issue in the Linux kernel code: drm/bridge: ti-sn65dsi86: Avoid possible buffer overflow
Problem Details: Smatch error:buffer overflow 'ti_sn_bridge_refclk_lut' 5 <= 5. Fixes: cea86c5bb442 ("drm/bridge: ti-sn65dsi86: Implement the pwm_chip") Signed-off-by: Su Hui <suhui@nfschina.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https:/...
```diff diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 7a748785c545..4676cf2900df 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -298,6 +298,10 @@ static void ti_sn_bridge_set_refclk_freq(struct ti_sn65dsi86 *pdata) ...
0d25da8e7e1e35bdbb521d586be1954bdedd1cca
Analyze and fix the following issue in the Linux kernel code: soc: qcom: mdt_loader: Fix split image detection
Problem Details: The enhanced detection introduced in commit '210d12c8197a ("soc: qcom: mdt_loader: Enhance split binary detection")' requires that all segments lies within the file on disk. But the Qualcomm firmware files consistently has a BSS-like segment at the end, with a p_offset aligned to the next 4k boundary....
```diff diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c index 9418993a3a92..6f177e46fa0f 100644 --- a/drivers/soc/qcom/mdt_loader.c +++ b/drivers/soc/qcom/mdt_loader.c @@ -275,6 +275,14 @@ static bool qcom_mdt_bins_are_split(const struct firmware *fw, const char *fw_na phdrs = (struct elf32...
106ed2cad9f7bd803bd31a18fe7a9219b077bf95
Analyze and fix the following issue in the Linux kernel code: KVM: SVM: WARN, but continue, if misc_cg_set_capacity() fails
Problem Details: WARN and continue if misc_cg_set_capacity() fails, as the only scenario in which it can fail is if the specified resource is invalid, which should never happen when CONFIG_KVM_AMD_SEV=y. Deliberately not bailing "fixes" a theoretical bug where KVM would leak the ASID bitmaps on failure, which again ca...
```diff diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index d65578d8784d..07756b7348ae 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -2216,9 +2216,7 @@ void __init sev_hardware_setup(void) } sev_asid_count = max_sev_asid - min_sev_asid + 1; - if (misc_cg_set_capacity(MISC_CG_R...
389ce21b622b0dba4e9134d6236ce0bf1635edcb
Analyze and fix the following issue in the Linux kernel code: arm64: add kdump.rst into index.rst
Problem Details: Document kdump.rst was added into Documentation/arm64/, but not listed in Documentation/arm64/index.rst. That triggers below warning when executing "make htmldoc": >> Documentation/arm64/kdump.rst: WARNING: document isn't included in any toctree Fix it now. Reported-by: kernel test robot <lkp@intel....
```diff diff --git a/Documentation/arm64/index.rst b/Documentation/arm64/index.rst index ae21f8118830..e58391557f00 100644 --- a/Documentation/arm64/index.rst +++ b/Documentation/arm64/index.rst @@ -15,6 +15,7 @@ ARM64 Architecture cpu-feature-registers elf_hwcaps hugetlbpage + kdump legacy_instr...
c3b880acadc95d6e019eae5d669e072afda24f1b
Analyze and fix the following issue in the Linux kernel code: xfs: fix ag count overflow during growfs
Problem Details: I found a corruption during growfs: XFS (loop0): Internal error agbno >= mp->m_sb.sb_agblocks at line 3661 of file fs/xfs/libxfs/xfs_alloc.c. Caller __xfs_free_extent+0x28e/0x3c0 CPU: 0 PID: 573 Comm: xfs_growfs Not tainted 6.3.0-rc7-next-20230420-00001-gda8c95746257 Call Trace: <TASK> dump...
```diff diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h index 1cfd5bc6520a..9c60ebb328b4 100644 --- a/fs/xfs/libxfs/xfs_fs.h +++ b/fs/xfs/libxfs/xfs_fs.h @@ -257,6 +257,8 @@ typedef struct xfs_fsop_resblks { #define XFS_MAX_AG_BLOCKS (XFS_MAX_AG_BYTES / XFS_MIN_BLOCKSIZE) #define XFS_MAX_CRC_AG_BLOCKS (X...
3dbd53c7be1c3dd04875a0672262b56417039869
Analyze and fix the following issue in the Linux kernel code: swim3: fix the floppy_locked_ioctl prototype
Problem Details: Add back the accidentally dropped mode parameter. Fixes: b60f7635788a ("swim3: fix the floppy_locked_ioctl prototype") Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20230613154309.327557-1-hch@lst.de Signed-off-by: Jens ...
```diff diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c index 945a03154250..dc43a63b3469 100644 --- a/drivers/block/swim3.c +++ b/drivers/block/swim3.c @@ -882,7 +882,7 @@ static int fd_eject(struct floppy_state *fs) static struct floppy_struct floppy_type = { 2880,18,2,80,0,0x1B,0x00,0xCF,0x6C,NULL }; /*...
cea44032bc799b088bce1ea73c08269bb59b47d0
Analyze and fix the following issue in the Linux kernel code: gfs2: retry interrupted internal reads
Problem Details: The iomap-based read operations done by gfs2 for its system files, such as rindex, may sometimes be interrupted and return -EINTR. This confuses some users of gfs2_internal_read(). Fix that by retrying interrupted reads. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruen...
```diff diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index d95125714ebb..dacc21b1ae00 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -491,13 +491,16 @@ int gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos, void *p; do { - amt = size - copied; - if (offset + size > PAGE_SIZE) - amt = PAGE_...
c1bcb976d8feb107ff2c12caaf12ac5e70f44d5f
Analyze and fix the following issue in the Linux kernel code: gpio: sifive: add missing check for platform_get_irq
Problem Details: Add the missing check for platform_get_irq() and return error code if it fails. The returned error code will be dealed with in builtin_platform_driver(sifive_gpio_driver) and the driver will not be registered. Fixes: f52d6d8b43e5 ("gpio: sifive: To get gpio irq offset from device tree data") Signed-o...
```diff diff --git a/drivers/gpio/gpio-sifive.c b/drivers/gpio/gpio-sifive.c index 98939cd4a71e..745e5f67254e 100644 --- a/drivers/gpio/gpio-sifive.c +++ b/drivers/gpio/gpio-sifive.c @@ -221,8 +221,12 @@ static int sifive_gpio_probe(struct platform_device *pdev) return -ENODEV; } - for (i = 0; i < ngpio; i++) - ...
1e327963cfab0e02eeeb0331178d6c353c959cd6
Analyze and fix the following issue in the Linux kernel code: x86/sgx: Avoid using iterator after loop in sgx_mmu_notifier_release()
Problem Details: If &encl_mm->encl->mm_list does not contain the searched 'encl_mm', 'tmp' will not point to a valid sgx_encl_mm struct. Linus proposed to avoid any use of the list iterator variable after the loop, in the attempt to move the list iterator variable declaration into the macro to avoid any potential misu...
```diff diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c index 2a0e90fe2abc..91fa70e51004 100644 --- a/arch/x86/kernel/cpu/sgx/encl.c +++ b/arch/x86/kernel/cpu/sgx/encl.c @@ -755,6 +755,7 @@ static void sgx_mmu_notifier_release(struct mmu_notifier *mn, { struct sgx_encl_mm *encl_mm = cont...
47b3ad6b7842f49d374a01b054a4b1461a621bdc
Analyze and fix the following issue in the Linux kernel code: mmc: mmci: stm32: fix max busy timeout calculation
Problem Details: The way that the timeout is currently calculated could lead to a u64 timeout value in mmci_start_command(). This value is then cast in a u32 register that leads to mmc erase failed issue with some SD cards. Fixes: 8266c585f489 ("mmc: mmci: add hardware busy timeout feature") Signed-off-by: Yann Gautie...
```diff diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index f2b2e8b0574e..696cbef3ff7d 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1735,7 +1735,8 @@ static void mmci_set_max_busy_timeout(struct mmc_host *mmc) return; if (host->variant->busy_timeout && mmc->actual_clock...
3108eb2e8aa7e955a9dd3a4c1bf19a7898961822
Analyze and fix the following issue in the Linux kernel code: mmc: mmci: Set PROBE_PREFER_ASYNCHRONOUS
Problem Details: All mmc host drivers should have the asynchronous probe option enabled, but it seems like we failed to set it for mmci, so let's do that now. Fixes: 21b2cec61c04 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4") Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Linus...
```diff diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index f2b2e8b0574e..97a77eefb11a 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -2455,6 +2455,7 @@ static struct amba_driver mmci_driver = { .drv = { .name = DRIVER_NAME, .pm = &mmci_dev_pm_ops, + .probe_type = PROBE...
c7753ed71c160f75f92ff5679e9fc22526e56fc5
Analyze and fix the following issue in the Linux kernel code: dt-bindings: pinctrl: qcom,pmic-mpp: Fix schema for "qcom,paired"
Problem Details: The "qcom,paired" schema is all wrong. First, it's a list rather than an object(dictionary). Second, it is missing a required type. The meta-schema normally catches this, but schemas under "$defs" was not getting checked. A fix for that is pending. Fixes: f9a06b810951 ("dt-bindings: pinctrl: qcom,pmic...
```diff diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml index c91d3e3a094b..80f960671857 100644 --- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml +++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml @...
8c00914e5438e3636f26b4f814b3297ae2a1b9ee
Analyze and fix the following issue in the Linux kernel code: gpiolib: Fix GPIO chip IRQ initialization restriction
Problem Details: In case of gpio-regmap, IRQ chip is added by regmap-irq and associated with GPIO chip by gpiochip_irqchip_add_domain(). The initialization flag was not added in gpiochip_irqchip_add_domain(), causing gpiochip_to_irq() to return -EPROBE_DEFER. Fixes: 5467801f1fcb ("gpio: Restrict usage of GPIO chip irq...
```diff diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index a7220e04a93e..9ecf93cbd801 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1792,6 +1792,14 @@ int gpiochip_irqchip_add_domain(struct gpio_chip *gc, gc->to_irq = gpiochip_to_irq; gc->irq.domain = domain; + /* + * Using...
6fa0a72cbbe45db4ed967a51f9e6f4e3afe61d20
Analyze and fix the following issue in the Linux kernel code: gfs2: Fix possible data races in gfs2_show_options()
Problem Details: Some fields such as gt_logd_secs of the struct gfs2_tune are accessed without holding the lock gt_spin in gfs2_show_options(): val = sdp->sd_tune.gt_logd_secs; if (val != 30) seq_printf(s, ",commit=%d", val); And thus can cause data races when gfs2_show_options() and other functions such as g...
```diff diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 3a7e7c31eb9c..c89b28030495 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -1004,7 +1004,14 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) { struct gfs2_sbd *sdp = root->d_sb->s_fs_info; struct gfs2_args *args = &sdp->sd_a...
44e46572f0bae431a6092e3cfd2f47bff8b8d18c
Analyze and fix the following issue in the Linux kernel code: regmap: regcache: Don't sync read-only registers
Problem Details: regcache_maple_sync() tries to sync all cached values no matter whether it's writable or not. OTOH, regache_sync_val() does care the wrtability and returns -EIO for a read-only register. This results in an error message like: snd_hda_codec_realtek hdaudioC0D0: Unable to sync register 0x2f0009. -5 a...
```diff diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index 029564695dbb..97c681fcf9f6 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c @@ -284,6 +284,9 @@ static bool regcache_reg_needs_sync(struct regmap *map, unsigned int reg, { int ret; + if (!regm...
21e87daece5aed25f47f051af5fccbbd39164c88
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: timers: Fix resource leaks in kvm_timer_hyp_init()
Problem Details: Smatch detected this bug: arch/arm64/kvm/arch_timer.c:1425 kvm_timer_hyp_init() warn: missing unwind goto? There are two resources to be freed the vtimer and ptimer. The line that Smatch complains about should free the vtimer first before returning and then after that cleanup code should free...
```diff diff --git a/arch/arm64/kvm/arch_timer.c b/arch/arm64/kvm/arch_timer.c index 05b022be885b..0696732fa38c 100644 --- a/arch/arm64/kvm/arch_timer.c +++ b/arch/arm64/kvm/arch_timer.c @@ -1406,7 +1406,7 @@ int __init kvm_timer_hyp_init(bool has_gic) kvm_get_running_vcpus()); if (err) { kvm_err("kvm_...
f9fd804aa0a36f15a35ca070ec4c52650876cc29
Analyze and fix the following issue in the Linux kernel code: ASoC: tegra: Fix Master Volume Control
Problem Details: Commit 3ed2b549b39f ("ALSA: pcm: fix wait_time calculations") corrected the PCM wait_time calculations and in doing so reduced the calculated wait_time. This exposed an issue with the Tegra Master Volume Control (MVC) device where the reduced wait_time caused the MVC to fail. For now fix this by settin...
```diff diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c index 468c8e77de21..0b69cebc9a33 100644 --- a/sound/soc/tegra/tegra_pcm.c +++ b/sound/soc/tegra/tegra_pcm.c @@ -117,6 +117,9 @@ int tegra_pcm_open(struct snd_soc_component *component, return ret; } + /* Set wait time to 500ms by defau...
404615d7f1dcd4cca200e9a7a9df3a1dcae1dd62
Analyze and fix the following issue in the Linux kernel code: ext2: Drop fragment support
Problem Details: Ext2 has fields in superblock reserved for subblock allocation support. However that never landed. Drop the many years dead code. Reported-by: syzbot+af5e10f73dbff48f70af@syzkaller.appspotmail.com Signed-off-by: Jan Kara <jack@suse.cz>
```diff diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h index 5e82ec0847cf..35a041c47c38 100644 --- a/fs/ext2/ext2.h +++ b/fs/ext2/ext2.h @@ -70,10 +70,7 @@ struct mb_cache; * second extended-fs super-block data in memory */ struct ext2_sb_info { - unsigned long s_frag_size; /* Size of a fragment in bytes */ - unsign...
b77b75fc61216cfaa974a8241186635eabe6671a
Analyze and fix the following issue in the Linux kernel code: platform/x86: ISST: Fix usage counter
Problem Details: On multi package system, the TPMI SST instance is getting allocated again as the usage counter is not getting incremented. Here the instance is allocated only when the usage count is zero. There is no need to allocate again. Increment usage ID on successful return from isst_if_cdev_register(). Signed...
```diff diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c index 664d2ee60385..63faa2ea8327 100644 --- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c +++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c @@ -1...
832e231cff476102e8204a9e7bddfe5c6154a375
Analyze and fix the following issue in the Linux kernel code: tty: serial: samsung_tty: Fix a memory leak in s3c24xx_serial_getclk() when iterating clk
Problem Details: When the best clk is searched, we iterate over all possible clk. If we find a better match, the previous one, if any, needs to be freed. If a better match has already been found, we still need to free the new one, otherwise it leaks. Cc: <stable@vger.kernel.org> # v3.3+ Reviewed-by: Krzysztof Kozlows...
```diff diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index a92a23e1964e..0b37019820b4 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -1490,10 +1490,18 @@ static unsigned int s3c24xx_serial_getclk(struct s3c24xx_uart_port *ourport, calc_dev...
a9c09546e903f1068acfa38e1ee18bded7114b37
Analyze and fix the following issue in the Linux kernel code: tty: serial: samsung_tty: Fix a memory leak in s3c24xx_serial_getclk() in case of error
Problem Details: If clk_get_rate() fails, the clk that has just been allocated needs to be freed. Cc: <stable@vger.kernel.org> # v3.3+ Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Fixes: 5f5a7a5578c5 ("serial: samsung: switch to clkdev based clock lo...
```diff diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 2a7520ad3abd..a92a23e1964e 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -1459,8 +1459,12 @@ static unsigned int s3c24xx_serial_getclk(struct s3c24xx_uart_port *ourport, continue;...
a82c3df955f8c1c726e4976527aa6ae924a67dd9
Analyze and fix the following issue in the Linux kernel code: tty: serial: fsl_lpuart: reduce RX watermark to 0 on LS1028A
Problem Details: LS1028A is using DMA with LPUART. Having RX watermark set to 1, means DMA transactions are started only after receiving the second character. On other platforms with newer LPUART IP, Receiver Idle Empty function initiates the DMA request after the receiver is idling for 4 characters. But this feature ...
```diff diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 7486a2b8556c..7fd30fcc10c6 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -310,7 +310,7 @@ static const struct lpuart_soc_data ls1021a_data = { static const struct lpuart_soc_data ls1028a...
f2b689ab2f8cc089cc7659c323f282e6a1fb6d64
Analyze and fix the following issue in the Linux kernel code: platform/x86/intel/pmc/mtl: Put devices in D3 during resume
Problem Details: An earlier commit placed some driverless devices in D3 during boot so that they don't block package cstate entry on Meteor Lake. Also place these devices in D3 after resume from suspend. Fixes: 336ba968d3e3 ("platform/x86/intel/pmc/mtl: Put GNA/IPU/VPU devices in D3") Signed-off-by: David E. Box <davi...
```diff diff --git a/drivers/platform/x86/intel/pmc/mtl.c b/drivers/platform/x86/intel/pmc/mtl.c index e8cc156412ce..2b00ad9da621 100644 --- a/drivers/platform/x86/intel/pmc/mtl.c +++ b/drivers/platform/x86/intel/pmc/mtl.c @@ -68,16 +68,29 @@ static void mtl_set_device_d3(unsigned int device) } } +/* + * Set power...
1eea99c04555e505c0361f70c9232a9f0d88974b
Analyze and fix the following issue in the Linux kernel code: powerpc/legacy_serial: Handle SERIAL_8250_FSL=n build failures
Problem Details: With SERIAL_8250=y and SERIAL_8250_FSL_CONSOLE=n the both IS_ENABLED(CONFIG_SERIAL_8250) and IS_REACHABLE(CONFIG_SERIAL_8250) evaluate to true and so fsl8250_handle_irq() is used. However this function is only available if CONFIG_SERIAL_8250_CONSOLE=y (and thus SERIAL_8250_FSL=y). To prepare SERIAL_82...
```diff diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index fdbd85aafeb1..6ee65741dbd5 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c @@ -510,7 +510,7 @@ static void __init fixup_port_irq(int index, if (IS_ENABLED(CONFIG_SERIAL_825...
f999e23ce66c1555d7b653fba171a88ecee53704
Analyze and fix the following issue in the Linux kernel code: platform/x86: thinkpad_acpi: Fix lkp-tests warnings for platform profiles
Problem Details: Fix issues identified in dytc_profile_refresh identified by lkp-tests. drivers/platform/x86/thinkpad_acpi.c:10538 dytc_profile_refresh() error: uninitialized symbol 'funcmode'. drivers/platform/x86/thinkpad_acpi.c:10531 dytc_profile_refresh() error: uninitialized symbol 'output'. drivers/platform/x86...
```diff diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index b3808ad77278..187018ffb068 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -10524,8 +10524,8 @@ unlock: static void dytc_profile_refresh(void) { enum platform_profil...
11d24327c2d7ad7f24fcc44fb00e1fa91ebf6525
Analyze and fix the following issue in the Linux kernel code: drm/nouveau: don't detect DSM for non-NVIDIA device
Problem Details: The call site of nouveau_dsm_pci_probe() uses single set of output variables for all invocations. So, we must not write anything to them unless it's an NVIDIA device. Otherwise, if we are called with another device after the NVIDIA device, we'll clober the result of the NVIDIA device. For example, if ...
```diff diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c index 8cf096f841a9..a2ae8c21e4dc 100644 --- a/drivers/gpu/drm/nouveau/nouveau_acpi.c +++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c @@ -220,6 +220,9 @@ static void nouveau_dsm_pci_probe(struct pci_dev *pdev, acpi_handle *...
286d9975a838d0a54da049765fa1d1fb96b89682
Analyze and fix the following issue in the Linux kernel code: usb: gadget: udc: core: Prevent soft_connect_store() race
Problem Details: usb_udc_connect_control(), soft_connect_store() and usb_gadget_deactivate() can potentially race against each other to invoke usb_gadget_connect()/usb_gadget_disconnect(). To prevent this, guard udc->started, gadget->allow_connect, gadget->deactivate and gadget->connect with connect_lock so that ->pull...
```diff diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c index d2e4f78c53e3..83fd1de14784 100644 --- a/drivers/usb/gadget/udc/core.c +++ b/drivers/usb/gadget/udc/core.c @@ -40,6 +40,11 @@ static const struct bus_type gadget_bus_type; * @allow_connect: Indicates whether UDC is allowed to be p...
50966da807c81c5eb3bdfd392990fe0bba94d1ee
Analyze and fix the following issue in the Linux kernel code: usb: gadget: udc: core: Offload usb_udc_vbus_handler processing
Problem Details: usb_udc_vbus_handler() can be invoked from interrupt context by irq handlers of the gadget drivers, however, usb_udc_connect_control() has to run in non-atomic context due to the following: a. Some of the gadget driver implementations expect the ->pullup callback to be invoked in non-atomic context....
```diff diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c index 52e6d2e84e35..d2e4f78c53e3 100644 --- a/drivers/usb/gadget/udc/core.c +++ b/drivers/usb/gadget/udc/core.c @@ -37,6 +37,9 @@ static const struct bus_type gadget_bus_type; * @vbus: for udcs who care about vbus status, this value is...
92c9c3baad6b1fd584fbabeaa4756f9b77926cb5
Analyze and fix the following issue in the Linux kernel code: usb: typec: Fix fast_role_swap_current show function
Problem Details: The current implementation mistakenly performs a & operation on the output of sysfs_emit. This patch performs the & operation before calling sysfs_emit. Fixes: 662a60102c12 ("usb: typec: Separate USB Power Delivery from USB Type-C") Cc: stable <stable@kernel.org> Reported-by: Benson Leung <bleung@chro...
```diff diff --git a/drivers/usb/typec/pd.c b/drivers/usb/typec/pd.c index 0bcde1ff4d39..8cc66e4467c4 100644 --- a/drivers/usb/typec/pd.c +++ b/drivers/usb/typec/pd.c @@ -95,7 +95,7 @@ peak_current_show(struct device *dev, struct device_attribute *attr, char *buf) static ssize_t fast_role_swap_current_show(struct dev...
01052b91c9808e3c3b068ae2721cb728ec9aa4c0
Analyze and fix the following issue in the Linux kernel code: usb: dwc3-meson-g12a: Fix an error handling path in dwc3_meson_g12a_probe()
Problem Details: If dwc3_meson_g12a_otg_init() fails, resources allocated by the previous of_platform_populate() call should be released, as already done in the error handling path. Fixes: 1e355f21d3fb ("usb: dwc3: Add Amlogic A1 DWC3 glue") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by...
```diff diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c index 365aec00d302..e99c7489dba0 100644 --- a/drivers/usb/dwc3/dwc3-meson-g12a.c +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c @@ -796,7 +796,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) ret = dwc3_meson_g...