]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
ACPI: scan: Fix _STA getting called on devices with unmet dependencies
authorHans de Goede <hdegoede@redhat.com>
Tue, 30 Mar 2021 18:49:32 +0000 (20:49 +0200)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Apr 2021 20:42:49 +0000 (15:42 -0500)
commitecd4e32adda26ca34c768247453c03ed74283beb
tree5e5779a7672e35360d873be4e86364568a095a99
parentfae1cb573310f663cb92b35aca810fd05183bc9f
ACPI: scan: Fix _STA getting called on devices with unmet dependencies

BugLink: https://bugs.launchpad.net/bugs/1923069
commit 3e759425cc3cf9a43392309819d34c65a3644c59 upstream.

Commit 71da201f38df ("ACPI: scan: Defer enumeration of devices with
_DEP lists") dropped the following 2 lines from acpi_init_device_object():

/* Assume there are unmet deps until acpi_device_dep_initialize() runs */
device->dep_unmet = 1;

Leaving the initial value of dep_unmet at the 0 from the kzalloc(). This
causes the acpi_bus_get_status() call in acpi_add_single_object() to
actually call _STA, even though there maybe unmet deps, leading to errors
like these:

[    0.123579] ACPI Error: No handler for Region [ECRM] (00000000ba9edc4c)
               [GenericSerialBus] (20170831/evregion-166)
[    0.123601] ACPI Error: Region GenericSerialBus (ID=9) has no handler
               (20170831/exfldio-299)
[    0.123618] ACPI Error: Method parse/execution failed
               \_SB.I2C1.BAT1._STA, AE_NOT_EXIST (20170831/psparse-550)

Fix this by re-adding the dep_unmet = 1 initialization to
acpi_init_device_object() and modifying acpi_bus_check_add() to make sure
that dep_unmet always gets setup there, overriding the initial 1 value.

This re-fixes the issue initially fixed by
commit 63347db0affa ("ACPI / scan: Use acpi_bus_get_status() to initialize
ACPI_TYPE_DEVICE devs"), which introduced the removed
"device->dep_unmet = 1;" statement.

This issue was noticed; and the fix tested on a Dell Venue 10 Pro 5055.

Fixes: 71da201f38df ("ACPI: scan: Defer enumeration of devices with _DEP lists")
Suggested-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: 5.11+ <stable@vger.kernel.org> # 5.11+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/acpi/scan.c