Re: [RFC PATCH 1/9] cxl/acpi: Add an acpi_cxl module for the CXL interconnect

From: Rafael J. Wysocki
Date: Wed Nov 18 2020 - 06:15:16 EST


On Tue, Nov 17, 2020 at 10:45 PM Dan Williams <dan.j.williams@xxxxxxxxx> wrote:
>
> On Tue, Nov 17, 2020 at 6:33 AM Rafael J. Wysocki <rafael@xxxxxxxxxx> wrote:
> [..]
> > > +static struct acpi_driver acpi_cxl_driver = {
> >
> > First of all, no new acpi_driver instances, pretty please!
> >
> > acpi_default_enumeration() should create a platform device with the
> > ACPI0017 ID for you. Can't you provide a driver for this one?
> >
>
> Ah, yes, I recall we had this discussion around the time the ACPI0012
> NFIT driver was developed. IIRC the reason ACPI0012 remaining an
> acpi_driver was due to a need to handle ACPI notifications, is that
> the deciding factor?

Sort of. In fact, a platform device driver can still handle ACPI
notifications just fine, it just needs to install a notify handler for
that.

The cases when an acpi_driver is really needed are basically when
creating the platform device during the enumeration is not desirable,
like in the PCI or PNP cases (because they both create device objects
of a different type to represent the "physical" device).

It doesn't look like it is really needed for ACPI0012, but since it is
there already, well ...

> ACPI0017 does not have any notifications so it seems like platform driver is the way to go.

Indeed.