]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
ACPI: platform: Unregister stale platform devices
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 30 Aug 2019 14:34:32 +0000 (17:34 +0300)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 30 Jan 2020 15:27:30 +0000 (16:27 +0100)
commitee4f676f17243c28a02f56a38f48be31918c8290
tree0d133bd040ce917eeb7c40f85017e9cb28e0222c
parent0c16ab0900313351fa15dcda5d3b60adfea1bc63
ACPI: platform: Unregister stale platform devices

BugLink: https://bugs.launchpad.net/bugs/1861091
[ Upstream commit cb0701acfa7e3fe9e919cf2aa2aa939b7fd603c2 ]

When commit 68bdb6773289 ("ACPI: add support for ACPI reconfiguration
notifiers") introduced reconfiguration notifiers, it missed the point
that the ACPI table, which might be loaded and then unloaded via
ConfigFS, could contain devices that were not enumerated by their
parents.

In such cases, the stale platform device is dangling in the system
while the rest of the devices from the same table are already gone.

Introduce acpi_platform_device_remove_notify() notifier that, in
similar way to I²C or SPI buses, unregisters the platform devices
on table removal event.

Fixes: 68bdb6773289 ("ACPI: add support for ACPI reconfiguration notifiers")
Depends-on: 00500147cbd3 ("drivers: Introduce device lookup variants by ACPI_COMPANION device")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[ rjw: Changelog & function rename ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/acpi/acpi_platform.c
drivers/acpi/scan.c