Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a4d8d60 authored by Lee, Chun-Yi's avatar Lee, Chun-Yi Committed by Rafael J. Wysocki
Browse files

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: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatar"Lee, Chun-Yi" <jlee@suse.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 6f7da290
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -432,12 +432,16 @@ 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;
	}

	acpi_bus_put_acpi_device(adev);
	if (ACPI_SUCCESS(acpi_hotplug_schedule(adev, type)))
		return;

	acpi_bus_put_acpi_device(adev);

 err:
	acpi_evaluate_ost(handle, type, ost_code, NULL);
}