ACPI: PM: Simplify and fix PM domain hibernation callbacks
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 1 Jul 2019 10:54:10 +0000 (12:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:59 +0000 (14:50 +0100)
commit998d759eaf65887d0bd40e43facc68ecdf4304b8
treef0f7798017a877067c2d5366eac65c0bdad68a65
parentbad2aed1059890b1bdedbd776142651e9ecd7ba0
ACPI: PM: Simplify and fix PM domain hibernation callbacks

[ Upstream commit 3cd7957e85e67120bb9f6bfb75d81dcc19af282b ]

First, after a previous change causing all runtime-suspended devices
in the ACPI PM domain (and ACPI LPSS devices) to be resumed before
creating a snapshot image of memory during hibernation, it is not
necessary to worry about the case in which them might be left in
runtime-suspend any more, so get rid of the code related to that from
ACPI PM domain and ACPI LPSS hibernation callbacks.

Second, it is not correct to use pm_generic_resume_early() and
acpi_subsys_resume_noirq() in hibernation "restore" callbacks (which
currently happens in the ACPI PM domain and ACPI LPSS), so introduce
proper _restore_late and _restore_noirq callbacks for the ACPI PM
domain and ACPI LPSS.

Fixes: 05087360fd7a (ACPI / PM: Take SMART_SUSPEND driver flag into account)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/acpi/acpi_lpss.c
drivers/acpi/device_pm.c
include/linux/acpi.h