PCI: dwc: Drop or replace unused linux/gpio.h
Subsystems (5)
cover PCI: dwc: Drop or replace unused linux/gpio.h
The <linux/gpio.h> is a legacy header that is going to die. Make sure that PCI DesignWare drivers do not include it.
Compile tested on x86_64.
Andy Shevchenko (4):
PCI: amd-mdb: Use the right GPIO header
PCI: designware-plat: Drop unused include
PCI: fu740: Drop unused include
PCI: visconti: Drop unused include
drivers/pci/controller/dwc/pcie-amd-mdb.c | 2 +- drivers/pci/controller/dwc/pcie-designware-plat.c | 1 - drivers/pci/controller/dwc/pcie-fu740.c | 1 - drivers/pci/controller/dwc/pcie-visconti.c | 1 - 4 files changed, 1 insertion(+), 4 deletions(-)
Signature · 1 line
2.50.1
PATCH 1/4 PCI: amd-mdb: Use the right GPIO header
The driver includes the legacy GPIO header <linux/gpio.h> but does not use any symbols from it and actually wants <linux/gpio/consumer.h>, so fix this up.
--- drivers/pci/controller/dwc/pcie-amd-mdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-amd-mdb.c +1 -1
@@ -7,7 +7,7 @@#include <linux/clk.h> #include <linux/delay.h> -#include <linux/gpio.h> +#include <linux/gpio/consumer.h> #include <linux/interrupt.h> #include <linux/irqdomain.h> #include <linux/kernel.h>
Signature · 1 line
2.50.1
PATCH 2/4 PCI: designware-plat: Drop unused include
In reply to Andy ShevchenkoThis file does not use the symbols from the legacy <linux/gpio.h> header, so let's drop it.
--- drivers/pci/controller/dwc/pcie-designware-plat.c | 1 - 1 file changed, 1 deletion(-)
drivers/pci/controller/dwc/pcie-designware-plat.c +0 -1
@@ -8,7 +8,6 @@*/ #include <linux/clk.h> #include <linux/delay.h> -#include <linux/gpio.h> #include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/init.h>
Signature · 1 line
2.50.1
[email protected]
AI reviewRe: [PATCH v1 2/4] PCI: designware-plat: Drop unused include
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] In `dw_plat_pcie_probe()`, `pci_epc_init_notify()` is incorrectly called on the error path if…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] In dw_plat_pcie_probe(), pci_epc_init_notify() is incorrectly called on the error path if dw_pcie_ep_init_registers() fails, falsely notifying EPF drivers that the EPC is ready. --
commit e1010c1890e8eeb7c02639fb9293500993fe3d21
Author: Andy Shevchenko <[email protected]>
PCI: designware-plat: Drop unused include
This commit removes the unused <linux/gpio.h> header from the pcie-designware-plat.c file since its symbols are not used.
drivers/pci/controller/dwc/pcie-designware-plat.c
Quoted 4 lines
drivers/pci/controller/dwc/pcie-designware-plat.c +0
-0
[ ... ]
While reviewing this file, I noticed a pre-existing regression in the error handling path of dw_plat_pcie_probe():
drivers/pci/controller/dwc/pcie-designware-plat.c:dw_plat_pcie_probe() {
...
ret = dw_pcie_ep_init_registers(&pci->ep);
if (ret) {
dev_err(dev, "Failed to initialize DWC endpoint registers\n");
dw_pcie_ep_deinit(&pci->ep);
}
pci_epc_init_notify(pci->ep.epc);
...
}If dw_pcie_ep_init_registers() fails, execution falls through and unconditionally calls pci_epc_init_notify(pci->ep.epc) rather than returning an error.
Will this falsely notify all registered endpoint functions that the endpoint controller was successfully initialized?
Endpoint function drivers react to the epc_init event by attempting to allocate memory, set BARs, and configure hardware registers. Because the memory windows are destroyed by dw_pcie_ep_deinit() when it sets num_windows to 0, could these operations lead to failed memory allocations or synchronous external aborts when writing to inaccessible registers?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Re: [PATCH v1 2/4] PCI: designware-plat: Drop unused include
Quoted 3 lines · On Wed, May 06, 2026 at 10:16:51AM +0000, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Indw_plat_pcie_probe(),pci_epc_init_notify()is incorrectly called on the error path ifdw_pcie_ep_init_registers()fails, falsely notifying EPF drivers that the EPC is ready. --
Nice, but completely unrelated to the scope of this mini-series. Whoever knows better the code and wants to address that, please do.
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 3/4 PCI: fu740: Drop unused include
In reply to Andy ShevchenkoThis file does not use the symbols from the legacy <linux/gpio.h> header, so let's drop it.
--- drivers/pci/controller/dwc/pcie-fu740.c | 1 - 1 file changed, 1 deletion(-)
drivers/pci/controller/dwc/pcie-fu740.c +0 -1
@@ -13,7 +13,6 @@#include <linux/clk.h> #include <linux/delay.h> -#include <linux/gpio.h> #include <linux/gpio/consumer.h> #include <linux/kernel.h> #include <linux/module.h>
Signature · 1 line
2.50.1
PATCH 4/4 PCI: visconti: Drop unused include
In reply to Andy ShevchenkoThis file does not use the symbols from the legacy <linux/gpio.h> header, so let's drop it.
--- drivers/pci/controller/dwc/pcie-visconti.c | 1 - 1 file changed, 1 deletion(-)
drivers/pci/controller/dwc/pcie-visconti.c +0 -1
@@ -10,7 +10,6 @@#include <linux/clk.h> #include <linux/delay.h> -#include <linux/gpio.h> #include <linux/interrupt.h> #include <linux/init.h> #include <linux/iopoll.h>
Signature · 1 line
2.50.1
Manivannan Sadhasivam
AppliedQuoted 5 lines · Andy Shevchenko
The <
linux/gpio.h> is a legacy header that is going to die. Make sure that PCI DesignWare drivers do not include it.Compile tested on
x86_64.
Quoted 7 lines
Andy Shevchenko (4):
PCI: amd-mdb: Use the right GPIO header
PCI: designware-plat: Drop unused include
PCI: fu740: Drop unused include
PCI: visconti: Drop unused include[...]
Applied, thanks!
[1/4] PCI: amd-mdb: Use the right GPIO header
commit: 8d846a0a6f95cd717df892b077a1c990a86b29fa
[2/4] PCI: designware-plat: Drop unused include
commit: 800c861cfcbedd033bdffa65c00188fefdcf0767
[3/4] PCI: fu740: Drop unused include
commit: 71d007f6fb17f519c2fe51d35e0bee5f602169e6
[4/4] PCI: visconti: Drop unused include
commit: 7cc21269ef74269e423d64defc940808ccbf9774Best regards,
Signature · 1 line
Manivannan Sadhasivam <[email protected]>