]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipa: get clock in ipa_probe()
authorAlex Elder <elder@linaro.org>
Tue, 27 Jul 2021 21:19:29 +0000 (16:19 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Jul 2021 23:06:27 +0000 (00:06 +0100)
commit55727d6e570f68f392e854d4a555a3d064392be1
tree9301bd10627be524152dccb49a9065dcbfa684dd
parent588a899e6efa74339dd4e519f5b28c77567f11b0
net: ipa: get clock in ipa_probe()

Any entry point that leads to IPA hardware access must ensure the
hardware is operational (clocked).  Currently we ensure this by
taking an extra clock reference during setup that is not released
until we receive a system suspend request.  But this extra reference
will soon go away.

When the platform driver ->probe function is called, we first need
hardware access in ipa_config().  Although ipa_config() takes an IPA
clock reference, it the special reference taken to prevent suspending
the hardware.

Have ipa_probe() take a reference before calling ipa_config(), so
that the "no-suspend" reference can eventually go away.  Drop this
reference before ipa_probe() returns.

Similarly, the driver ->remove function can be called at any time.
Take an IPA clock reference at the beginning of that function, and
drop it again after the deconfig stage has completed (at which point
hardware access is no longer needed).

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