Re: [RFC PATCH V2 1/3] PCI: hisi: re-architect Hip05/Hip06 controllers driver to preapare for ACPI

From: Arnd Bergmann
Date: Tue Sep 20 2016 - 09:23:22 EST

On Tuesday, September 20, 2016 9:45:13 AM CEST Gabriele Paoloni wrote:
> >
> > I think this would be easier if you separate the ACPI code from the
> > DT code and not try to have a common file used for both.
> >
> > Sharing the config space accessors really isn't worth it when both
> > variants are fairly simple to do, but they don't fit in a common
> > model because one is called from the ACPI quirks and the other
> > is called from the dw-pcie driver with completely different calling
> > conventions.
> Not sure about this...
> From my perspective having the shared code would make clear that
> the two drivers (ACPI and DT) are kind of related...
> For example see the reply from Bjorn to the xgene driver:
> I know in our case the duplication isn't much but as I said
> I am a bit reluctant to rework this...

It's clearly a question of perspective: The way I see it, this
is not a driver at all, but a quirk for the acpi-pci driver,
and having hardware specific code shared between the two
complicates things.

In both cases (xgene and hisi), only a very small portion of
PCI host driver is needed as for the ACPI quirk, while all
of the hardware specific setup can be left to the firmware