[PATCH net v6 4/4] net: wwan: t7xx: complete NAPI on the not-started RX poll early return
From: Tim JH Chen
Date: Thu Oct 01 2026 - 21:47:52 EST
t7xx_dpmaif_napi_rx_poll() has an early return taken when the RX queue is
no longer started:
if (!rxq->que_started) {
atomic_set(&rxq->rx_processing, 0);
pm_runtime_put_autosuspend(rxq->dpmaif_ctrl->dev);
dev_err(..., "Work RXQ: %d has not been started\n", rxq->index);
return work_done;
}
work_done is 0 here, so the poll returns less than the budget without
calling napi_complete_done(). Per __napi_poll() (net/core/dev.c) a poll
that returns less than the budget is assumed to have completed the NAPI
itself, so the core does not reschedule it. NAPI_STATE_SCHED is therefore
left set and the NAPI is never polled again.
t7xx_dpmaif_rx_stop() clears que_started without completing the NAPI, on
the MD_STATE_EXCEPTION teardown path as well as on system suspend, so the
next poll takes this early return and strands NAPI_STATE_SCHED. A later
netdev close then hangs:
t7xx_ccmni_close()
t7xx_ccmni_disable_napi()
napi_synchronize() <- spins on NAPI_STATE_SCHED forever
napi_synchronize() runs with rtnl_lock held, so every subsequent rtnl
operation blocks and the network stack wedges (a hung task, not a soft
lockup).
Complete the NAPI on this early return so NAPI_STATE_SCHED is cleared and
napi_synchronize() can make progress. The sleep-lock retry branch just
below already calls napi_complete_done() before rescheduling, so only the
not-started branch needs the fix.
This is a pre-existing bug, independent of the TX/RX data path vs system
PM suspend race fixed earlier in this series. It was only reached once
that race stopped soft-locking the CPU before the teardown could run.
Fixes: d642b012df70 ("net: wwan: t7xx: Add data path interface")
Signed-off-by: Tim JH Chen <tim770802@xxxxxxxxx>
---
drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c b/drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c
index 0e1174ee611d..6272956fe053 100644
--- a/drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c
+++ b/drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c
@@ -848,6 +848,12 @@ int t7xx_dpmaif_napi_rx_poll(struct napi_struct *napi, const int budget)
atomic_set(&rxq->rx_processing, 0);
pm_runtime_put_autosuspend(rxq->dpmaif_ctrl->dev);
dev_err(rxq->dpmaif_ctrl->dev, "Work RXQ: %d has not been started\n", rxq->index);
+ /* Returning work_done < budget without completing the NAPI would
+ * leave NAPI_STATE_SCHED set, hanging a later napi_synchronize()
+ * in t7xx_ccmni_disable_napi() (which holds rtnl_lock). Complete
+ * it here so the queue is cleanly unscheduled after rx_stop().
+ */
+ napi_complete_done(napi, work_done);
return work_done;
}
--
2.43.0