@@ -229,8 +229,6 @@ void ipa_clock_get(struct ipa *ipa)
goto out_mutex_unlock;
}
- ipa_endpoint_resume(ipa);
-
atomic_inc(&clock->count);
out_mutex_unlock:
@@ -249,8 +247,6 @@ void ipa_clock_put(struct ipa *ipa)
if (!atomic_dec_and_mutex_lock(&clock->count, &clock->mutex))
return;
- ipa_endpoint_suspend(ipa);
-
ipa_clock_disable(ipa);
mutex_unlock(&clock->mutex);
@@ -917,6 +917,8 @@ static int ipa_suspend(struct device *dev)
{
struct ipa *ipa = dev_get_drvdata(dev);
+ ipa_endpoint_suspend(ipa);
+
ipa_clock_put(ipa);
if (!atomic_xchg(&ipa->suspend_ref, 0))
dev_err(dev, "suspend: missing suspend clock reference\n");
@@ -943,6 +945,8 @@ static int ipa_resume(struct device *dev)
dev_err(dev, "resume: duplicate suspend clock reference\n");
ipa_clock_get(ipa);
+ ipa_endpoint_resume(ipa);
+
return 0;
}
Currently, when (before) the last IPA clock reference is dropped, all endpoints are suspended. And whenever the first IPA clock reference is taken, all endpoints are resumed (or started). In most cases there's no need to start endpoints when the clock starts. So move the calls to ipa_endpoint_suspend() and ipa_endpoint_resume() out of ipa_clock_put() and ipa_clock_get(), respectiely. Instead, only suspend endpoints when handling a system suspend, and only resume endpoints when handling a system resume. Signed-off-by: Alex Elder <elder@linaro.org> --- drivers/net/ipa/ipa_clock.c | 4 ---- drivers/net/ipa/ipa_main.c | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) -- 2.20.1