On Wed, Sep 8, 2021 at 11:39 AM Arnd Bergmann <arnd@xxxxxxxx> wrote: > > On Wed, Sep 8, 2021 at 5:48 PM Rob Herring <robh@xxxxxxxxxx> wrote: > > On Fri, Sep 03, 2021 at 05:52:09PM +0800, Huacai Chen wrote: > > > > diff --git a/arch/loongarch/pci/acpi.c b/arch/loongarch/pci/acpi.c > > > new file mode 100644 > > > index 000000000000..d6e2f69b9503 > > > --- /dev/null > > > +++ b/arch/loongarch/pci/acpi.c > > > @@ -0,0 +1,174 @@ > > > +// SPDX-License-Identifier: GPL-2.0 > > A lot of this file appears to duplicate what we already have on other > architectures. > I would suggest moving the other architecture specific code into > drivers/acpi/pci*.c and share as much as possible to make it easier to > make modifications in the future. Yes. I was sad to see after I replied you already said this for v1. > > It might be time for default implementations here that can be shared > > with arm64. The functions look the same or similar to the arm64 > > version in many cases and why they are different isn't that clear to me > > not being all that familar with the ACPI code. > > I think it can be simplified quite a bit if we restructure the acpi pci > code to behave like a normal pci host bridge driver. That is exactly what I want to see happen! I'm not that familiar with the ACPI device probing piece of it or I probably would have done that by now. I gather there's not a normal acpi_device (or platform_device with ACPI matching?) so we'd have to create the device(s) based on the MCFG table. Rob