]> git.hungrycats.org Git - linux/commit
ACPI / scan: Prefer devices without _HID/_CID for _ADR matching
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 30 Dec 2016 01:27:31 +0000 (02:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Aug 2017 02:19:45 +0000 (19:19 -0700)
commitf4a42f8492bdca120e296348f615f8f8c0250a07
tree8982ade566b76d7e9df2eae6c1daee7a9a6fa14c
parent8c065e76fbc5e962db614d4d2d1a8eda461ca9d5
ACPI / scan: Prefer devices without _HID/_CID for _ADR matching

[ Upstream commit c2a6bbaf0c5f90463a7011a295bbdb7e33c80b51 ]

The way acpi_find_child_device() works currently is that, if there
are two (or more) devices with the same _ADR value in the same
namespace scope (which is not specifically allowed by the spec and
the OS behavior in that case is not defined), the first one of them
found to be present (with the help of _STA) will be returned.

This covers the majority of cases, but is not sufficient if some of
the devices in question have a _HID (or _CID) returning some valid
ACPI/PNP device IDs (which is disallowed by the spec) and the
ASL writers' expectation appears to be that the OS will match
devices without a valid ACPI/PNP device ID against a given bus
address first.

To cover this special case as well, modify find_child_checks()
to prefer devices without ACPI/PNP device IDs over devices that
have them.

Suggested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/glue.c