Re: [PATCH 1/2] PCI: dwc: Fix ECAM enablement when used with vendor drivers

From: Bjorn Helgaas

Date: Tue Oct 21 2025 - 11:57:04 EST


On Tue, Oct 21, 2025 at 05:42:39PM +0530, Krishna Chaitanya Chundru wrote:
> On 10/18/2025 12:40 AM, Bjorn Helgaas wrote:
> > On Fri, Oct 17, 2025 at 05:10:53PM +0530, Krishna Chaitanya Chundru wrote:

> > > +static void __iomem *dw_pcie_ecam_conf_map_bus(struct pci_bus *bus, unsigned int devfn, int where)
> > > +{
> > > + struct pci_config_window *cfg = bus->sysdata;
> > > + struct dw_pcie_rp *pp = cfg->priv;
> > > + struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
> > > + unsigned int busn = bus->number;
> > > +
> > > + if (busn > 0)
> > > + return pci_ecam_map_bus(bus, devfn, where);
> >
> > Is there a way to avoid the "root bus is bus 00" assumption here? It
> > looks like something like this might work (it inverts the condition
> > to take care of the root bus special case first):
> >
> > if (bus == pp->bridge->bus) {
> > if (PCI_SLOT(devfn) > 0)
> > return NULL;
> >
> > return pci->dbi_base + where;
> > }
> >
> > return pci_ecam_map_bus(bus, devfn, where);
> > This is working fine Bjorn, shall I send v2 with this change.

Yes, please :)