diff options
author | Lee, Chun-Yi <joeyli.kernel@gmail.com> | 2017-06-30 03:25:38 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-07-04 15:38:53 -0400 |
commit | 9a4d8d60df3bc26236fa9cc3bc806ff99e5e5625 (patch) | |
tree | 1289b1cfc6ab2214fae1f636f66bf463047d50d9 | |
parent | 6f7da290413ba713f0cdd9ff1a2a9bb129ef4f6c (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>
-rw-r--r-- | drivers/acpi/bus.c | 8 |
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) | |||
432 | (driver->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS)) | 432 | (driver->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS)) |
433 | driver->ops.notify(adev, type); | 433 | driver->ops.notify(adev, type); |
434 | 434 | ||
435 | if (hotplug_event && ACPI_SUCCESS(acpi_hotplug_schedule(adev, type))) | 435 | if (!hotplug_event) { |
436 | acpi_bus_put_acpi_device(adev); | ||
437 | return; | ||
438 | } | ||
439 | |||
440 | if (ACPI_SUCCESS(acpi_hotplug_schedule(adev, type))) | ||
436 | return; | 441 | return; |
437 | 442 | ||
438 | acpi_bus_put_acpi_device(adev); | 443 | acpi_bus_put_acpi_device(adev); |
439 | return; | ||
440 | 444 | ||
441 | err: | 445 | err: |
442 | acpi_evaluate_ost(handle, type, ost_code, NULL); | 446 | acpi_evaluate_ost(handle, type, ost_code, NULL); |