]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'ipa-kill-off-ipa_clock_get'
authorDavid S. Miller <davem@davemloft.net>
Fri, 20 Aug 2021 13:45:48 +0000 (14:45 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Aug 2021 13:45:48 +0000 (14:45 +0100)
commit709011553de37a096096266bafd7e030a77b94a6
tree665dd48ccd9e3e733c54b94320070076f653d4fb
parentd9aa18e8c9a7ea7922e4dfc383cd9c0740d22d8e
parent5732c94ce0af62a81ffe2895386b5ff6f57b5450
Merge branch 'ipa-kill-off-ipa_clock_get'

Alex Elder says:

====================
net: ipa: kill off ipa_clock_get()

This series replaces the remaining uses of ipa_clock_get() with
calls to pm_runtime_get_sync() instead.  It replaces all calls to
ipa_clock_put() with calls to pm_runtime_put().

This completes the preparation for enabling automated suspend under
the control of the power management core code.  The next patch (in
an upcoming series) enables that.  Then the "ipa_clock" files and
symbols will switch to using an "ipa_power" naming convention instead.

Additional info

It is possible for pm_runtime_get_sync() to return an error.  There
are really three cases, identified by return value:
  - 1, meaning power was already active
  - 0, meaning power was not previously active, but is now
  - EACCES, meaning runtime PM is disabled
One additional case is EINVAL, meaning a previous suspend or resume
(or idle) call returned an error.  But we have always assumed this
won't happen (we previously didn't even check for an error).

But because we use pm_runtime_force_suspend() to implement system
suspend, there's a chance we'd get an EACCES error (the first thing
that function does is disable runtime suspend).  Individual patches
explain what happens in that case, but generally we just accept that
it could be an unlikely problem (occurring only at startup time).

Similarly, pm_runtime_put() could return an error.  There too, we
ignore EINVAL, assuming the IPA suspend and resume operations won't
produce an error.  EBUSY and EPERM are not applicable, EAGAIN is not
expected (and harmless).  We should never get EACCES (runtime
suspend disabled), because pm_runtime_put() calls match prior
pm_runtime_get_sync() calls, and a system suspend will not be
started while a runtime suspend or resume is underway.  In summary,
the value returned from pm_runtime_put() is not meaningful, so we
explicitly ignore it.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>