OSDN Git Service

net: ipa: disable clock in suspend
authorAlex Elder <elder@linaro.org>
Tue, 10 Aug 2021 19:26:59 +0000 (14:26 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Aug 2021 12:31:55 +0000 (13:31 +0100)
Disable the IPA clock rather than dropping a reference to it in the
system suspend callback.  This forces the suspend to occur without
affecting existing references.

Similarly, enable the clock rather than taking a reference in
ipa_resume(), forcing a resume without changing the reference count.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/ipa_clock.c

index d5a8b45..864991f 100644 (file)
@@ -414,7 +414,7 @@ static int ipa_suspend(struct device *dev)
                gsi_suspend(&ipa->gsi);
        }
 
-       return ipa_clock_put(ipa);
+       return ipa_clock_disable(ipa);
 }
 
 /**
@@ -432,14 +432,9 @@ static int ipa_resume(struct device *dev)
        struct ipa *ipa = dev_get_drvdata(dev);
        int ret;
 
-       /* This clock reference will keep the IPA out of suspend
-        * until we get a power management suspend request.
-        */
-       ret = ipa_clock_get(ipa);
-       if (WARN_ON(ret < 0)) {
-               (void)ipa_clock_put(ipa);
+       ret = ipa_clock_enable(ipa);
+       if (WARN_ON(ret < 0))
                return ret;
-       }
 
        /* Endpoints aren't usable until setup is complete */
        if (ipa->setup_complete) {