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)
commit923a6b698447f4f7872daee47accbab78135ff51
tree9301bd10627be524152dccb49a9065dcbfa684dd
parentf34d9224503f13cae35ae9d6a43199e3666bbe99
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