From: sashiko-bot@kernel.org
To: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v1 2/4] PCI: designware-plat: Drop unused include
Date: Wed, 06 May 2026 10:16:51 +0000 [thread overview]
Message-ID: <20260506101651.D6FD6C2BCC4@smtp.kernel.org> (raw)
In-Reply-To: <20260506084858.867884-3-andriy.shevchenko@linux.intel.com>
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 <andriy.shevchenko@linux.intel.com>
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.
> diff --git a/drivers/pci/controller/dwc/pcie-designware-plat.c b/drivers/pci/controller/dwc/pcie-designware-plat.c
> index d103ab759c4ee..7d896752d43cd 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-plat.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-plat.c
[ ... ]
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?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260506084858.867884-1-andriy.shevchenko@linux.intel.com?part=2
next prev parent reply other threads:[~2026-05-06 10:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-06 8:47 [PATCH v1 0/4] PCI: dwc: Drop or replace unused linux/gpio.h Andy Shevchenko
2026-05-06 8:47 ` [PATCH v1 1/4] PCI: amd-mdb: Use the right GPIO header Andy Shevchenko
2026-05-06 8:47 ` [PATCH v1 2/4] PCI: designware-plat: Drop unused include Andy Shevchenko
2026-05-06 10:16 ` sashiko-bot [this message]
2026-05-06 10:22 ` Andy Shevchenko
2026-05-06 8:47 ` [PATCH v1 3/4] PCI: fu740: " Andy Shevchenko
2026-05-06 8:47 ` [PATCH v1 4/4] PCI: visconti: " Andy Shevchenko
2026-05-06 17:23 ` [PATCH v1 0/4] PCI: dwc: Drop or replace unused linux/gpio.h Manivannan Sadhasivam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260506101651.D6FD6C2BCC4@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.