cns3xxx PCIe domain support

Arnd Bergmann arnd at kernel.org
Mon Jan 4 08:48:20 EST 2021


On Mon, Jan 4, 2021 at 12:34 PM Lorenzo Pieralisi
<lorenzo.pieralisi at arm.com> wrote:
> On Sun, Jan 03, 2021 at 11:47:45PM +0100, Arnd Bergmann wrote:
> > I'm working on a patch series to simplify the ARM pci-common
> > implementation and came across cns3xxx, which unlike the other
> > non-DT platforms does not partition the bus space of PCI domain
> > zero but instead uses the default bus range 0...255 for each
> > host bridge without assigning domain numbers.
> >
> > Before linux-3.20, commitm c88d54ba0c3d ("CNS3xxx: Remove
> > artificial dependency on pci_sys_data domain."), it used to
> > assign a domain number, but since then, the pci-common code
> > just supports a single domain.
> >
> > My question is: does this actually work correctly without
> > leading to duplicate domain/bus/device/function tuples?
> > Is there anything I'm missing in the code, or could it be
> > that the machines that Koen and Krzysztof were running
> > on never used more than one of the host bridges?
>
> Hi Arnd,
>
> 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.

> Please let me know how we can handle this, thanks a lot for spotting
> it.

As a treewide cleanup, I was hoping we could just make the domain
a field in the pci_host_bridge structure that can get set by the host
bridge driver, and then remove the various other ways of setting
the data, and then only have a trivial pci_domain_nr() implementation
everywhere.

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.

     Arnd



More information about the linux-arm-kernel mailing list