net: spacemit: Fix TX timeout work deadlock and RTNL in PM callbacks
Status from this message: This series was applied to netdev/net.git (main)
Get series with b4
b4 am [email protected]Versions newest first
Changes in v2 from the cover letter
- New patch 1 to fix the TX timeout work deadlock (reported by Troy, approach suggested by Vivian)
- Patch 2: take RTNL before the netif_running() checks
- Patch 2: drop Breno's Reviewed-by, since the patch changed
Patches in v2 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | net: spacemit: Fix TX timeout work deadlocking on itselfdrivers/ | +6 | 1 reply | Applied |
| 2/2 | net: spacemit: Hold RTNL lock in emac_resume() and emac_suspend()drivers/ | +10 | 1 reply | Applied |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Muhammad Bilal | Vivian Wang |
|---|---|---|
| Series | R-b | R-b |
| 1/2 | R-b | |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net v2 0/2] net: spacemit: Fix TX timeout work deadlock and RTNL in PM callbacks
This series fixes two locking problems in the SpacemiT K1 Ethernet driver.
Patch 1 fixes the TX timeout work, which ends up waiting for itself through cancel_work_sync() in emac_down(), so every TX timeout leaves RTNL held forever.
Patch 2 takes RTNL in emac_suspend() and emac_resume(), which fixes the "suspicious RCU usage" warning from phy_disconnect() on suspend. It depends on patch 1: suspend disables the TX timeout work before taking RTNL, so it never waits for the work while holding the lock.
Tested on Orange Pi RV2 (SpacemiT K1) with a lockdep kernel: 12 suspend/resume cycles without the warning. The board loses its network after about a dozen cycles with or without this series; that is a separate issue.
Changes in v2:
- New patch 1 to fix the TX timeout work deadlock (reported by Troy, approach suggested by Vivian)
- Patch 2: take RTNL before the netif_running() checks
- Patch 2: drop Breno's Reviewed-by, since the patch changed
v1: https://lore.kernel.org/netdev/[email protected]/
Ali Tariq (2):
net: spacemit: Fix TX timeout work deadlocking on itself
net: spacemit: Hold RTNL lock in emac_resume() and emac_suspend()
drivers/net/ethernet/spacemit/k1_emac.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
Signature · 1 line
2.34.1