lkml.org 
[lkml]   [2019]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] PCI: PM/ACPI: Refresh all stale power state data in pci_pm_complete()
On Tue, Jun 25, 2019 at 02:09:12PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> In pci_pm_complete() there are checks to decide whether or not to
> resume devices that were left in runtime-suspend during the preceding
> system-wide transition into a sleep state. They involve checking the
> current power state of the device and comparing it with the power
> state of it set before the preceding system-wide transition, but the
> platform component of the device's power state is not handled
> correctly in there.
>
> Namely, on platforms with ACPI, the device power state information
> needs to be updated with care, so that the reference counters of
> power resources used by the device (if any) are set to ensure that
> the refreshed power state of it will be maintained going forward.
>
> To that end, introduce a new ->refresh_state() platform PM callback
> for PCI devices, for asking the platform to refresh the device power
> state data and ensure that the corresponding power state will be
> maintained going forward, make it invoke acpi_device_update_power()
> (for devices with ACPI PM) on platforms with ACPI and make
> pci_pm_complete() use it, through a new pci_refresh_power_state()
> wrapper function.
>
> Fixes: a0d2a959d3da (PCI: Avoid unnecessary resume after direct-complete)
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

I also tested this on Ice Lake system and did not see any issues over
several suspend-to-ram cycles.

\
 
 \ /
  Last update: 2019-06-25 18:10    [W:0.037 / U:7.448 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site