]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipa: don't use ipa_clock_get() in "ipa_smp2p.c"
authorAlex Elder <elder@linaro.org>
Thu, 19 Aug 2021 22:19:24 +0000 (17:19 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Aug 2021 13:45:47 +0000 (14:45 +0100)
commit3da5a8210367e102e024bea9899db092a41a8660
treeaf156be7fec8cf2f0b16b99568bbfdd0c4560d4c
parent1e75fb3fce2db1eb6a006ad7b3dc25fb85975e08
net: ipa: don't use ipa_clock_get() in "ipa_smp2p.c"

If the "modem-init" Device Tree property is present for a platform,
the modem performs early IPA hardware initialization, and signals
this is complete with an "ipa-setup-ready" SMP2P interrupt.  This
triggers a call to ipa_setup(), which requires the hardware to be
powered.

Replace the call to ipa_clock_get() in this case with a call to
pm_runtime_get_sync().  And replace the corresponding calls to
ipa_clock_put() with calls to pm_runtime_put() instead.

There is a chance we get an error when taking this power reference.
This is an unlikely scenario, where system suspend is initiated just
before the modem signals it has finished initializing the IPA
hardware.  For now we'll just accept that this could occur, and
report it if it does.

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