Skip to content

Commit 6ad1c94

Browse files
committed
eth: alx: take rtnl_lock on resume
Zbynek reports that alx trips an rtnl assertion on resume: RTNL: assertion failed at net/core/dev.c (2891) RIP: 0010:netif_set_real_num_tx_queues+0x1ac/0x1c0 Call Trace: <TASK> __alx_open+0x230/0x570 [alx] alx_resume+0x54/0x80 [alx] ? pci_legacy_resume+0x80/0x80 dpm_run_callback+0x4a/0x150 device_resume+0x8b/0x190 async_resume+0x19/0x30 async_run_entry_fn+0x30/0x130 process_one_work+0x1e5/0x3b0 indeed the driver does not hold rtnl_lock during its internal close and re-open functions during suspend/resume. Note that this is not a huge bug as the driver implements its own locking, and does not implement changing the number of queues, but we need to silence the splat. Fixes: 4a5fe57 ("alx: use fine-grained locking instead of RTNL") Reported-and-tested-by: Zbynek Michl <[email protected]> Reviewed-by: Niels Dossche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 0e3f729 commit 6ad1c94

File tree

1 file changed

+5
-0
lines changed
  • drivers/net/ethernet/atheros/alx

1 file changed

+5
-0
lines changed

drivers/net/ethernet/atheros/alx/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,11 +1912,14 @@ static int alx_suspend(struct device *dev)
19121912

19131913
if (!netif_running(alx->dev))
19141914
return 0;
1915+
1916+
rtnl_lock();
19151917
netif_device_detach(alx->dev);
19161918

19171919
mutex_lock(&alx->mtx);
19181920
__alx_stop(alx);
19191921
mutex_unlock(&alx->mtx);
1922+
rtnl_unlock();
19201923

19211924
return 0;
19221925
}
@@ -1927,6 +1930,7 @@ static int alx_resume(struct device *dev)
19271930
struct alx_hw *hw = &alx->hw;
19281931
int err;
19291932

1933+
rtnl_lock();
19301934
mutex_lock(&alx->mtx);
19311935
alx_reset_phy(hw);
19321936

@@ -1943,6 +1947,7 @@ static int alx_resume(struct device *dev)
19431947

19441948
unlock:
19451949
mutex_unlock(&alx->mtx);
1950+
rtnl_unlock();
19461951
return err;
19471952
}
19481953

0 commit comments

Comments
 (0)