summaryrefslogtreecommitdiff
path: root/drivers/net/ipa/ipa_modem.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_modem.c
parent4af14dbaeae00af20daf4557f0e25de27cda812f (diff)
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_modem.c')
-rw-r--r--drivers/net/ipa/ipa_modem.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/ipa/ipa_modem.c b/drivers/net/ipa/ipa_modem.c
index 11f0204a9695..18b1f8d6d729 100644
--- a/drivers/net/ipa/ipa_modem.c
+++ b/drivers/net/ipa/ipa_modem.c
@@ -67,14 +67,15 @@ static int ipa_open(struct net_device *netdev)
netif_start_queue(netdev);
- (void)pm_runtime_put(dev);
+ pm_runtime_mark_last_busy(dev);
+ (void)pm_runtime_put_autosuspend(dev);
return 0;
err_disable_tx:
ipa_endpoint_disable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]);
err_power_put:
- (void)pm_runtime_put(dev);
+ pm_runtime_put_noidle(dev);
return ret;
}
@@ -97,7 +98,8 @@ static int ipa_stop(struct net_device *netdev)
ipa_endpoint_disable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]);
ipa_endpoint_disable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]);
out_power_put:
- (void)pm_runtime_put(dev);
+ pm_runtime_mark_last_busy(dev);
+ (void)pm_runtime_put_autosuspend(dev);
return 0;
}
@@ -145,7 +147,7 @@ ipa_start_xmit(struct sk_buff *skb, struct net_device *netdev)
*/
ipa_power_modem_queue_stop(ipa);
- (void)pm_runtime_put(dev);
+ pm_runtime_put_noidle(dev);
return NETDEV_TX_BUSY;
}
@@ -154,7 +156,8 @@ ipa_start_xmit(struct sk_buff *skb, struct net_device *netdev)
ret = ipa_endpoint_skb_tx(endpoint, skb);
- (void)pm_runtime_put(dev);
+ pm_runtime_mark_last_busy(dev);
+ (void)pm_runtime_put_autosuspend(dev);
if (ret) {
if (ret != -E2BIG)
@@ -398,7 +401,8 @@ static void ipa_modem_crashed(struct ipa *ipa)
dev_err(dev, "error %d zeroing modem memory regions\n", ret);
out_power_put:
- (void)pm_runtime_put(dev);
+ pm_runtime_mark_last_busy(dev);
+ (void)pm_runtime_put_autosuspend(dev);
}
static int ipa_modem_notify(struct notifier_block *nb, unsigned long action,