summaryrefslogtreecommitdiff
path: root/drivers/acpi/device_sysfs.c
diff options
context:
space:
mode:
authorJames Morse <james.morse@arm.com>2023-02-24 17:26:37 +0000
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-01-30 10:57:24 +0000
commit597601f6707377a796d4a6304d15b2dead28c93e (patch)
tree223d916e3e34f0e588521c9ce4041a029ad1d72e /drivers/acpi/device_sysfs.c
parent41bccc98fb7931d63d03f326a746ac4d429c1dd3 (diff)
ACPI: Only enumerate enabled (or functional) processor devices
Today the ACPI enumeration code 'visits' all devices that are present. This is a problem for arm64, where CPUs are always present, but not always enabled. When a device-check occurs because the firmware-policy has changed and a CPU is now enabled, the following error occurs: | acpi ACPI0007:48: Enumeration failure This is ultimately because acpi_dev_ready_for_enumeration() returns true for a device that is not enabled. The ACPI Processor driver will not register such CPUs as they are not 'decoding their resources'. ACPI allows a device to be functional instead of maintaining the present and enabled bit, but we can't simply check the enabled bit for all devices since firmware can be buggy. If ACPI indicates that the device is present and enabled, then all well and good, we can enumate it. However, if the device is present and not enabled, then we also check whether the device is a processor device to limit the impact of this new check to just processor devices. This avoids enumerating present && functional processor devices that are not enabled. Signed-off-by: James Morse <james.morse@arm.com> Co-developed-by: Rafael J. Wysocki <rjw@rjwysocki.net> Tested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> --- Changes since RFC v2: * Incorporate comment suggestion by Gavin Shan. Changes since RFC v3: * Fixed "sert" typo. Changes since RFC v3 (smaller series): * Restrict checking the enabled bit to processor devices, update commit comments. * Use Rafael's suggestion in https://lore.kernel.org/r/5760569.DvuYhMxLoT@kreacher * Updated with a fix - see: https://lore.kernel.org/all/Zbe8WQRASx6D6RaG@shell.armlinux.org.uk/
Diffstat (limited to 'drivers/acpi/device_sysfs.c')
-rw-r--r--drivers/acpi/device_sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c
index 23373faa35ec..a0256d2493a7 100644
--- a/drivers/acpi/device_sysfs.c
+++ b/drivers/acpi/device_sysfs.c
@@ -141,7 +141,7 @@ static int create_pnp_modalias(const struct acpi_device *acpi_dev, char *modalia
struct acpi_hardware_id *id;
/* Avoid unnecessarily loading modules for non present devices. */
- if (!acpi_device_is_present(acpi_dev))
+ if (!acpi_dev_ready_for_enumeration(acpi_dev))
return 0;
/*