id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
7430764f5a85d30314aeef2d5438dff1fb0b1d68
Analyze and fix the following issue in the Linux kernel code: spi: hisi-kunpeng: Delete the dump interface of data registers in debugfs
Problem Details: Due to the reading of FIFO during the dump of data registers in debugfs, if SPI transmission is in progress, it will be affected and may result in transmission failure. Therefore, the dump interface of data registers in debugfs is removed. Fixes: 2b2142f247eb ("spi: hisi-kunpeng: Add debugfs support")...
```diff diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c index 35ef5e8e2ffd..77e9738e42f6 100644 --- a/drivers/spi/spi-hisi-kunpeng.c +++ b/drivers/spi/spi-hisi-kunpeng.c @@ -151,8 +151,6 @@ static const struct debugfs_reg32 hisi_spi_regs[] = { HISI_SPI_DBGFS_REG("ENR", HISI_SPI_ENR), HI...
965edae4e6a2bca1f6e56d2c56d992417a53bba4
Analyze and fix the following issue in the Linux kernel code: coresight: debug: Move ACPI support from AMBA driver to platform driver
Problem Details: Add support for the cpu debug devices in a new platform driver, which can then be used on ACPI based platforms. This change would now allow runtime power management for ACPI based systems. The driver would try to enable the APB clock if available. But first this renames and then refactors debug_probe()...
```diff diff --git a/drivers/acpi/arm64/amba.c b/drivers/acpi/arm64/amba.c index bec0976541da..e1f0bbb8f393 100644 --- a/drivers/acpi/arm64/amba.c +++ b/drivers/acpi/arm64/amba.c @@ -22,7 +22,6 @@ static const struct acpi_device_id amba_id_list[] = { {"ARMH0061", 0}, /* PL061 GPIO Device */ {"ARMH0330", 0}, /* ARM...
caa41c47dab7e1054f587e592ab21296e3a6781c
Analyze and fix the following issue in the Linux kernel code: coresight: etm4x: Fix unbalanced pm_runtime_enable()
Problem Details: There is an unbalanced pm_runtime_enable() in etm4_probe_platform_dev() when etm4_probe() fails. This problem can be observed via the coresight etm4 module's (load -> unload -> load) sequence when etm4_probe() fails in etm4_probe_platform_dev(). [ 63.379943] coresight-etm4x 7040000.etm: Unbalanced p...
```diff diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index c2ca4a02dfce..06a9b94b8c13 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -2213,6 +2213,9 @@ static int etm4_pro...
042db639bf33aee118846a87223acebe6700137d
Analyze and fix the following issue in the Linux kernel code: selftests: drivers: hw: Fix ethtool_rmon
Problem Details: When rx-pktsNtoM reports a range that involves very low-valued range, such as 0-64, the calculated length of the packet will be -4, because FCS is subtracted from the value. mausezahn then confuses the value for an option and bails out. As a result, the test dumps many mausezahn error messages. Instea...
```diff diff --git a/tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh b/tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh index e2a1c10d3503..8f60c1685ad4 100755 --- a/tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh +++ b/tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh @@ -44,6 +44,7 @@ bucket_...
e0b97ddaf4b5babdc30be8a665052af8bcb4610e
Analyze and fix the following issue in the Linux kernel code: dt-bindings: arm: qcom,coresight-tpda: fix indentation in the example
Problem Details: Fix triple-space indentation to double-space in the example DTS. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lore.kernel.org/r/20240325104007.30723-2-krzysztof.kozlows...
```diff diff --git a/Documentation/devicetree/bindings/arm/qcom,coresight-tpda.yaml b/Documentation/devicetree/bindings/arm/qcom,coresight-tpda.yaml index 7fbd855a66a0..76163abed655 100644 --- a/Documentation/devicetree/bindings/arm/qcom,coresight-tpda.yaml +++ b/Documentation/devicetree/bindings/arm/qcom,coresight-tpd...
668c0406d887467d53f8fe79261dda1d22d5b671
Analyze and fix the following issue in the Linux kernel code: rcutorture: Fix invalid context warning when enable srcu barrier testing
Problem Details: When the torture_type is set srcu or srcud and cb_barrier is non-zero, running the rcutorture test will trigger the following warning: [ 163.910989][ C1] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48 [ 163.910994][ C1] in_atomic(): 1, irqs_disabled(): 1,...
```diff diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 456185d9e6c0..8654e99bd4a3 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -3044,11 +3044,12 @@ static void rcu_torture_barrier_cbf(struct rcu_head *rcu) } /* IPI handler to get callback posted on desired CPU, if onli...
431315a563015f259b28e34c5842f6166439e969
Analyze and fix the following issue in the Linux kernel code: rcutorture: Make stall-tasks directly exit when rcutorture tests end
Problem Details: When the rcutorture tests start to exit, the rcu_torture_cleanup() is invoked to stop kthreads and release resources, if the stall-task kthreads exist, cpu-stall has started and the rcutorture.stall_cpu is set to a larger value, the rcu_torture_cleanup() will be blocked for a long time and the hung-tas...
```diff diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 3f9c3766f52b..456185d9e6c0 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -2489,8 +2489,8 @@ static int rcu_torture_stall(void *args) preempt_disable(); pr_alert("%s start on CPU %d.\n", __func__, raw_smp_pr...
8b9b443fa860276822b25057cb3ff3b28734dec0
Analyze and fix the following issue in the Linux kernel code: rcutorture: Fix rcu_torture_one_read() pipe_count overflow comment
Problem Details: The "pipe_count > RCU_TORTURE_PIPE_LEN" check has a comment saying "Should not happen, but...". This is only true when testing an RCU whose grace periods are always long enough. This commit therefore fixes this comment. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Closes: https://lore...
```diff diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 6b821a7037b0..0cb5452ecd94 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -2000,7 +2000,8 @@ static bool rcu_torture_one_read(struct torture_random_state *trsp, long myid) preempt_disable(); pipe_count = READ_ONCE(p-...
74871791ffa9562d43567c5ff2ae93def3f39f65
Analyze and fix the following issue in the Linux kernel code: ntfs3: serve as alias for the legacy ntfs driver
Problem Details: Johan Hovold reported that removing the legacy ntfs driver broke boot for him since his fstab uses the legacy ntfs driver to access firmware from the original Windows partition. Use ntfs3 as an alias for legacy ntfs if CONFIG_NTFS_FS is selected. This is similar to how ext3 is treated. Link: https://...
```diff diff --git a/fs/ntfs3/Kconfig b/fs/ntfs3/Kconfig index cdfdf51e55d7..7bc31d69f680 100644 --- a/fs/ntfs3/Kconfig +++ b/fs/ntfs3/Kconfig @@ -46,3 +46,12 @@ config NTFS3_FS_POSIX_ACL NOTE: this is linux only feature. Windows will ignore these ACLs. If you don't know what Access Control Lists are, say N. ...
f351772c544bd20db63a61f20a70fb1fe3867000
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: fix mac id extraction when MSDU spillover in rx error path
Problem Details: Currently, in the rx error data path, mac id is extracted from the last 64bits of MSDU end description tag for each entry received in the WBM error ring. Then, each entry will be updated into the MSDU list for further processing. The extracted mac id is valid when a single MSDU is not fragmented and re...
```diff diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c index a593beecdd12..977a8acb736c 100644 --- a/drivers/net/wireless/ath/ath12k/dp_rx.c +++ b/drivers/net/wireless/ath/ath12k/dp_rx.c @@ -239,6 +239,14 @@ static inline u8 ath12k_dp_rx_get_msdu_src_link(struct ath12k_ba...
35fad98ed25ab9e08c4363f0f74efd612c8eb185
Analyze and fix the following issue in the Linux kernel code: serial: meson+qcom: don't advance the kfifo twice
Problem Details: Marek reports, that the -next commit 1788cf6a91d9 (tty: serial: switch from circ_buf to kfifo) broke meson_uart and qcom_geni_serial. The commit mistakenly advanced the kfifo twice: once by uart_fifo_get()/kfifo_out() and second time by uart_xmit_advance(). To advance the fifo only once, drop the supe...
```diff diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c index 4587ed4d4d5d..8eb586ac3b0d 100644 --- a/drivers/tty/serial/meson_uart.c +++ b/drivers/tty/serial/meson_uart.c @@ -162,7 +162,6 @@ static void meson_uart_start_tx(struct uart_port *port) break; writel(ch, port->membase ...
39c596304e44781c1950ea0cbf178d6433ff9c71
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: Add SM8550 Xperia 1 V
Problem Details: Add support for Sony Xperia 1 V, a.k.a PDX234. This device is a part of the SoMC SM8550 Yodo platform. This commit brings support for: * Remoteprocs (sans modem for now) * Flash LED (the notification LED is gone :((((() * SD Card * USB (*including SuperSpeed*) + PMIC_GLINK (it's funky, requires a repl...
```diff diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile index 7d40ec5e7d21..f63abb43e9fe 100644 --- a/arch/arm64/boot/dts/qcom/Makefile +++ b/arch/arm64/boot/dts/qcom/Makefile @@ -241,6 +241,7 @@ dtb-$(CONFIG_ARCH_QCOM) += sm8450-sony-xperia-nagara-pdx224.dtb dtb-$(CONFIG_ARCH_QCOM) ...
6e4f7e53991ca7e70dc7d5d9d66c833091e1f6ae
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sm8550: Mark DWC3 as dma-coherent
Problem Details: In a fairly new development, Qualcomm somehow made the DWC3 block cache-coherent. Annotate that. Fixes: 7f7e5c1b037f ("arm64: dts: qcom: sm8550: Add USB PHYs and controller nodes") Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: htt...
```diff diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi index a72627f4d8cd..5adb9b178b05 100644 --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi @@ -3245,6 +3245,7 @@ snps,usb2-lpm-disable; snps,has-lpm-erratum; tx-fifo-resize;...
d18b5477dcea7775a562b3ba7aaa68772c8980ba
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sm8550: Add missing DWC3 quirks
Problem Details: As expected, Qualcomm DWC3 implementation come with a sizable number of quirks. Make sure to account for all of them. Fixes: 7f7e5c1b037f ("arm64: dts: qcom: sm8550: Add USB PHYs and controller nodes") Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@...
```diff diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi index d60984d5ae4d..a72627f4d8cd 100644 --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi @@ -3231,12 +3231,20 @@ reg = <0x0 0x0a600000 0x0 0xcd00>; interrupts = <GIC_SPI 133 IR...
93395f9a8d52b89868d75e278adaf002f99dec22
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sm8550: Mark APPS SMMU as dma-coherent
Problem Details: Like on earlier flagship Qualcomm SoCs, the SMMU is dma-coherent. Mark it as such. Fixes: ffc50b2d3828 ("arm64: dts: qcom: Add base SM8550 dtsi") Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20240210-top...
```diff diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi index 463fc1e8bc91..d60984d5ae4d 100644 --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi @@ -3972,6 +3972,7 @@ <GIC_SPI 694 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 695 IRQ_TYP...
91fc74458d833dbc999aa04ca34c2a197711a0b6
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sm8550: Mark QUPs and GPI dma-coherent
Problem Details: These peripherals are DMA-coherent on 8550. Mark them as such. Interestingly enough, the I2C master hubs are not. Fixes: ffc50b2d3828 ("arm64: dts: qcom: Add base SM8550 dtsi") Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https:...
```diff diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi index 5cae8d773cec..463fc1e8bc91 100644 --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi @@ -812,6 +812,7 @@ dma-channels = <12>; dma-channel-mask = <0x3e>; iommus = <&apps_s...
f4626c12e4b538f757a73d08f4d86d564175b4f7
Analyze and fix the following issue in the Linux kernel code: ubsan: Add awareness of signed integer overflow traps
Problem Details: On arm64, UBSAN traps can be decoded from the trap instruction. Add the add, sub, and mul overflow trap codes now that CONFIG_UBSAN_SIGNED_WRAP exists. Seen under clang 19: Internal error: UBSAN: unrecognized failure code: 00000000f2005515 [#1] PREEMPT SMP Reported-by: Nathan Chancellor <nathan@ker...
```diff diff --git a/lib/ubsan.c b/lib/ubsan.c index 5fc107f61934..a1c983d148f1 100644 --- a/lib/ubsan.c +++ b/lib/ubsan.c @@ -44,9 +44,10 @@ const char *report_ubsan_failure(struct pt_regs *regs, u32 check_type) case ubsan_shift_out_of_bounds: return "UBSAN: shift out of bounds"; #endif -#ifdef CONFIG_UBSAN_DIV_...
48c0687a322d54ac7e7a685c0b6db78d78f593af
Analyze and fix the following issue in the Linux kernel code: Input: pm8xxx-vibrator - correct VIB_MAX_LEVELS calculation
Problem Details: The output voltage is inclusive hence the max level calculation is off-by-one-step. Correct it. iWhile we are at it also add a define for the step size instead of using the magic value. Fixes: 11205bb63e5c ("Input: add support for pm8xxx based vibrator driver") Signed-off-by: Fenglin Wu <quic_fenglin...
```diff diff --git a/drivers/input/misc/pm8xxx-vibrator.c b/drivers/input/misc/pm8xxx-vibrator.c index 5c288fe7accf..79f478d3a9b3 100644 --- a/drivers/input/misc/pm8xxx-vibrator.c +++ b/drivers/input/misc/pm8xxx-vibrator.c @@ -13,7 +13,8 @@ #define VIB_MAX_LEVEL_mV (3100) #define VIB_MIN_LEVEL_mV (1200) -#define VI...
836e2548524d2dfcb5acaf3be78f203b6b4bde6f
Analyze and fix the following issue in the Linux kernel code: media: usb: siano: Fix allocation of urbs
Problem Details: USB urbs must be allocated with usb_alloc_urb. Quoting the manual Only use this function (usb_init_urb) if you _really_ understand what you are doing. Fix the following smatch error: drivers/media/usb/siano/smsusb.c:53:38: warning: array of flexible structures Signed-off-by: Ricardo Ribalda <ribald...
```diff diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c index 723510520d09..2c8179a84991 100644 --- a/drivers/media/usb/siano/smsusb.c +++ b/drivers/media/usb/siano/smsusb.c @@ -40,7 +40,7 @@ struct smsusb_urb_t { struct smscore_buffer_t *cb; struct smsusb_device_t *dev; - struct ...
c3224f4147cc4159f2a47fe2162ee9b23bb09ed2
Analyze and fix the following issue in the Linux kernel code: media: ttpci: coding style fixes: logging
Problem Details: This patch fixes the following checkpatch warnings: WARNING:PRINTK_WITHOUT_KERN_LEVEL: printk() should include KERN_<LEVEL> facility level WARNING:PREFER_PR_LEVEL: Prefer [subsystem eg: netdev]_dbg([subsystem]dev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ... WARNING:EMBEDDED_F...
```diff diff --git a/drivers/media/pci/ttpci/budget-av.c b/drivers/media/pci/ttpci/budget-av.c index 76660d22f114..2e62c938e2cb 100644 --- a/drivers/media/pci/ttpci/budget-av.c +++ b/drivers/media/pci/ttpci/budget-av.c @@ -16,7 +16,6 @@ * the project's page is at https://linuxtv.org */ -#define pr_fmt(fmt) KBUILD...
58557349a875d321a582880b12943329a9f3fde4
Analyze and fix the following issue in the Linux kernel code: media: ttpci: coding style fixes: miscellaneous
Problem Details: This patch fixes the following checkpatch warnings: WARNING:RETURN_VOID: void function return statements are not generally useful WARNING:TRAILING_SEMICOLON: macros should not use a trailing semicolon Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@x...
```diff diff --git a/drivers/media/pci/ttpci/budget.c b/drivers/media/pci/ttpci/budget.c index 36aef9303223..91b9988089da 100644 --- a/drivers/media/pci/ttpci/budget.c +++ b/drivers/media/pci/ttpci/budget.c @@ -782,7 +782,6 @@ error_out: printk("budget: Frontend registration failed!\n"); dvb_frontend_detach(budget-...
22a8f8c216d2f9cd9d4607758bd2a017a4a8dcbf
Analyze and fix the following issue in the Linux kernel code: media: ttpci: coding style fixes: constant_comparsation
Problem Details: This patch fixes the following checkpatch warnings: WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
```diff diff --git a/drivers/media/pci/ttpci/budget-av.c b/drivers/media/pci/ttpci/budget-av.c index 9549e385a909..76660d22f114 100644 --- a/drivers/media/pci/ttpci/budget-av.c +++ b/drivers/media/pci/ttpci/budget-av.c @@ -442,7 +442,7 @@ static int saa7113_setinput(struct budget_av *budget_av, int input) { struct b...
2b8db3ebaf4c9e3d708ca94dc880e751e5b68ad8
Analyze and fix the following issue in the Linux kernel code: media: ttpci: coding style fixes: trailing_statements
Problem Details: This patch fixes the following checkpatch errors: ERROR:TRAILING_STATEMENTS: trailing statements should be on next line Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
```diff diff --git a/drivers/media/pci/ttpci/budget.c b/drivers/media/pci/ttpci/budget.c index 44f09b5485e6..28a479ce0754 100644 --- a/drivers/media/pci/ttpci/budget.c +++ b/drivers/media/pci/ttpci/budget.c @@ -213,7 +213,8 @@ static int alps_bsrv2_tuner_set_params(struct dvb_frontend *fe) pwr = 0; else if (c->fre...
23aebcf13193396fb76b7bc956c7a46fb64c98a2
Analyze and fix the following issue in the Linux kernel code: media: ttpci: coding style fixes: assign_in_if
Problem Details: This patch fixes the following checkpatch errors: ERROR:ASSIGN_IN_IF: do not use assignment in if condition Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
```diff diff --git a/drivers/media/pci/ttpci/budget-av.c b/drivers/media/pci/ttpci/budget-av.c index acac9bae4eda..9549e385a909 100644 --- a/drivers/media/pci/ttpci/budget-av.c +++ b/drivers/media/pci/ttpci/budget-av.c @@ -351,8 +351,9 @@ static int ciintf_init(struct budget_av *budget_av) budget_av->budget.ci_presen...
f126e8a44a033f206ade1db20b050508373d9864
Analyze and fix the following issue in the Linux kernel code: media: ttpci: coding style fixes: export_symbol
Problem Details: This patch fixes the following checkpatch warnings: WARNING:EXPORT_SYMBOL: EXPORT_SYMBOL(foo); should immediately follow its function/variable Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
```diff diff --git a/drivers/media/pci/ttpci/budget-core.c b/drivers/media/pci/ttpci/budget-core.c index f41f4eea7c08..20bcdd26fa16 100644 --- a/drivers/media/pci/ttpci/budget-core.c +++ b/drivers/media/pci/ttpci/budget-core.c @@ -34,6 +34,7 @@ #define BUFFER_WARNING_WAIT (30*HZ) int budget_debug; +EXPORT_SYMBOL_GP...
e4fc63e2a9273a4a6593aec34a378766ee5e1c96
Analyze and fix the following issue in the Linux kernel code: media: ttpci: coding style fixes: braces
Problem Details: This patch fixes the following checkpatch warnings and errors: WARNING:BRACES: braces {} are not necessary for any arm of this statement WARNING:BRACES: braces {} are not necessary for single statement blocks ERROR:OPEN_BRACE: that open brace { should be on the previous line CHECK:BRACES: braces {} sh...
```diff diff --git a/drivers/media/pci/ttpci/budget-av.c b/drivers/media/pci/ttpci/budget-av.c index dbd4ef40e867..acac9bae4eda 100644 --- a/drivers/media/pci/ttpci/budget-av.c +++ b/drivers/media/pci/ttpci/budget-av.c @@ -309,16 +309,14 @@ static int ciintf_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int ope...
004e24f9f2027b0efc20fd189d15ee310943e0ad
Analyze and fix the following issue in the Linux kernel code: media: ttpci: coding style fixes: comments
Problem Details: This patch fixes the following checkpatch warnings: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line WARNING: It's generally not useful to have the filename in the file Signed-off-by: Stefan Herdler ...
```diff diff --git a/drivers/media/pci/ttpci/budget-av.c b/drivers/media/pci/ttpci/budget-av.c index b9efcd3ccfdb..dbd4ef40e867 100644 --- a/drivers/media/pci/ttpci/budget-av.c +++ b/drivers/media/pci/ttpci/budget-av.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * budget-av.c: driver for the SAA...
a5bc649b1efa14c112ce5081f776af2d4aabdbcf
Analyze and fix the following issue in the Linux kernel code: media: ttpci: coding style fixes: whitespace and newlines
Problem Details: This patch fixes the following checkpatch warnings and errors: ERROR:POINTER_LOCATION: "foo * bar" should be "foo *bar" ERROR:POINTER_LOCATION: "foo* bar" should be "foo *bar" ERROR:SPACING: space prohibited after that open parenthesis '(' ERROR:SPACING: space prohibited before that close parenthesis ...
```diff diff --git a/drivers/media/pci/ttpci/budget-av.c b/drivers/media/pci/ttpci/budget-av.c index a47c5850ef87..72ba9d3c39b5 100644 --- a/drivers/media/pci/ttpci/budget-av.c +++ b/drivers/media/pci/ttpci/budget-av.c @@ -95,12 +95,12 @@ static u8 i2c_readreg(struct i2c_adapter *i2c, u8 id, u8 reg) return mm2[0]; }...
67bdcd499909708195b9408c106b94250955c5ff
Analyze and fix the following issue in the Linux kernel code: docs: describe xfs directory tree online fsck
Problem Details: I've added a scrubber that checks the directory tree structure and fixes them; describe this in the design documentation. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
```diff diff --git a/Documentation/filesystems/xfs/xfs-online-fsck-design.rst b/Documentation/filesystems/xfs/xfs-online-fsck-design.rst index 70e3e629d8b3..12aa63840830 100644 --- a/Documentation/filesystems/xfs/xfs-online-fsck-design.rst +++ b/Documentation/filesystems/xfs/xfs-online-fsck-design.rst @@ -4785,6 +4785,...
b0ffe661fab4b939e4472ef96b8dac3c74e0e03e
Analyze and fix the following issue in the Linux kernel code: xfs: fix performance problems when fstrimming a subset of a fragmented AG
Problem Details: On a 10TB filesystem where the free space in each AG is heavily fragmented, I noticed some very high runtimes on a FITRIM call for the entire filesystem. xfs_scrub likes to report progress information on each phase of the scrub, which means that a strace for the entire filesystem: ioctl(3, FITRIM, {s...
```diff diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c index 268bb734dc0a..25fe3b932b5a 100644 --- a/fs/xfs/xfs_discard.c +++ b/fs/xfs/xfs_discard.c @@ -145,14 +145,18 @@ xfs_discard_extents( return error; } +struct xfs_trim_cur { + xfs_agblock_t start; + xfs_extlen_t count; + xfs_agblock_t end; + xfs_ex...
5f204051d998ec3d7306db0d749bddcbf4c97693
Analyze and fix the following issue in the Linux kernel code: xfs: pin inodes that would otherwise overflow link count
Problem Details: The VFS inc_nlink function does not explicitly check for integer overflows in the i_nlink field. Instead, it checks the link count against s_max_links in the vfs_{link,create,rename} functions. XFS sets the maximum link count to 2.1 billion, so integer overflows should not be a problem. However. It...
```diff diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h index 10153ce116d4..f1818c54af6f 100644 --- a/fs/xfs/libxfs/xfs_format.h +++ b/fs/xfs/libxfs/xfs_format.h @@ -899,6 +899,12 @@ static inline uint xfs_dinode_size(int version) */ #define XFS_MAXLINK ((1U << 31) - 1U) +/* + * Any file that...
40cb8613d6122ca80a9e42e4cecc4d308c3b80fb
Analyze and fix the following issue in the Linux kernel code: xfs: check unused nlink fields in the ondisk inode
Problem Details: v2/v3 inodes use di_nlink and not di_onlink; and v1 inodes use di_onlink and not di_nlink. Whichever field is not in use, make sure its contents are zero, and teach xfs_scrub to fix that if it is. This clears a bunch of missing scrub failure errors in xfs/385 for core.onlink. Signed-off-by: Darrick ...
```diff diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index d0dcce462bf4..d79002343d0b 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -491,6 +491,14 @@ xfs_dinode_verify( return __this_address; } + if (dip->di_version > 1) { + if (dip->di_onlink) ...
cc22edab9ea7f3ebcb61d41a417d4397e9b7b128
Analyze and fix the following issue in the Linux kernel code: xfs: online repair of parent pointers
Problem Details: Teach the online repair code to fix parent pointers for directories. For now, this means correcting the dotdot entry of an existing directory that is otherwise consistent. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
```diff diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile index 3c754777ec28..d48646f86563 100644 --- a/fs/xfs/Makefile +++ b/fs/xfs/Makefile @@ -205,6 +205,7 @@ xfs-y += $(addprefix scrub/, \ inode_repair.o \ newbt.o \ nlinks_repair.o \ + parent_repair.o \ rcbag_btree.o \ ...
629fdaf5f5b1b7f7107ed4de04e0991a99501ced
Analyze and fix the following issue in the Linux kernel code: xfs: use atomic extent swapping to fix user file fork data
Problem Details: Build on the code that was recently added to the temporary repair file code so that we can atomically switch the contents of any file fork, even if the fork is in local format. The upcoming functions to repair xattrs, directories, and symlinks will need that capability. Repair can lock out access to ...
```diff diff --git a/fs/xfs/libxfs/xfs_exchmaps.c b/fs/xfs/libxfs/xfs_exchmaps.c index 3880ae32eecf..44ab6a9235c0 100644 --- a/fs/xfs/libxfs/xfs_exchmaps.c +++ b/fs/xfs/libxfs/xfs_exchmaps.c @@ -675,7 +675,7 @@ xfs_exchmaps_rmapbt_blocks( } /* Estimate the bmbt and rmapbt overhead required to exchange mappings. */ ...
98a778b42514dcd00c0356b2fbfd458636cbff87
Analyze and fix the following issue in the Linux kernel code: xfs: fix error bailout in xrep_abt_build_new_trees
Problem Details: Dan Carpenter reports: "Commit 4bdfd7d15747 ("xfs: repair free space btrees") from Dec 15, 2023 (linux-next), leads to the following Smatch static checker warning: fs/xfs/scrub/alloc_repair.c:781 xrep_abt_build_new_trees() warn: missing unwind goto?" That's a bug, so let's fix it. R...
```diff diff --git a/fs/xfs/scrub/alloc_repair.c b/fs/xfs/scrub/alloc_repair.c index d421b253923e..30295898cc8a 100644 --- a/fs/xfs/scrub/alloc_repair.c +++ b/fs/xfs/scrub/alloc_repair.c @@ -778,7 +778,7 @@ xrep_abt_build_new_trees( error = xrep_bnobt_sort_records(ra); if (error) - return error; + goto err_leve...
21ad2d03641ae70a7acdcf1212cd135dafb2a798
Analyze and fix the following issue in the Linux kernel code: xfs: fix potential AGI <-> ILOCK ABBA deadlock in xrep_dinode_findmode_walk_directory
Problem Details: xfs/399 found the following deadlock when fuzzing core.mode = ones: /proc/20506/task/20558/stack : [<0>] xfs_ilock+0xa0/0x240 [xfs] [<0>] xfs_ilock_data_map_shared+0x1b/0x20 [xfs] [<0>] xrep_dinode_findmode_walk_directory+0x69/0xe0 [xfs] [<0>] xrep_dinode_find_mode+0x103/0x2a0 [xfs] [<0>] xrep_dinode_...
```diff diff --git a/fs/xfs/scrub/inode_repair.c b/fs/xfs/scrub/inode_repair.c index 35da0193c919..097afba3043f 100644 --- a/fs/xfs/scrub/inode_repair.c +++ b/fs/xfs/scrub/inode_repair.c @@ -282,6 +282,51 @@ xrep_dinode_findmode_dirent( return 0; } +/* Try to lock a directory, or wait a jiffy. */ +static inline in...
2afd5276d314d775ae0bdaa6ec22069515bd9c70
Analyze and fix the following issue in the Linux kernel code: xfs: fix an AGI lock acquisition ordering problem in xrep_dinode_findmode
Problem Details: While reviewing the next patch which fixes an ABBA deadlock between the AGI and a directory ILOCK, someone asked a question about why we're holding the AGI in the first place. The reason for that is to quiesce the inode structures for that AG while we do a repair. I then realized that the xrep_dinode...
```diff diff --git a/fs/xfs/scrub/inode_repair.c b/fs/xfs/scrub/inode_repair.c index eab380e95ef4..35da0193c919 100644 --- a/fs/xfs/scrub/inode_repair.c +++ b/fs/xfs/scrub/inode_repair.c @@ -356,6 +356,7 @@ xrep_dinode_find_mode( * so there's a real possibility that _iscan_iter can return EBUSY. */ xchk_iscan_s...
549d3c9a29921f388ef3bcfd1d4f669b7dd4eed2
Analyze and fix the following issue in the Linux kernel code: xfs: pass xfs_buf lookup flags to xfs_*read_agi
Problem Details: Allow callers to pass buffer lookup flags to xfs_read_agi and xfs_ialloc_read_agi. This will be used in the next patch to fix a deadlock in the online fsck inode scanner. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
```diff diff --git a/fs/xfs/libxfs/xfs_ag.c b/fs/xfs/libxfs/xfs_ag.c index dc1873f76bff..09fe9412eab4 100644 --- a/fs/xfs/libxfs/xfs_ag.c +++ b/fs/xfs/libxfs/xfs_ag.c @@ -194,7 +194,7 @@ xfs_initialize_perag_data( pag = xfs_perag_get(mp, index); error = xfs_alloc_read_agf(pag, NULL, 0, NULL); if (!error) - e...
deff401b14e2d832b25b55862ad6c73378fe034e
Analyze and fix the following issue in the Linux kernel code: ARM: configs: sunxi: Enable DRM_DW_HDMI
Problem Details: Commit 4fc8cb47fcfd ("drm/display: Move HDMI helpers into display-helper module") turned the DRM_DW_HDMI dependency of DRM_SUN8I_DW_HDMI into a depends on which ended up disabling the driver in the defconfig. Make sure it's still enabled. Fixes: 4fc8cb47fcfd ("drm/display: Move HDMI helpers into displ...
```diff diff --git a/arch/arm/configs/sunxi_defconfig b/arch/arm/configs/sunxi_defconfig index bddc82f78942..a83d29fed175 100644 --- a/arch/arm/configs/sunxi_defconfig +++ b/arch/arm/configs/sunxi_defconfig @@ -110,6 +110,7 @@ CONFIG_DRM_PANEL_LVDS=y CONFIG_DRM_PANEL_SIMPLE=y CONFIG_DRM_PANEL_EDP=y CONFIG_DRM_SIMPLE...
c60f68047e1996bc1b2fb386d3b383aab8900c1b
Analyze and fix the following issue in the Linux kernel code: clk: sunxi-ng: fix module autoloading
Problem Details: Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table. Clocks are considered core components, so usually they are built-in, however these can be built and used as modules on some generic kernel. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.or...
```diff diff --git a/drivers/clk/sunxi-ng/ccu-sun20i-d1-r.c b/drivers/clk/sunxi-ng/ccu-sun20i-d1-r.c index 9d3ffd3fb2c1..0736f6c81269 100644 --- a/drivers/clk/sunxi-ng/ccu-sun20i-d1-r.c +++ b/drivers/clk/sunxi-ng/ccu-sun20i-d1-r.c @@ -125,6 +125,7 @@ static const struct of_device_id sun20i_d1_r_ccu_ids[] = { { .compa...
5bdeb3d2e240e599a9cb4315a013e3bd5436447d
Analyze and fix the following issue in the Linux kernel code: arm64: dts: allwinner: h616: Fix I2C0 pins
Problem Details: Currently we specify the pins for the I2C0 function as PI6 and PI7, even though they are actually PI5 and PI6. Linux' pinctrl driver and the H616 user manual confirm this. Fix the pin names in the pins property. None of the existing DTs in the tree seems to use I2C0, which explains why this went unnot...
```diff diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi index b2e85e52d1a1..a061b69c07c2 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi @@ -194,7 +194,7 @@ }; i2c0_pins: i2c0-pins { -...
52b1429e0c51a4ebbdf573ad97c7fb6d34f011a2
Analyze and fix the following issue in the Linux kernel code: clk: sunxi-ng: a64: Add constraints on PLL-MIPI's n/m ratio and parent rate
Problem Details: The Allwinner A64 manual lists the following constraints for the PLL-MIPI clock: - M/N <= 3 - (PLL_VIDEO0)/M >= 24MHz Use these constraints. Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Frank Oltmanns <frank@oltmanns.dev> Link: https://lore.kernel.org/r/20240310-pinephone-p...
```diff diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c index 8951ffc14ff5..df679dada792 100644 --- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c +++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c @@ -171,11 +171,13 @@ static struct ccu_nkm pll_mipi_clk = { * user manual, and by experim...
5723879c145255d2502a3f8f3a21a16332b24366
Analyze and fix the following issue in the Linux kernel code: clk: sunxi-ng: nkm: Support constraints on m/n ratio and parent rate
Problem Details: The Allwinner A64 manual lists the following constraints for the PLL-MIPI clock: - M/N <= 3 - (PLL_VIDEO0)/M >= 24MHz The PLL-MIPI clock is implemented as ccu_nkm. Therefore, add support for these constraints. Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Frank Oltmanns <fra...
```diff diff --git a/drivers/clk/sunxi-ng/ccu_nkm.c b/drivers/clk/sunxi-ng/ccu_nkm.c index 853f84398e2b..1168d894d636 100644 --- a/drivers/clk/sunxi-ng/ccu_nkm.c +++ b/drivers/clk/sunxi-ng/ccu_nkm.c @@ -16,6 +16,20 @@ struct _ccu_nkm { unsigned long m, min_m, max_m; }; +static bool ccu_nkm_is_valid_rate(struct ccu...
69f16d9b789821183d342719d2ebd4a5ac7178bc
Analyze and fix the following issue in the Linux kernel code: clk: sunxi-ng: a64: Set minimum and maximum rate for PLL-MIPI
Problem Details: When the Allwinner A64's TCON0 searches the ideal rate for the connected panel, it may happen that it requests a rate from its parent PLL-MIPI which PLL-MIPI does not support. This happens for example on the Olimex TERES-I laptop where TCON0 requests PLL-MIPI to change to a rate of several GHz which c...
```diff diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c index 8951ffc14ff5..6a4b2b9ef30a 100644 --- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c +++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c @@ -182,6 +182,8 @@ static struct ccu_nkm pll_mipi_clk = { &ccu_nkm_ops, ...
b914ec33b391ec766545a41f0cfc0de3e0b388d7
Analyze and fix the following issue in the Linux kernel code: clk: sunxi-ng: common: Support minimum and maximum rate
Problem Details: The Allwinner SoC's typically have an upper and lower limit for their clocks' rates. Up until now, support for that has been implemented separately for each clock type. Implement that functionality in the sunxi-ng's common part making use of the CCF rate liming capabilities, so that it is available fo...
```diff diff --git a/drivers/clk/sunxi-ng/ccu_common.c b/drivers/clk/sunxi-ng/ccu_common.c index 8babce55302f..ac0091b4ce24 100644 --- a/drivers/clk/sunxi-ng/ccu_common.c +++ b/drivers/clk/sunxi-ng/ccu_common.c @@ -44,6 +44,16 @@ bool ccu_is_better_rate(struct ccu_common *common, unsigned long current_rate, uns...
1428f0c19f9ce06c33f79fff783788444f27ac31
Analyze and fix the following issue in the Linux kernel code: arm64: dts: allwinner: a64: Run GPU at 432 MHz
Problem Details: The Allwinner A64's GPU has currently three operating points. However, the BSP runs the GPU fixed at 432 MHz. In addition, at least one of the devices using that SoC - the pinephone - shows unstabilities (see link) that can be circumvented by running the GPU at a fixed rate. Therefore, remove the othe...
```diff diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index 7b01f68cf7f0..ce4aa44c3353 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -107,14 +107,6 @@ gpu_opp_table: opp-table-gpu { comp...
67347f893aec8c0c5a3eed8929d39c528371b357
Analyze and fix the following issue in the Linux kernel code: arm64: dts: allwinner: Pine H64: correctly remove reg_gmac_3v3
Problem Details: There is no "reg_gmac_3v3" device node in sun50i-h6-pine-h64.dts, although there is "gmac-3v3" with "reg_gmac_3v3" label, so let's assume author wanted to remove that node. Delete node via phandle, not via full node path, to fix this. Fixes: f33a91175029 ("arm64: dts: allwinner: add pineh64 model B")...
```diff diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts index b710f1a0f53a..1b6e5595ac6e 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts @...
7e91ed763dc07437777bd012af7a2bd4493731ff
Analyze and fix the following issue in the Linux kernel code: clk: sunxi-ng: h6: Reparent CPUX during PLL CPUX rate change
Problem Details: While PLL CPUX clock rate change when CPU is running from it works in vast majority of cases, now and then it causes instability. This leads to system crashes and other undefined behaviour. After a lot of testing (30+ hours) while also doing a lot of frequency switches, we can't observe any instability...
```diff diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c index 42568c616181..892df807275c 100644 --- a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c +++ b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c @@ -1181,11 +1181,18 @@ static const u32 usb2_clk_regs[] = { SUN50I_H6_USB3_CLK_REG, }; +sta...
5f36d1ce4df25eebc663c1996d7c73aedfb309e6
Analyze and fix the following issue in the Linux kernel code: drm/xe/gt: Add L3 bank mask to GT topology
Problem Details: Generate the mask of enabled L3 banks for the GT. It is stored with the rest of the GT topology in a consistent representation across platforms. For now the L3 bank mask is just printed in the log for developers to easily figure out the fusing characteristics of machines that they are trying to debug i...
```diff diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h b/drivers/gpu/drm/xe/regs/xe_gt_regs.h index 8fe811ea404a..94445810ccc9 100644 --- a/drivers/gpu/drm/xe/regs/xe_gt_regs.h +++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h @@ -165,7 +165,10 @@ #define MIRROR_FUSE3 XE_REG(0x9118) #define XE2_NODE_ENABLE_MASK RE...
7c98f7cb8fda964fbc60b9307ad35e94735fa35f
Analyze and fix the following issue in the Linux kernel code: remove call_{read,write}_iter() functions
Problem Details: These have no clear purpose. This is effectively a revert of commit bb7462b6fd64 ("vfs: use helpers for calling f_op->{read,write}_iter()"). The patch was created with the help of a coccinelle script. Fixes: bb7462b6fd64 ("vfs: use helpers for calling f_op->{read,write}_iter()") Reviewed-by: Christi...
```diff diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 28a95fd366fe..93780f41646b 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -445,9 +445,9 @@ static int lo_rw_aio(struct loop_device *lo, struct loop_cmd *cmd, cmd->iocb.ki_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 0); if (r...
c4ce0ab27646f4206a9eb502d6fe45cb080e1cae
Analyze and fix the following issue in the Linux kernel code: io_uring/sqpoll: work around a potential audit memory leak
Problem Details: kmemleak complains that there's a memory leak related to connect handling: unreferenced object 0xffff0001093bdf00 (size 128): comm "iou-sqp-455", pid 457, jiffies 4294894164 hex dump (first 32 bytes): 02 00 fa ea 7f 00 00 01 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00...
```diff diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c index 3983708cef5b..554c7212aa46 100644 --- a/io_uring/sqpoll.c +++ b/io_uring/sqpoll.c @@ -291,6 +291,14 @@ static int io_sq_thread(void *data) sqd->sq_cpu = raw_smp_processor_id(); } + /* + * Force audit context to get setup, in case we do prep side a...
bf52d7f9b2067f02efe7e32697479097aba4a055
Analyze and fix the following issue in the Linux kernel code: drm/nouveau/dp: Don't probe eDP ports twice harder
Problem Details: I didn't pay close enough attention the last time I tried to fix this problem - while we currently do correctly take care to make sure we don't probe a connected eDP port more then once, we don't do the same thing for eDP ports we found to be disconnected. So, fix this and make sure we only ever probe...
```diff diff --git a/drivers/gpu/drm/nouveau/nouveau_dp.c b/drivers/gpu/drm/nouveau/nouveau_dp.c index 3f6ccce20ea0..a72c45809484 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dp.c +++ b/drivers/gpu/drm/nouveau/nouveau_dp.c @@ -225,12 +225,15 @@ nouveau_dp_detect(struct nouveau_connector *nv_connector, u8 *dpcd = nv_e...
ee7e980dc7c9f22c142807c5f582a6524138f57a
Analyze and fix the following issue in the Linux kernel code: drm/nouveau/kms/nv50-: Disable AUX bus for disconnected DP ports
Problem Details: GSP has its own state for keeping track of whether or not a given display connector is plugged in or not, and enforces this state on the driver. In particular, AUX transactions on a DisplayPort connector which GSP says is disconnected can never succeed - and can in some cases even cause unexpected time...
```diff diff --git a/drivers/gpu/drm/nouveau/nouveau_dp.c b/drivers/gpu/drm/nouveau/nouveau_dp.c index 7de7707ec6a8..3f6ccce20ea0 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dp.c +++ b/drivers/gpu/drm/nouveau/nouveau_dp.c @@ -232,6 +232,9 @@ nouveau_dp_detect(struct nouveau_connector *nv_connector, dpcd[DP_DPCD_...
4854b463c4b27c94a7de86d16ad84f235f4c1a72
Analyze and fix the following issue in the Linux kernel code: net: dql: Avoid calling BUG() when WARN() is enough
Problem Details: If the dql_queued() function receives an invalid argument, WARN about it and continue, instead of crashing the kernel. This was raised by checkpatch, when I am refactoring this code (see following patch/commit) WARNING: Do not crash the kernel unless it is absolutely unavoidable--use WARN_ON_ONCE() ...
```diff diff --git a/include/linux/dynamic_queue_limits.h b/include/linux/dynamic_queue_limits.h index 5693a4be0d9a..ff9c65841ae8 100644 --- a/include/linux/dynamic_queue_limits.h +++ b/include/linux/dynamic_queue_limits.h @@ -91,7 +91,8 @@ static inline void dql_queued(struct dql *dql, unsigned int count) { unsigne...
7fcb91d94e897413c0345bb32ea11293f33efbb1
Analyze and fix the following issue in the Linux kernel code: configs/hardening: Disable CONFIG_UBSAN_SIGNED_WRAP
Problem Details: kernel/configs/hardening.config turns on UBSAN for the bounds sanitizer, as that in combination with trapping can stop the exploitation of buffer overflows within the kernel. At the same time, hardening.config turns off every other UBSAN sanitizer because trapping means all UBSAN reports will be fatal ...
```diff diff --git a/kernel/configs/hardening.config b/kernel/configs/hardening.config index d6f6dc45628a..4b4cfcba3190 100644 --- a/kernel/configs/hardening.config +++ b/kernel/configs/hardening.config @@ -41,6 +41,7 @@ CONFIG_UBSAN_BOUNDS=y # CONFIG_UBSAN_SHIFT is not set # CONFIG_UBSAN_DIV_ZERO is not set # CONFI...
e048d668f2969cf2b76e0fa21882a1b3bb323eca
Analyze and fix the following issue in the Linux kernel code: configs/hardening: Fix disabling UBSAN configurations
Problem Details: The initial change that added kernel/configs/hardening.config attempted to disable all UBSAN sanitizers except for the array bounds one while turning on UBSAN_TRAP. Unfortunately, it only got the syntax for CONFIG_UBSAN_SHIFT correct, so configurations that are on by default with CONFIG_UBSAN=y such as...
```diff diff --git a/kernel/configs/hardening.config b/kernel/configs/hardening.config index 7a5bbfc024b7..d6f6dc45628a 100644 --- a/kernel/configs/hardening.config +++ b/kernel/configs/hardening.config @@ -39,11 +39,11 @@ CONFIG_UBSAN=y CONFIG_UBSAN_TRAP=y CONFIG_UBSAN_BOUNDS=y # CONFIG_UBSAN_SHIFT is not set -# CO...
35f4f8c9fc972248055096d63b782060e473311b
Analyze and fix the following issue in the Linux kernel code: drm/v3d: Don't increment `enabled_ns` twice
Problem Details: The commit 509433d8146c ("drm/v3d: Expose the total GPU usage stats on sysfs") introduced the calculation of global GPU stats. For the regards, it used the already existing infrastructure provided by commit 09a93cc4f7d1 ("drm/v3d: Implement show_fdinfo() callback for GPU usage stats"). While adding glo...
```diff diff --git a/drivers/gpu/drm/v3d/v3d_irq.c b/drivers/gpu/drm/v3d/v3d_irq.c index 2e04f6cb661e..ce6b2fb341d1 100644 --- a/drivers/gpu/drm/v3d/v3d_irq.c +++ b/drivers/gpu/drm/v3d/v3d_irq.c @@ -105,7 +105,6 @@ v3d_irq(int irq, void *arg) struct v3d_file_priv *file = v3d->bin_job->base.file->driver_priv; u64 ...
3758f7d9917bd7ef0482c4184c0ad673b4c4e069
Analyze and fix the following issue in the Linux kernel code: rcu: Fix buffer overflow in print_cpu_stall_info()
Problem Details: The rcuc-starvation output from print_cpu_stall_info() might overflow the buffer if there is a huge difference in jiffies difference. The situation might seem improbable, but computers sometimes get very confused about time, which can result in full-sized integers, and, in this case, buffer overflow. ...
```diff diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h index 8a2edf6a1ef5..460efecd077b 100644 --- a/kernel/rcu/tree_stall.h +++ b/kernel/rcu/tree_stall.h @@ -504,7 +504,8 @@ static void print_cpu_stall_info(int cpu) rcu_dynticks_in_eqs(rcu_dynticks_snap(cpu)); rcuc_starved = rcu_is_rcuc_kthread_s...
cc5645fddb0ce28492b15520306d092730dffa48
Analyze and fix the following issue in the Linux kernel code: rcu-tasks: Fix show_rcu_tasks_trace_gp_kthread buffer overflow
Problem Details: There is a possibility of buffer overflow in show_rcu_tasks_trace_gp_kthread() if counters, passed to sprintf() are huge. Counter numbers, needed for this are unrealistically high, but buffer overflow is still possible. Use snprintf() with buffer size instead of sprintf(). Found by Linux Verification...
```diff diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index d5319bbe8c98..08a92bffeb84 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -1997,7 +1997,7 @@ void show_rcu_tasks_trace_gp_kthread(void) { char buf[64]; - sprintf(buf, "N%lu h:%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "N%lu h:%lu/%lu/%...
5f48fa85fdb92569f58374b6e040c956628fdcf5
Analyze and fix the following issue in the Linux kernel code: rcu-tasks: Fix the comments for tasks_rcu_exit_srcu_stall_timer
Problem Details: The synchronize_srcu() has been removed by commit("rcu-tasks: Eliminate deadlocks involving do_exit() and RCU tasks") in rcu_tasks_postscan. This commit therefore fixes the tasks_rcu_exit_srcu_stall_timer comment. Signed-off-by: Zqiang <qiang.zhang1211@gmail.com> Signed-off-by: Paul E. McKenney <paulm...
```diff diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index 78d74c81cc24..d5319bbe8c98 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -150,7 +150,7 @@ static struct rcu_tasks rt_name = \ #ifdef CONFIG_TASKS_RCU -/* Report delay in synchronize_srcu() completion in rcu_tasks_postscan(). */ ...
3078e059a5e984663c5c2b04485375c84c2700f9
Analyze and fix the following issue in the Linux kernel code: bcachefs: fix error path of __bch2_read_super()
Problem Details: In __bch2_read_super(), if kstrdup() fails, it needs to release memory in sb->holder, fix to call bch2_free_super() in the error path. Signed-off-by: Chao Yu <chao@kernel.org> Reviewed-by: Hongbo Li <lihongbo22@huawei.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/super-io.c b/fs/bcachefs/super-io.c index e0aa3655b63b..648986a7dbde 100644 --- a/fs/bcachefs/super-io.c +++ b/fs/bcachefs/super-io.c @@ -700,8 +700,11 @@ retry: return -ENOMEM; sb->sb_name = kstrdup(path, GFP_KERNEL); - if (!sb->sb_name) - return -ENOMEM; + if (!sb->sb_name) { ...
d894ea562f7ac908bf848bf15e1cfab503da71a9
Analyze and fix the following issue in the Linux kernel code: drm/fb_dma: s/drm_panic_gem_get_scanout_buffer/drm_fb_dma_get_scanout_buffer
Problem Details: On version 11 of the "drm/panic: Add a drm panic handler" series [1], Thomas suggested to change the name of the function `drm_panic_gem_get_scanout_buffer` to `drm_fb_dma_get_scanout_buffer` and this request was applied on version 12, which is the version that landed [2]. Although the name of the func...
```diff diff --git a/include/drm/drm_fb_dma_helper.h b/include/drm/drm_fb_dma_helper.h index 61f24c2aba2f..c950732c6d36 100644 --- a/include/drm/drm_fb_dma_helper.h +++ b/include/drm/drm_fb_dma_helper.h @@ -6,6 +6,7 @@ struct drm_device; struct drm_framebuffer; +struct drm_plane; struct drm_plane_state; struct dr...
015a12a4a6708d9cadcaea8334e270747923394c
Analyze and fix the following issue in the Linux kernel code: arm64/hugetlb: Fix page table walk in huge_pte_alloc()
Problem Details: Currently normal HugeTLB fault ends up crashing the kernel, as p4dp derived from p4d_offset() is an invalid address when PGTABLE_LEVEL = 5. A p4d level entry needs to be allocated when not available while walking the page table during HugeTLB faults. Let's call p4d_alloc() to allocate such entries when...
```diff diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index 0f0e10bb0a95..b872b003a55f 100644 --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c @@ -276,7 +276,10 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, pte_t *ptep = NULL; pgdp = pgd_off...
d4c972bff3129a9dd4c22a3999fd8eba1a81531a
Analyze and fix the following issue in the Linux kernel code: drm/vmwgfx: Sort primary plane formats by order of preference
Problem Details: The table of primary plane formats wasn't sorted at all, leading to applications picking our least desirable formats by defaults. Sort the primary plane formats according to our order of preference. Nice side-effect of this change is that it makes IGT's kms_atomic plane-invalid-params pass because th...
```diff diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h index a94947b588e8..19a843da87b7 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h @@ -243,10 +243,10 @@ struct vmw_framebuffer_bo { static const uint32_t __maybe_unused vmw_prima...
a60ccade88f926e871a57176e86a34bbf0db0098
Analyze and fix the following issue in the Linux kernel code: drm/vmwgfx: Fix crtc's atomic check conditional
Problem Details: The conditional was supposed to prevent enabling of a crtc state without a set primary plane. Accidently it also prevented disabling crtc state with a set primary plane. Neither is correct. Fix the conditional and just driver-warn when a crtc state has been enabled without a primary plane which will h...
```diff diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index cd4925346ed4..84ae4e10a2eb 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -933,6 +933,7 @@ int vmw_du_cursor_plane_atomic_check(struct drm_plane *plane, int vmw_du_crtc_at...
b32233accefff1338806f064fb9b62cf5bc0609f
Analyze and fix the following issue in the Linux kernel code: drm/vmwgfx: Fix prime import/export
Problem Details: vmwgfx never supported prime import of external buffers. Furthermore the driver exposes two different objects to userspace: vmw_surface's and gem buffers but prime import/export only worked with vmw_surfaces. Because gem buffers are used through the dumb_buffer interface this meant that the driver cre...
```diff diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c b/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c index c52c7bf1485b..717d624e9a05 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c @@ -456,8 +456,10 @@ int vmw_bo_cpu_blit(struct ttm_buffer_object *dst, .no_wait_gpu = false ...
a421835a2a327f2b3472dcb755adb57d0f82e478
Analyze and fix the following issue in the Linux kernel code: docs: verify/bisect: explain testing reverts, patches and newer code
Problem Details: Rename 'Supplementary tasks' to 'Complementary tasks' while introducing a section 'Optional tasks: test reverts, patches, or later versions': the latter is something readers occasionally will have to do after reporting a bug and thus is best covered here. Signed-off-by: Thorsten Leemhuis <linux@leemhu...
```diff diff --git a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst index 355c2cea5230..1987c827211f 100644 --- a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst +++ b/Documentation/admin-guide/verify-bugs-and-bisect-r...
453de3207ff3534dd7165a32a73dd28cc9e8f14f
Analyze and fix the following issue in the Linux kernel code: docs: verify/bisect: proper headlines and more spacing
Problem Details: Various small improvements and fixes: * Separate ref links from their target with a space for better readability. * Add a proper heading for the note at the end of the step-by-step guide. * Use proper 3rd and 4th level headlines in the reference section and add short intros for the 2nd level h...
```diff diff --git a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst index 06278501a4bd..355c2cea5230 100644 --- a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst +++ b/Documentation/admin-guide/verify-bugs-and-bisect-r...
932c9a5398a7b41cb8e7a0264e5470133b373e11
Analyze and fix the following issue in the Linux kernel code: docs: verify/bisect: add and fetch stable branches ahead of time
Problem Details: Add and fetch all required stable branches ahead of time. This fixes a bug, as readers that wanted to bisect a regression within a stable or longterm series otherwise did not have them available at the right time. This way also matches the flow somewhat better and avoids some "if you haven't already ad...
```diff diff --git a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst index c999e40c79ab..06278501a4bd 100644 --- a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst +++ b/Documentation/admin-guide/verify-bugs-and-bisect-r...
abbb99301e9d2c91567e1893dbe34f2f8b52ea9a
Analyze and fix the following issue in the Linux kernel code: docs: verify/bisect: use git switch, tag kernel, and various fixes
Problem Details: Various small improvements and fixes: * Use the more modern 'git switch' instead of 'git checkout', which makes it more obvious what's happening (among others due to the --discard-changes parameter that is more clear than --force). * Provide a hint how a mainline version number and one from a sta...
```diff diff --git a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst index d3504826f401..c999e40c79ab 100644 --- a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst +++ b/Documentation/admin-guide/verify-bugs-and-bisect-r...
fb7c3d8ba039df877886fd457538d8b24ca9c84b
Analyze and fix the following issue in the Linux kernel code: dt-bindings: pwm: mediatek,pwm-disp: Document power-domains property
Problem Details: Allow the power-domains property to the PWM_DISP block as on some SoCs this does need at most one power domain. Fixes: b09b179bac0a ("dt-bindings: pwm: Convert pwm-mtk-disp.txt to mediatek,pwm-disp.yaml format") Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Acked-...
```diff diff --git a/Documentation/devicetree/bindings/pwm/mediatek,pwm-disp.yaml b/Documentation/devicetree/bindings/pwm/mediatek,pwm-disp.yaml index afcdeed4e88a..bc813fe74fab 100644 --- a/Documentation/devicetree/bindings/pwm/mediatek,pwm-disp.yaml +++ b/Documentation/devicetree/bindings/pwm/mediatek,pwm-disp.yaml @...
a2ac1cbc5397eb4e400efa66c3337886d9a63026
Analyze and fix the following issue in the Linux kernel code: pwm: dwc: allow suspend/resume for 16 channels
Problem Details: With 16 channel pwm support, we're registering two instances of pwm_chip with 8 channels each. We need to update PM functions to use both instances of pwm_chip during power state transitions. Introduce struct dwc_pwm_drvdata and use it as driver_data, which will maintain both instances of pwm_chip alo...
```diff diff --git a/drivers/pwm/pwm-dwc-core.c b/drivers/pwm/pwm-dwc-core.c index 043736972cb9..c8425493b95d 100644 --- a/drivers/pwm/pwm-dwc-core.c +++ b/drivers/pwm/pwm-dwc-core.c @@ -172,7 +172,6 @@ struct pwm_chip *dwc_pwm_alloc(struct device *dev) dwc->clk_ns = 10; chip->ops = &dwc_pwm_ops; - dev_set_drvdat...
e0503d47e93dead8c0475ea1eb624e03fada21d3
Analyze and fix the following issue in the Linux kernel code: riscv: dts: starfive: visionfive 2: Remove non-existing I2S hardware
Problem Details: This partially reverts commit 92cfc35838b2 ("riscv: dts: starfive: Add the nodes and pins of I2Srx/I2Stx0/I2Stx1") This added device tree nodes for I2S hardware that is not actually on the VisionFive 2 board, but connected on the 40pin header. Many different extension boards could be added on those pi...
```diff diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi index 58f892f984a4..ccd0ce55aa53 100644 --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-...
dcde4e97b122ac318aaa71e8bcd2857dc28a0d12
Analyze and fix the following issue in the Linux kernel code: riscv: dts: starfive: visionfive 2: Remove non-existing TDM hardware
Problem Details: This partially reverts commit e7c304c0346d ("riscv: dts: starfive: jh7110: add the node and pins configuration for tdm") This added device tree nodes for TDM hardware that is not actually on the VisionFive 2 board, but connected on the 40pin header. Many different extension boards could be added on th...
```diff diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi index 7783d464d529..58f892f984a4 100644 --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-...
b6976f323a8687cc0d55bc92c2086fd934324ed5
Analyze and fix the following issue in the Linux kernel code: drm/ttm: stop pooling cached NUMA pages v2
Problem Details: We only pool write combined and uncached allocations because they require extra overhead on allocation and release. If we also pool cached NUMA it not only means some extra unnecessary overhead, but also that under memory pressure it can happen that pages from the wrong NUMA node enters the pool and a...
```diff diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c index 112438d965ff..6e1fd6985ffc 100644 --- a/drivers/gpu/drm/ttm/ttm_pool.c +++ b/drivers/gpu/drm/ttm/ttm_pool.c @@ -288,17 +288,23 @@ static struct ttm_pool_type *ttm_pool_select_type(struct ttm_pool *pool, enum ttm_caching ...
4dc70e1aadfadf968676d983587c6f5d455aba85
Analyze and fix the following issue in the Linux kernel code: openrisc: Move FPU state out of pt_regs
Problem Details: My original, naive, FPU support patch had the FPCSR register stored during both the *mode switch* and *context switch*. This is wasteful. Also, the original patches did not save the FPU state when handling signals during the system call fast path. We fix this by moving the FPCSR state to thread_stru...
```diff diff --git a/arch/openrisc/include/asm/fpu.h b/arch/openrisc/include/asm/fpu.h new file mode 100644 index 000000000000..57bc44d80d53 --- /dev/null +++ b/arch/openrisc/include/asm/fpu.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_OPENRISC_FPU_H +#define __ASM_OPENRISC_FPU_H + +struct ...
c88cfb5cea5f8f9868ef02cc9ce9183a26dcf20f
Analyze and fix the following issue in the Linux kernel code: openrisc: traps: Don't send signals to kernel mode threads
Problem Details: OpenRISC exception handling sends signals to user processes on floating point exceptions and trap instructions (for debugging) among others. There is a bug where the trap handling logic may send signals to kernel threads, we should not send these signals to kernel threads, if that happens we treat it a...
```diff diff --git a/arch/openrisc/kernel/traps.c b/arch/openrisc/kernel/traps.c index 88fe27e4c10c..211ddaa0c5fa 100644 --- a/arch/openrisc/kernel/traps.c +++ b/arch/openrisc/kernel/traps.c @@ -180,29 +180,39 @@ asmlinkage void unhandled_exception(struct pt_regs *regs, int ea, int vector) asmlinkage void do_fpe_tra...
c94195a34e09dacfe2feef03602c911e82f49994
Analyze and fix the following issue in the Linux kernel code: openrisc: Use do_kernel_power_off()
Problem Details: After commit 14c5678720bd ("power: reset: syscon-poweroff: Use devm_register_sys_off_handler(POWER_OFF)") setting up of pm_power_off was removed from the driver, this causes OpenRISC platforms using syscon-poweroff to no longer shutdown. The kernel now supports chained power-off handlers. Use do_kerne...
```diff diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c index 86e02929f3ac..3c27d1c72718 100644 --- a/arch/openrisc/kernel/process.c +++ b/arch/openrisc/kernel/process.c @@ -65,7 +65,7 @@ void machine_restart(char *cmd) } /* - * This is used if pm_power_off has not been set by a power m...
813ca3aa8fecaca9cf81f831d2e036d997ac3ee7
Analyze and fix the following issue in the Linux kernel code: drm/panic: Add debugfs entry to test without triggering panic.
Problem Details: Add a debugfs file, so you can test drm_panic without freezing your machine. This is unsafe, and should be enabled only for developer or tester. To display the drm_panic screen on the device 0: echo 1 > /sys/kernel/debug/dri/0/drm_panic_plane_0 v9: * Create a debugfs file for each plane in the devic...
```diff diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index f8a26423369e..959b19a04101 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -127,6 +127,15 @@ config DRM_PANIC_BACKGROUND_COLOR depends on DRM_PANIC default 0x000000 +config DRM_PANIC_DEBUG + bool "Add a debug fs ent...
bf9fb17c6672868d95126321762c8fdfe0ff0a2a
Analyze and fix the following issue in the Linux kernel code: drm/panic: Add a drm panic handler
Problem Details: This module displays a user friendly message when a kernel panic occurs. It currently doesn't contain any debug information, but that can be added later. v2 * Use get_scanout_buffer() instead of the drm client API. (Thomas Zimmermann) * Add the panic reason to the panic message (Nerdopolis) * Add...
```diff diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst index b98b98359c90..abfe220764e1 100644 --- a/Documentation/gpu/drm-kms.rst +++ b/Documentation/gpu/drm-kms.rst @@ -398,6 +398,21 @@ Plane Damage Tracking Functions Reference .. kernel-doc:: include/drm/drm_damage_helper.h :internal...
e2a1cda3e0c784740751d46431973dcee32cf108
Analyze and fix the following issue in the Linux kernel code: drm/panic: Add drm panic locking
Problem Details: Rough sketch for the locking of drm panic printing code. The upshot of this approach is that we can pretty much entirely rely on the atomic commit flow, with the pair of raw_spin_lock/unlock providing any barriers we need, without having to create really big critical sections in code. This also avoids...
```diff diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 39ef0a6addeb..fb97b51b38f1 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -38,6 +38,7 @@ #include <drm/drm_drv.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_...
686b56cbeedc9f4c72f9bb781918194a9a3e8334
Analyze and fix the following issue in the Linux kernel code: io_uring: ensure overflow entries are dropped when ring is exiting
Problem Details: A previous consolidation cleanup missed handling the case where the ring is dying, and __io_cqring_overflow_flush() doesn't flush entries if the CQ ring is already full. This is fine for the normal CQE overflow flushing, but if the ring is going away, we need to flush everything, even if it means simpl...
```diff diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index c4419eef7e63..3c9087f37c43 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -674,7 +674,8 @@ static void __io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool dying) lockdep_assert_held(&ctx->uring_lock); - if (__io_cqring_events...
6b231248e97fc37d4205449d48747b5a3b4c2fcc
Analyze and fix the following issue in the Linux kernel code: io_uring: consolidate overflow flushing
Problem Details: Consolidate __io_cqring_overflow_flush and io_cqring_overflow_kill() into a single function as it once was, it's easier to work with it this way. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/986b42c35e76a6be7aa0cdcda0a236a2222da3a7.1712708261.git.asml.silence@...
```diff diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 92ac9c0fc597..c4419eef7e63 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -668,26 +668,7 @@ static void io_cq_unlock_post(struct io_ring_ctx *ctx) io_commit_cqring_flush(ctx); } -static void io_cqring_overflow_kill(struct io_ring_c...
8d09a88ef9d3cb7d21d45c39b7b7c31298d23998
Analyze and fix the following issue in the Linux kernel code: io_uring: always lock __io_cqring_overflow_flush
Problem Details: Conditional locking is never great, in case of __io_cqring_overflow_flush(), which is a slow path, it's not justified. Don't handle IOPOLL separately, always grab uring_lock for overflow flushing. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/162947df299aa12693...
```diff diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 740bfec10fde..92ac9c0fc597 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -673,6 +673,8 @@ static void io_cqring_overflow_kill(struct io_ring_ctx *ctx) struct io_overflow_cqe *ocqe; LIST_HEAD(list); + lockdep_assert_held(&ctx->uri...
408024b959275ba52c233c647901cacfc8d5a226
Analyze and fix the following issue in the Linux kernel code: io_uring: open code io_cqring_overflow_flush()
Problem Details: There is only one caller of io_cqring_overflow_flush(), open code it Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/a1fecd56d9dba923ed8d4d159727fa939d3baa2a.1712708261.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
```diff diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 885f701983d7..740bfec10fde 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -726,12 +726,6 @@ static void io_cqring_do_overflow_flush(struct io_ring_ctx *ctx) mutex_unlock(&ctx->uring_lock); } -static void io_cqring_overflow_flush(s...
e45ec969d17acb0a1bea78c9c6c4403fceccd599
Analyze and fix the following issue in the Linux kernel code: io_uring: remove extra SQPOLL overflow flush
Problem Details: c1edbf5f081be ("io_uring: flag SQPOLL busy condition to userspace") added an extra overflowed CQE flush in the SQPOLL submission path due to backpressure, which was later removed. Remove the flush and let io_cqring_wait() / iopoll handle it. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link:...
```diff diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 454d1d7695f6..885f701983d7 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -3238,8 +3238,6 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit, */ ret = 0; if (ctx->flags & IORING_SETUP_SQPOLL) { - io_cqring_overf...
a5bff51850c8d533f3696d45749ab169dd49f8dd
Analyze and fix the following issue in the Linux kernel code: io_uring: unexport io_req_cqe_overflow()
Problem Details: There are no users of io_req_cqe_overflow() apart from io_uring.c, make it static. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/f4295eb2f9eb98d5db38c0578f57f0b86bfe0d8c.1712708261.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
```diff diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index b7984442dd84..454d1d7695f6 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -819,7 +819,7 @@ static bool io_cqring_event_overflow(struct io_ring_ctx *ctx, u64 user_data, return true; } -void io_req_cqe_overflow(struct io_kiocb *req) ...
1da2f311ba53a1ee106a637cf17aba05d2acc1ff
Analyze and fix the following issue in the Linux kernel code: io_uring: fix warnings on shadow variables
Problem Details: There are a few of those: io_uring/fdinfo.c:170:16: warning: declaration shadows a local variable [-Wshadow] 170 | struct file *f = io_file_from_index(&ctx->file_table, i); | ^ io_uring/fdinfo.c:53:67: note: previous declaration is here 53 | __co...
```diff diff --git a/io_uring/cancel.c b/io_uring/cancel.c index acfcdd7f059a..a6e58a20efdd 100644 --- a/io_uring/cancel.c +++ b/io_uring/cancel.c @@ -184,9 +184,7 @@ static int __io_async_cancel(struct io_cancel_data *cd, io_ring_submit_lock(ctx, issue_flags); ret = -ENOENT; list_for_each_entry(node, &ctx->tctx_...
87585b05757dc70545efb434669708d276125559
Analyze and fix the following issue in the Linux kernel code: io_uring/kbuf: use vm_insert_pages() for mmap'ed pbuf ring
Problem Details: Rather than use remap_pfn_range() for this and manually free later, switch to using vm_insert_page() and have it Just Work. This requires a bit of effort on the mmap lookup side, as the ctx uring_lock isn't held, which otherwise protects buffer_lists from being torn down, and it's not safe to grab fr...
```diff diff --git a/include/linux/io_uring_types.h b/include/linux/io_uring_types.h index ef45b8bd1b35..d34c8433caf9 100644 --- a/include/linux/io_uring_types.h +++ b/include/linux/io_uring_types.h @@ -372,9 +372,6 @@ struct io_ring_ctx { struct list_head io_buffers_cache; - /* deferred free list, protected by -...
22537c9f79417fed70b352d54d01d2586fee9521
Analyze and fix the following issue in the Linux kernel code: io_uring: use the right type for work_llist empty check
Problem Details: io_task_work_pending() uses wq_list_empty() on ctx->work_llist, but it's not an io_wq_work_list, it's a struct llist_head. They both have ->first as head-of-list, and it turns out the checks are identical. But be proper and use the right helper. Fixes: dac6a0eae793 ("io_uring: ensure iopoll runs local...
```diff diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h index 7654dfb34c2e..dbd9a2b870eb 100644 --- a/io_uring/io_uring.h +++ b/io_uring/io_uring.h @@ -340,7 +340,7 @@ static inline int io_run_task_work(void) static inline bool io_task_work_pending(struct io_ring_ctx *ctx) { - return task_work_pending(curren...
4e9706c6c8d1b159e2d04bee60189a1361f5afa9
Analyze and fix the following issue in the Linux kernel code: io_uring: Remove unused function
Problem Details: The function are defined in the io_uring.c file, but not called elsewhere, so delete the unused function. io_uring/io_uring.c:646:20: warning: unused function '__io_cq_unlock'. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8660 Signed-off-by...
```diff diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 8489f1820ad9..0bee0ee5c7b2 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -643,12 +643,6 @@ static inline void __io_cq_lock(struct io_ring_ctx *ctx) spin_lock(&ctx->completion_lock); } -static inline void __io_cq_unlock(struct io_...
e1eef2e56cb0db143c731b1cdc220980256d2d99
Analyze and fix the following issue in the Linux kernel code: io_uring/cmd: fix tw <-> issue_flags conversion
Problem Details: !IO_URING_F_UNLOCKED does not translate to availability of the deferred completion infra, IO_URING_F_COMPLETE_DEFER does, that what we should pass and look for to use io_req_complete_defer() and other variants. Luckily, it's not a real problem as two wrongs actually made it right, at least as far as i...
```diff diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c index 7c1c58c5837e..759f919b14a9 100644 --- a/io_uring/uring_cmd.c +++ b/io_uring/uring_cmd.c @@ -36,7 +36,8 @@ bool io_uring_try_cancel_uring_cmd(struct io_ring_ctx *ctx, /* ->sqe isn't available if no async data */ if (!req_has_async_data(req)) ...
2dc77993cb5eb311d6bb5584d30c3d1d42d9fa4a
Analyze and fix the following issue in the Linux kernel code: platform/x86/amd/pmc: Add AMD MP2 STB functionality
Problem Details: AMD MP2 STB function provides a data buffer used to log debug information about the system execution during S2Idle suspend/resume. A data buffer known as the STB (Smart Trace Buffer) is a circular buffer which is a low-level log to assist in debugging by providing insights into any potential hangs or ...
```diff diff --git a/drivers/platform/x86/amd/pmc/Kconfig b/drivers/platform/x86/amd/pmc/Kconfig index 883c0a95ac0c..94f9563d8be7 100644 --- a/drivers/platform/x86/amd/pmc/Kconfig +++ b/drivers/platform/x86/amd/pmc/Kconfig @@ -18,3 +18,18 @@ config AMD_PMC If you choose to compile this driver as a module the modu...
40b0f17453fca50165c9d56401be663448e9136c
Analyze and fix the following issue in the Linux kernel code: of: Use scope based kfree() cleanups
Problem Details: Use the relatively new scope based kfree() cleanup to simplify error handling. Doing so reduces the chances of memory leaks and simplifies error paths by avoiding the need for goto statements. Reviewed-by: Saravana Kannan <saravanak@google.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.co...
```diff diff --git a/drivers/of/base.c b/drivers/of/base.c index 8856c67c466a..20603d3c9931 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -16,6 +16,7 @@ #define pr_fmt(fmt) "OF: " fmt +#include <linux/cleanup.h> #include <linux/console.h> #include <linux/ctype.h> #include <linux/cpu.h> @@ -1393,8 +1...
96a91515465491290497dd6c862323fd94dfd20d
Analyze and fix the following issue in the Linux kernel code: drm: prefer DRM_MODE_FMT/ARG over drm_mode_debug_printmodeline()
Problem Details: We have DRM_MODE_FMT and DRM_MODE_ARG() macros to allow unified debug printing of modes in any printk-formatted logging. Prefer them over drm_mode_debug_printmodeline(). This allows drm device specific logging of modes, in the right drm debug category, and inline with the rest of the logging instead o...
```diff diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index 29d4940188d4..fc16fddee5c5 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -145,10 +145,10 @@ int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *state, &state->...
6b2a8a050fe8dcb8f6539733dfc0743a19596164
Analyze and fix the following issue in the Linux kernel code: drm/sysfs: switch to drm device based logging
Problem Details: Prefer drm_dbg_kms() and drm_dbg_lease() over DRM_DEBUG_KMS() and DRM_DEBUG() to debug log the drm device info. Fix some debug categories and unify connector logging while at it. v2: Drop superfluous newline Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/...
```diff diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index a953f69a34b6..bd9b8ab4f82b 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -209,10 +209,9 @@ static ssize_t status_store(struct device *device, ret = -EINVAL; if (old_force != connector->force || !c...
98618005d34e81d04fc399f01570b1a0fd3b7045
Analyze and fix the following issue in the Linux kernel code: drm/probe-helper: switch to drm device based logging
Problem Details: Prefer drm_dbg_kms() over DRM_DEBUG_KMS() to debug log the drm device info. v2: Drop changes to mode printing (Ville) Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> # v1 Link: https://patchwork.freedesktop.org/patch/msgid/8b6a83edd1c3896b9d652b5368702eba5f382a1c.1712568037.git.jani.nikula@intel...
```diff diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 968a3ee66b1e..19bf5d298257 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -567,8 +567,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, drm_...
57b60ec4b30df188ca31bdd95971a6ef5dfc5094
Analyze and fix the following issue in the Linux kernel code: gpiolib: acpi: Pass con_id instead of property into acpi_dev_gpio_irq_get_by()
Problem Details: Pass the con_id instead of property so that callers won't repeat the GPIO suffixes to try. Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
```diff diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 00ffa168e405..77a2812f2974 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -144,7 +144,7 @@ static int pca953x_acpi_get_irq(struct device *dev) if (ret) dev_warn(dev, "can't add GPIO ACPI mapping\n");...
6d2475823bc20423aad8a21693620c7593de187f
Analyze and fix the following issue in the Linux kernel code: drm/i915/bios: switch to struct drm_edid and struct drm_edid_product_id
Problem Details: To avoid accessing and parsing the raw EDID with drm_edid_raw(), switch to the struct drm_edid based function to extract product id, and use the drm printer function to debug log it. The underlying assumption is that struct drm_edid_product_id and struct lvds_pnp_id describe identical data, albeit wit...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index 52bd3576835b..29371f1f0625 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -598,6 +598,9 @@ get_lvds_pnp_id(const struct bdb_lvds_lfp_data *data, ...
f1411be0462c8e8826fe2cb5908bd169b9eac597
Analyze and fix the following issue in the Linux kernel code: media: adv7180: Only request valids IRQs
Problem Details: i2c_device_probe(), seems to assume that irq = 0 means that there is no irq to request. The driver also believes that on the clean path. So lets be consistent here. Also make smatch happy. Fix: drivers/media/i2c/adv7180.c:1526 adv7180_probe() warn: 'client->irq' from request_threaded_irq() not relea...
```diff diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c index 4829cbe32419..819ff9f7c90f 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c @@ -1486,7 +1486,7 @@ static int adv7180_probe(struct i2c_client *client) if (ret) goto err_media_entity_cleanup; - if (state-...