OSDN Git Service

net: ipa: ensure hardware has power in ipa_start_xmit()
authorAlex Elder <elder@linaro.org>
Thu, 12 Aug 2021 19:50:33 +0000 (14:50 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sat, 14 Aug 2021 13:13:38 +0000 (14:13 +0100)
commit6b51f802d652b9f053ef5103dc33b7a55c67860c
treebee40e8521ced6e76e50df99f1c517777af72fcf
parenta96e73fa1269a1d1b932f465ed0a803d4c153258
net: ipa: ensure hardware has power in ipa_start_xmit()

We need to ensure the hardware is powered when we transmit a packet.
But if it's not, we can't block to wait for it.  So asynchronously
request power in ipa_start_xmit(), and only proceed if the return
value indicates the power state is active.

If the hardware is not active, a runtime resume request will have
been initiated.  In that case, stop the network stack from further
transmit attempts until the resume completes.  Return NETDEV_TX_BUSY,
to retry sending the packet once the queue is restarted.

If the power request returns an error (other than -EINPROGRESS,
which just means a resume requested elsewhere isn't complete), just
drop the packet.

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