net: ipa: kill the STARTED IPA power flag
authorAlex Elder <elder@linaro.org>
Tue, 30 Jan 2024 19:23:00 +0000 (13:23 -0600)
committerJakub Kicinski <kuba@kernel.org>
Fri, 2 Feb 2024 04:50:36 +0000 (20:50 -0800)
commit688de12f080f10dff8f3ddc80103e432ad8deb0b
treee90c9ce15e2bf789ddef0aff4c913370a78aea46
parent844ecc4aa78e2f291071025cf76a98287b38856a
net: ipa: kill the STARTED IPA power flag

A transmit on the modem netdev can only complete if the IPA hardware
is powered.  Currently, if a transmit request arrives when the
hardware was not powered, further transmits are be stopped to allow
power-up to complete.  Once power-up completes, transmits are once
again enabled.

Runtime resume can complete at the same time a transmit request is
being handled, and previously there was a race between stopping and
restarting transmits.  The STARTED flag was used to ensure the
stop request in the transmit path was skipped if the start request
in the runtime resume path had already occurred.

Now, the queue is *always* stopped in the transmit path, *before*
determining whether power is ACTIVE.  If power is found to already
be active (or if the socket buffer is gets dropped), transmit is
re-enabled.  Otherwise it will (always) be enabled after runtime
resume completes.

The race between transmit and runtime resume no longer exists, so
there is no longer any need to maintain the STARTED flag.

Signed-off-by: Alex Elder <elder@linaro.org>
Link: https://lore.kernel.org/r/20240130192305.250915-4-elder@linaro.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ipa/ipa_power.c