summaryrefslogtreecommitdiff
path: root/drivers/net/ipa/ipa_uc.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_uc.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_uc.c')
-rw-r--r--drivers/net/ipa/ipa_uc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/ipa/ipa_uc.c b/drivers/net/ipa/ipa_uc.c
index a0bdd25b65b4..de0438527019 100644
--- a/drivers/net/ipa/ipa_uc.c
+++ b/drivers/net/ipa/ipa_uc.c
@@ -154,7 +154,8 @@ static void ipa_uc_response_hdlr(struct ipa *ipa, enum ipa_irq_id irq_id)
case IPA_UC_RESPONSE_INIT_COMPLETED:
if (ipa->uc_clocked) {
ipa->uc_loaded = true;
- (void)pm_runtime_put(dev);
+ pm_runtime_mark_last_busy(dev);
+ (void)pm_runtime_put_autosuspend(dev);
ipa->uc_clocked = false;
} else {
dev_warn(dev, "unexpected init_completed response\n");
@@ -179,10 +180,15 @@ void ipa_uc_config(struct ipa *ipa)
/* Inverse of ipa_uc_config() */
void ipa_uc_deconfig(struct ipa *ipa)
{
+ struct device *dev = &ipa->pdev->dev;
+
ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_1);
ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_0);
- if (ipa->uc_clocked)
- (void)pm_runtime_put(&ipa->pdev->dev);
+ if (!ipa->uc_clocked)
+ return;
+
+ pm_runtime_mark_last_busy(dev);
+ (void)pm_runtime_put_autosuspend(dev);
}
/* Take a proxy clock reference for the microcontroller */