Skip to content

Commit

Permalink
ACPI / bus: handle ACPI hotplug schedule errors completely
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lee, Chun-Yi authored and Rafael J. Wysocki committed Jul 4, 2017
1 parent 6f7da29 commit 9a4d8d6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9a4d8d6

Please sign in to comment.