Skip to content
Commit a5f76d5e authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

PCI / PM: Block races between runtime PM and system sleep



After commit e8665002
(PM: Allow pm_runtime_suspend() to succeed during system suspend) it
is possible that a device resumed by the pm_runtime_resume(dev) in
pci_pm_prepare() will be suspended immediately from a work item,
timer function or otherwise, defeating the very purpose of calling
pm_runtime_resume(dev) from there.  To prevent that from happening
it is necessary to increment the runtime PM usage counter of the
device by replacing pm_runtime_resume() with pm_runtime_get_sync().
Moreover, the incremented runtime PM usage counter has to be
decremented by the corresponding pci_pm_complete(), via
pm_runtime_put_sync().

Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Cc: stable@kernel.org
Acked-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent ca9c6890
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment