cns3xxx PCIe domain support

Lorenzo Pieralisi lorenzo.pieralisi at arm.com
Wed Jan 6 10:50:52 EST 2021


On Tue, Jan 05, 2021 at 12:54:36AM +0100, Arnd Bergmann wrote:
> On Mon, Jan 4, 2021 at 4:36 PM Lorenzo Pieralisi
> <lorenzo.pieralisi at arm.com> wrote:
> > On Mon, Jan 04, 2021 at 02:48:20PM +0100, Arnd Bergmann wrote:
> > > On Mon, Jan 4, 2021 at 12:34 PM Lorenzo Pieralisi
> > > > Happy New Year !! I don't think there is anything you are missing, I
> > > > think that's an issue. A possible solution would consist in selecting
> > > > PCI_DOMAINS_GENERIC (the OF code should fall back to using a counter for
> > > > PCI domains - which should do the trick), I'd rather avoid adding back
> > > > an arch/arm hook to set-up the domain number
> > >
> > > Actually on this platform, CONFIG_PCI_DOMAINS_GENERIC is
> > > already enabled, however it still uses board files instead of
> > > devicetree, so the automatic assignment can not work.
> >
> > It should work, pci_bus_find_domain_nr() falls back to a counter in
> > of_pci_bus_find_domain_nr() if no DT is present.
> 
> Ah, I see. I completely missed that part, as I assumed that
> of_pci_bus_find_domain_nr() did not attempt to  do the right
> thing on non-DT platforms. This part of the code is probably correct
> then, as I have no reason to believe there is something wrong with
> it, even if the rest of the platform has other problems.
> 
> It does raise a different issue though, which is that on
> orion/mv78xx0/dove, the same code should trigger now that
> they use CONFIG_ARCH_MULTIPLATFORM but no DT, and the
> logic to assign distinct bus numbers for each host bridge is
> rather pointless.

Yes and potentially buggy (what happens if any host controller exhausts
the bus range (0x0-0xff) is a question mark looking at that code -
sure, it never happens in practice especially on those systems).

Lorenzo

> I don't think it's broken, but it does appear to be an inadvertent
> change in behavior, as the platforms would have used only PCI
> domain zero before the multiplatform conversion.
> 
> > Are you in a position to test it ?
> 
> No.
> 
> > > For the cns3xxx case, I wonder if anyone actually cares. If
> > > there are still users, the treewide change would make it trivial
> > > to set it up right, while backporting would be harder. I noticed
> > > that openwrt removed cns3xxx support in August with the
> > > explanation that the platform is not used much anymore,
> > > and I suspect that any users outside of openwrt stopped updating
> > > their kernels long ago.
> >
> > Can you check please whether CONFIG_PCI_DOMAINS_GENERIC still assigns
> > separate domain numbers even with no DT support at all ?
> 
> From inspection, I'd say the code still works as designed.
> 
>       Arnd



More information about the linux-arm-kernel mailing list