summaryrefslogtreecommitdiffstats
path: root/drivers/net/ipa/ipa_clock.c
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2021-08-20 11:01:27 -0500
committerDavid S. Miller <davem@davemloft.net>2021-08-22 09:44:17 +0100
commit1aac309d32075e73d1f93208b38cd2d5f03e0a5c (patch)
tree25eb6caf6b7fb1be6666fdb1c248a83d4e379c7a /drivers/net/ipa/ipa_clock.c
parent4af14dbaeae00af20daf4557f0e25de27cda812f (diff)
downloadlinux-1aac309d32075e73d1f93208b38cd2d5f03e0a5c.tar.bz2
net: ipa: use autosuspend
Use runtime power management autosuspend. Up until this point, we only suspended the IPA hardware for system suspend; now we'll suspend it aggressively using runtime power management, setting the initial autosuspend delay to half a second of inactivity. Replace pm_runtime_put() calls with pm_runtime_put_autosuspend(), call pm_runtime_mark_last_busy() before each of those. In places where we're shutting things down, or decrementing power references for errors, use pm_runtime_put_noidle() instead. Finally, remove ipa_runtime_idle(), so the ->runtime_suspend callback will occur if idle. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipa/ipa_clock.c')
-rw-r--r--drivers/net/ipa/ipa_clock.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/net/ipa/ipa_clock.c b/drivers/net/ipa/ipa_clock.c
index 149b24da0bcc..54d684945a7f 100644
--- a/drivers/net/ipa/ipa_clock.c
+++ b/drivers/net/ipa/ipa_clock.c
@@ -32,6 +32,8 @@
* An IPA clock reference must be held for any access to IPA hardware.
*/
+#define IPA_AUTOSUSPEND_DELAY 500 /* milliseconds */
+
/**
* struct ipa_interconnect - IPA interconnect information
* @path: Interconnect path
@@ -267,11 +269,6 @@ static int ipa_runtime_resume(struct device *dev)
return 0;
}
-static int ipa_runtime_idle(struct device *dev)
-{
- return -EAGAIN;
-}
-
static int ipa_suspend(struct device *dev)
{
struct ipa *ipa = dev_get_drvdata(dev);
@@ -443,7 +440,8 @@ ipa_clock_init(struct device *dev, const struct ipa_clock_data *data)
if (ret)
goto err_kfree;
- pm_runtime_dont_use_autosuspend(dev);
+ pm_runtime_set_autosuspend_delay(dev, IPA_AUTOSUSPEND_DELAY);
+ pm_runtime_use_autosuspend(dev);
pm_runtime_enable(dev);
return clock;
@@ -459,9 +457,11 @@ err_clk_put:
/* Inverse of ipa_clock_init() */
void ipa_clock_exit(struct ipa_clock *clock)
{
+ struct device *dev = clock->dev;
struct clk *clk = clock->core;
- pm_runtime_disable(clock->dev);
+ pm_runtime_disable(dev);
+ pm_runtime_dont_use_autosuspend(dev);
ipa_interconnect_exit(clock);
kfree(clock);
clk_put(clk);
@@ -472,5 +472,4 @@ const struct dev_pm_ops ipa_pm_ops = {
.resume = ipa_resume,
.runtime_suspend = ipa_runtime_suspend,
.runtime_resume = ipa_runtime_resume,
- .runtime_idle = ipa_runtime_idle,
};