net/qla3xxx: fix schedule while atomic in ql_wait_for_drvr_lock and ql_adapter_reset
Subsystems (3)
PATCH 1/1 net/qla3xxx: fix schedule while atomic in ql_wait_for_drvr_lock and ql_adapter_reset
When calling the 'ql_wait_for_drvr_lock' and 'ql_adapter_reset', the driver has already acquired the spin lock, so the driver should not call 'ssleep' in atomic context.
This bug can be fixed by using 'mdelay' instead of 'ssleep'.
--- drivers/net/ethernet/qlogic/qla3xxx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/qlogic/qla3xxx.c +3 -3
@@ -154,7 +154,7 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev) "driver lock acquired\n");return 1 ; } -ssleep (1 ); +mdelay (1000 ); }while (++i <10 );netdev_err (qdev->ndev,"Timed out waiting for driver lock...\n" );
@@ -3274,7 +3274,7 @@ static int ql_adapter_reset(struct ql3_adapter *qdev)if ((value &ISP_CONTROL_SR ) ==0 )break ; -ssleep (1 ); +mdelay (1000 ); }while ((--max_wait_time));/*
@@ -3310,7 +3310,7 @@ static int ql_adapter_reset(struct ql3_adapter *qdev) ispControlStatus);if ((value &ISP_CONTROL_FSR ) ==0 )break ; -ssleep (1 ); +mdelay (1000 ); }while ((--max_wait_time)); }if (max_wait_time ==0 )
Signature · 1 line
2.32.0
This patch was applied to netdev/net.git (refs/heads/master):
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
Quoted 10 lines · On Sun, 25 Jul 2021 21:45:12 +0800 you wrote:
When calling the '
ql_wait_for_drvr_lock' and 'ql_adapter_reset', the driver has already acquired the spin lock, so the driver should not call 'ssleep' in atomic context.This bug can be fixed by using 'mdelay' instead of 'ssleep'.
Reported-by Letu Ren <[email protected]>Signed-off-by Letu Ren <[email protected]>[...]
Here is the summary with links:
- net/qla3xxx: fix schedule while atomic in ql_wait_for_drvr_lock and ql_adapter_reset
https://git.kernel.org/netdev/net/c/92766c4628ea
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html