summaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLee, Chun-Yi <joeyli.kernel@gmail.com>2017-06-30 15:25:38 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-07-04 21:38:53 +0200
commit9a4d8d60df3bc26236fa9cc3bc806ff99e5e5625 (patch)
tree1289b1cfc6ab2214fae1f636f66bf463047d50d9 /drivers/acpi
parent6f7da290413ba713f0cdd9ff1a2a9bb129ef4f6c (diff)
ACPI / bus: handle ACPI hotplug schedule errors completely
Kernel should decrements the reference count of ACPI device when the scheduling of ACPI hotplug work failed, and evaluates _OST to notify BIOS the failure. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: "Lee, Chun-Yi" <jlee@suse.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/bus.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 784bda663d16..9d4fea6433f5 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -432,11 +432,15 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
(driver->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS))
driver->ops.notify(adev, type);
- if (hotplug_event && ACPI_SUCCESS(acpi_hotplug_schedule(adev, type)))
+ if (!hotplug_event) {
+ acpi_bus_put_acpi_device(adev);
+ return;
+ }
+
+ if (ACPI_SUCCESS(acpi_hotplug_schedule(adev, type)))
return;
acpi_bus_put_acpi_device(adev);
- return;
err:
acpi_evaluate_ost(handle, type, ost_code, NULL);