diff options
author | Alexander Usyskin <alexander.usyskin@intel.com> | 2014-07-17 03:53:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-17 21:38:36 -0400 |
commit | d5d83f8abea13d0b50ee762276c6c900d1946264 (patch) | |
tree | 0d200d16d2270a52d892cab4e77989a0fe07c83d | |
parent | 22b987a325701223f9a37db700c6eb20b9924c6f (diff) |
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>
-rw-r--r-- | drivers/misc/mei/pci-me.c | 2 | ||||
-rw-r--r-- | drivers/misc/mei/pci-txe.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c index f0da3c91f0a8..a0e9422b55a2 100644 --- a/drivers/misc/mei/pci-me.c +++ b/drivers/misc/mei/pci-me.c | |||
@@ -369,7 +369,7 @@ static int mei_me_pm_runtime_idle(struct device *device) | |||
369 | if (!dev) | 369 | if (!dev) |
370 | return -ENODEV; | 370 | return -ENODEV; |
371 | if (mei_write_is_idle(dev)) | 371 | if (mei_write_is_idle(dev)) |
372 | pm_schedule_suspend(device, MEI_ME_RPM_TIMEOUT * 2); | 372 | pm_runtime_autosuspend(device); |
373 | 373 | ||
374 | return -EBUSY; | 374 | return -EBUSY; |
375 | } | 375 | } |
diff --git a/drivers/misc/mei/pci-txe.c b/drivers/misc/mei/pci-txe.c index d7480fe8994d..19de57368b7a 100644 --- a/drivers/misc/mei/pci-txe.c +++ b/drivers/misc/mei/pci-txe.c | |||
@@ -306,7 +306,7 @@ static int mei_txe_pm_runtime_idle(struct device *device) | |||
306 | if (!dev) | 306 | if (!dev) |
307 | return -ENODEV; | 307 | return -ENODEV; |
308 | if (mei_write_is_idle(dev)) | 308 | if (mei_write_is_idle(dev)) |
309 | pm_schedule_suspend(device, MEI_TXI_RPM_TIMEOUT * 2); | 309 | pm_runtime_autosuspend(device); |
310 | 310 | ||
311 | return -EBUSY; | 311 | return -EBUSY; |
312 | } | 312 | } |