OSDN Git Service

net: ipa: don't use ipa_clock_get() in "ipa_modem.c"
authorAlex Elder <elder@linaro.org>
Thu, 19 Aug 2021 22:19:26 +0000 (17:19 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Aug 2021 13:45:47 +0000 (14:45 +0100)
commit724c2d743688f296263df0223c3d95987dfc427b
tree9fdfa93479a4ba8e5ad28b8bd8681b1f43b99492
parent799c5c24b7acc8af0086f1cbff5be3af7f63f6f1
net: ipa: don't use ipa_clock_get() in "ipa_modem.c"

When we open or close the modem network device we need to ensure the
hardware is powered.  Replace the callers of ipa_clock_get() found
in ipa_open() and ipa_stop() with calls to pm_runtime_get_sync().
If an error is returned, simply return that error to the caller
(without any error or warning message).  This could conceivably
occur if the function was called while the system was suspended,
but that really shouldn't happen.  Replace corresponding calls to
ipa_clock_put() with pm_runtime_put() also.

If the modem crashes we also need to ensure the hardware is powered
to recover.  If getting power returns an error there's not much we
can do, but at least report the error.  (Ideally the remoteproc SSR
code would ensure the AP was not suspended when it sends the
notification, but that is not (yet) the case.)

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