Skip to content

Commit

Permalink
ACPI: PNP: Introduce list of known non-PNP devices
Browse files Browse the repository at this point in the history
In some cases, PNP device IDs from acpi_pnp_device_ids[] are returned by
_CID for devices for which matching platform drivers are present in the
kernel and should be bound to them.  However, the IDs coming from _CID
cause the PNP scan handler to attach to those devices which prevents
platform device objects from being created for them.

Address this by introducing a list of known non-PNP device IDs into
acpi_pnp.c such that if a device ID is there in that list, it cannot be
attached to by the PNP scan handler and add the platform runtime update
and telemetry device IDs to that list to start with.

Reported-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Zhang Yang <Yang5.zhang@intel.com>
  • Loading branch information
Rafael J. Wysocki committed Jan 17, 2023
1 parent 5dc4c99 commit 28a35ac
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion drivers/acpi/acpi_pnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,22 @@ static bool acpi_pnp_match(const char *idstr, const struct acpi_device_id **matc
return false;
}

/*
* If one of the device IDs below is present in the list of device IDs of a
* given ACPI device object, the PNP scan handler will not attach to that
* object, because there is a proper non-PNP driver in the kernel for the
* device represented by it.
*/
static const struct acpi_device_id acpi_nonpnp_device_ids[] = {
{"INTC1080"},
{"INTC1081"},
{""},
};

static int acpi_pnp_attach(struct acpi_device *adev,
const struct acpi_device_id *id)
{
return 1;
return !!acpi_match_device_ids(adev, acpi_nonpnp_device_ids);
}

static struct acpi_scan_handler acpi_pnp_handler = {
Expand Down

0 comments on commit 28a35ac

Please sign in to comment.