* [PATCH] PCI: iproc: Use the EROM outbound window on BCMA
@ 2026-07-27 14:09 Semih Baskan
2026-07-27 14:16 ` sashiko-bot
2026-07-27 16:48 ` Florian Fainelli
0 siblings, 2 replies; 3+ messages in thread
From: Semih Baskan @ 2026-07-27 14:09 UTC (permalink / raw)
To: lpieralisi, kwilczynski, mani, robh, bhelgaas, rjui, sbranden,
bcm-kernel-feedback-list, rafal, florian.fainelli
Cc: linux-pci, linux-arm-kernel, linux-kernel, rosenp, rani.hod
The PCIe outbound window base on Northstar depends on the PCIe Gen2 core
revision. Revision 0x01 uses 0x08000000, 0x40000000 and 0x48000000 for
controllers 0 to 2, while revision 0x07 (NS-B0) uses 0x08000000,
0x20000000 and 0x28000000. Broadcom's own driver branches on the core
revision for exactly this reason.
bcm-ns.dtsi is shared by every Northstar SoC, so it cannot carry a value
that is correct on both. Commit 767012397976 ("ARM: dts: BCM5301X:
Describe PCIe controllers fully") gave the controllers a ranges property.
The commit shipped in v7.1.
With that property present, two things go wrong with this driver:
devm_pci_alloc_host_bridge() parses those ranges and requests them, then
this driver adds its own window and requests the whole list a second
time, so every controller fails to probe with -EBUSY.
When the DT window is used, it is only correct on core revision 0x07. On
revision 0x01 it points at an address the hardware does not decode, and
the first MMIO access to a BAR takes an imprecise external abort.
The enumeration ROM reports the correct base for the revision actually
present, and bcma already provides it as addr_s[0]. Drop any memory
window that came from the device tree and use that instead, requesting
only the window this driver owns. This makes the driver correct whether
or not the DT describes a window.
The same commit also added compatible = "brcm,iproc-pcie", so these
nodes now match pcie-iproc-platform. With CONFIG_PCIE_IPROC_PLATFORM
enabled, which is the default on ARCH_BCM_IPROC, that driver binds them
first and this driver's probe fails inside devm_pci_alloc_host_bridge().
This patch fixes the configurations where the BCMA driver is the one in
use; OpenWrt builds that way, with PCIE_IPROC_PLATFORM disabled. The
platform path takes the DT window as-is and has the same wrong address
on core revision 0x01, so that side needs a devicetree fix either way.
Tested on an ASUS RT-N18U (BCM47081) and a Linksys EA9200 (BCM4709),
both core revision 0x01.
Fixes: 767012397976 ("ARM: dts: BCM5301X: Describe PCIe controllers fully")
Tested-by: Rani Hod <rani.hod@gmail.com>
Cc: stable@vger.kernel.org # v7.1+
Signed-off-by: Semih Baskan <strst.gs@gmail.com>
---
Applies to v7.2-rc5. Related DT-side approach:
https://lore.kernel.org/all/20260628231156.1254012-1-rosenp@gmail.com/
drivers/pci/controller/pcie-iproc-bcma.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/pcie-iproc-bcma.c b/drivers/pci/controller/pcie-iproc-bcma.c
index 593418c..f0b8d90 100644
--- a/drivers/pci/controller/pcie-iproc-bcma.c
+++ b/drivers/pci/controller/pcie-iproc-bcma.c
@@ -36,6 +36,7 @@ static int iproc_bcma_pcie_probe(struct bcma_device *bdev)
struct device *dev = &bdev->dev;
struct iproc_pcie *pcie;
struct pci_host_bridge *bridge;
+ struct resource_entry *win, *tmp;
int ret;
bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie));
@@ -55,12 +56,20 @@ static int iproc_bcma_pcie_probe(struct bcma_device *bdev)
pcie->base_addr = bdev->addr;
+ resource_list_for_each_entry_safe(win, tmp, &bridge->windows) {
+ if (resource_type(win->res) != IORESOURCE_MEM)
+ continue;
+
+ devm_release_resource(dev, win->res);
+ resource_list_destroy_entry(win);
+ }
+
pcie->mem.start = bdev->addr_s[0];
pcie->mem.end = bdev->addr_s[0] + SZ_128M - 1;
pcie->mem.name = "PCIe MEM space";
pcie->mem.flags = IORESOURCE_MEM;
pci_add_resource(&bridge->windows, &pcie->mem);
- ret = devm_request_pci_bus_resources(dev, &bridge->windows);
+ ret = devm_request_resource(dev, &iomem_resource, &pcie->mem);
if (ret)
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] PCI: iproc: Use the EROM outbound window on BCMA
2026-07-27 14:09 [PATCH] PCI: iproc: Use the EROM outbound window on BCMA Semih Baskan
@ 2026-07-27 14:16 ` sashiko-bot
2026-07-27 16:48 ` Florian Fainelli
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-07-27 14:16 UTC (permalink / raw)
To: Semih Baskan; +Cc: linux-pci
> The PCIe outbound window base on Northstar depends on the PCIe Gen2 core
> revision. Revision 0x01 uses 0x08000000, 0x40000000 and 0x48000000 for
> controllers 0 to 2, while revision 0x07 (NS-B0) uses 0x08000000,
> 0x20000000 and 0x28000000. Broadcom's own driver branches on the core
> revision for exactly this reason.
>
> bcm-ns.dtsi is shared by every Northstar SoC, so it cannot carry a value
> that is correct on both. Commit 767012397976 ("ARM: dts: BCM5301X:
> Describe PCIe controllers fully") gave the controllers a ranges property.
> The commit shipped in v7.1.
>
> With that property present, two things go wrong with this driver:
>
> devm_pci_alloc_host_bridge() parses those ranges and requests them, then
> this driver adds its own window and requests the whole list a second
> [ ... ]
>
> Fixes: 767012397976 ("ARM: dts: BCM5301X: Describe PCIe controllers fully")
> Tested-by: Rani Hod <rani.hod@gmail.com>
> Cc: stable@vger.kernel.org # v7.1+
> Signed-off-by: Semih Baskan <strst.gs@gmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260727140939.389-1-strst.gs@gmail.com?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] PCI: iproc: Use the EROM outbound window on BCMA
2026-07-27 14:09 [PATCH] PCI: iproc: Use the EROM outbound window on BCMA Semih Baskan
2026-07-27 14:16 ` sashiko-bot
@ 2026-07-27 16:48 ` Florian Fainelli
1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2026-07-27 16:48 UTC (permalink / raw)
To: Semih Baskan, lpieralisi, kwilczynski, mani, robh, bhelgaas, rjui,
sbranden, bcm-kernel-feedback-list, rafal
Cc: linux-pci, linux-arm-kernel, linux-kernel, rosenp, rani.hod
On 7/27/26 07:09, Semih Baskan wrote:
> The PCIe outbound window base on Northstar depends on the PCIe Gen2 core
> revision. Revision 0x01 uses 0x08000000, 0x40000000 and 0x48000000 for
> controllers 0 to 2, while revision 0x07 (NS-B0) uses 0x08000000,
> 0x20000000 and 0x28000000. Broadcom's own driver branches on the core
> revision for exactly this reason.
>
> bcm-ns.dtsi is shared by every Northstar SoC, so it cannot carry a value
> that is correct on both. Commit 767012397976 ("ARM: dts: BCM5301X:
> Describe PCIe controllers fully") gave the controllers a ranges property.
> The commit shipped in v7.1.
>
> With that property present, two things go wrong with this driver:
>
> devm_pci_alloc_host_bridge() parses those ranges and requests them, then
> this driver adds its own window and requests the whole list a second
> time, so every controller fails to probe with -EBUSY.
>
> When the DT window is used, it is only correct on core revision 0x07. On
> revision 0x01 it points at an address the hardware does not decode, and
> the first MMIO access to a BAR takes an imprecise external abort.
>
> The enumeration ROM reports the correct base for the revision actually
> present, and bcma already provides it as addr_s[0]. Drop any memory
> window that came from the device tree and use that instead, requesting
> only the window this driver owns. This makes the driver correct whether
> or not the DT describes a window.
>
> The same commit also added compatible = "brcm,iproc-pcie", so these
> nodes now match pcie-iproc-platform. With CONFIG_PCIE_IPROC_PLATFORM
> enabled, which is the default on ARCH_BCM_IPROC, that driver binds them
> first and this driver's probe fails inside devm_pci_alloc_host_bridge().
> This patch fixes the configurations where the BCMA driver is the one in
> use; OpenWrt builds that way, with PCIE_IPROC_PLATFORM disabled. The
> platform path takes the DT window as-is and has the same wrong address
> on core revision 0x01, so that side needs a devicetree fix either way.
>
> Tested on an ASUS RT-N18U (BCM47081) and a Linksys EA9200 (BCM4709),
> both core revision 0x01.
>
> Fixes: 767012397976 ("ARM: dts: BCM5301X: Describe PCIe controllers fully")
> Tested-by: Rani Hod <rani.hod@gmail.com>
> Cc: stable@vger.kernel.org # v7.1+
> Signed-off-by: Semih Baskan <strst.gs@gmail.com>
> ---
> Applies to v7.2-rc5. Related DT-side approach:
> https://lore.kernel.org/all/20260628231156.1254012-1-rosenp@gmail.com/
Acked-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-27 16:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-27 14:09 [PATCH] PCI: iproc: Use the EROM outbound window on BCMA Semih Baskan
2026-07-27 14:16 ` sashiko-bot
2026-07-27 16:48 ` Florian Fainelli
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.