mei: don't schedule suspend in pm idle
authorAlexander Usyskin <alexander.usyskin@intel.com>
Thu, 17 Jul 2014 07:53:36 +0000 (10:53 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jul 2014 01:38:36 +0000 (18:38 -0700)
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>
drivers/misc/mei/pci-me.c
drivers/misc/mei/pci-txe.c

index f0da3c91f0a850b470a5eb82e49f5841dd4fd730..a0e9422b55a26aa9a6eb8b39b19f31bd3cfac549 100644 (file)
@@ -369,7 +369,7 @@ static int mei_me_pm_runtime_idle(struct device *device)
        if (!dev)
                return -ENODEV;
        if (mei_write_is_idle(dev))
-               pm_schedule_suspend(device, MEI_ME_RPM_TIMEOUT * 2);
+               pm_runtime_autosuspend(device);
 
        return -EBUSY;
 }
index d7480fe8994d1c027dc26b68370726581e25cd46..19de57368b7a2e8820bdef326663e4a0f9e40e50 100644 (file)
@@ -306,7 +306,7 @@ static int mei_txe_pm_runtime_idle(struct device *device)
        if (!dev)
                return -ENODEV;
        if (mei_write_is_idle(dev))
-               pm_schedule_suspend(device, MEI_TXI_RPM_TIMEOUT * 2);
+               pm_runtime_autosuspend(device);
 
        return -EBUSY;
 }
This page took 0.025615 seconds and 5 git commands to generate.