2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-26 06:04:14 +08:00

mei: don't schedule suspend in pm idle

Calling pm_schedule_suspend from the runtime pm idle callback
may reschedule existing timer, thus in case of frequent runtime
rpm idle call the suspend maybe starved.
Instead we call pm_runtime_autosuspend which is checking if the
timer is already charged.

An example is monitoring device pci config space.
Pci config sysfs handlers calls pci_config_pm_runtime_put/get
helpers which in turns calls to device idle callback

Cc: stable@vger.kernel.org # 3.15+
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Alexander Usyskin 2014-07-17 10:53:36 +03:00 committed by Greg Kroah-Hartman
parent 22b987a325
commit d5d83f8abe
2 changed files with 2 additions and 2 deletions

View File

@ -369,7 +369,7 @@ static int mei_me_pm_runtime_idle(struct device *device)
if (!dev) if (!dev)
return -ENODEV; return -ENODEV;
if (mei_write_is_idle(dev)) if (mei_write_is_idle(dev))
pm_schedule_suspend(device, MEI_ME_RPM_TIMEOUT * 2); pm_runtime_autosuspend(device);
return -EBUSY; return -EBUSY;
} }

View File

@ -306,7 +306,7 @@ static int mei_txe_pm_runtime_idle(struct device *device)
if (!dev) if (!dev)
return -ENODEV; return -ENODEV;
if (mei_write_is_idle(dev)) if (mei_write_is_idle(dev))
pm_schedule_suspend(device, MEI_TXI_RPM_TIMEOUT * 2); pm_runtime_autosuspend(device);
return -EBUSY; return -EBUSY;
} }