Re: [RFC 02/10] property: add fwnode_get_match_data()

Greg Kroah-Hartman
2022-02-22T10:21:08Z

On Tue, Feb 22, 2022 at 10:47:05AM +0100, Clément Léger wrote:
> Le Tue, 22 Feb 2022 10:24:13 +0100,
> Andy Shevchenko <andy.shevchenko@gmail.com> a écrit :
>
> > > > If you want to use the device on an ACPI based platform, you need to
> > > > describe it in ACPI as much as possible. The rest we may discuss.
> > >
> > > Agreed but the PCIe card might also be plugged in a system using a
> > > device-tree description (ARM for instance). I should I do that without
> > > duplicating the description both in DT and ACPI ?
> >
> > Why is it (duplication) a problem?
> > Each platform has its own kind of description, so one needs to provide
> > it in the format the platform accepts.
> >
>
> The problem that I see is not only duplication but also that the PCIe
> card won't work out of the box and will need a specific SSDT overlays
> each time it is used. According to your document about SSDT overlays,
> there is no way to load this from the driver. This means that the user
> will have to compile a platform specific .aml file to match its
> platform configuration. If the user wants to change the PCIe port, than
> I guess it will have to load another .aml file. I do not think a user
> expect to do so when plugging a PCIe card.
>
> Moreover, the APCI documentation [1] says the following:
>
> "PCI devices, which are below the host bridge, generally do not need to
> be described via ACPI. The OS can discover them via the standard PCI
> enumeration mechanism, using config accesses to discover and identify
> devices and read and size their BARs. However, ACPI may describe PCI
> devices if it provides power management or hotplug functionality for
> them or if the device has INTx interrupts connected by platform
> interrupt controllers and a _PRT is needed to describe those
> connections."
>
> The device I want to use (a PCIe switch) does not fall into these
> categories so there should be no need to describe it using ACPI.

There should not be any need to describe it in any way, the device
should provide all of the needed information. PCIe devices do not need
a DT entry, as that does not make sense.

thanks,

greg k-h