Skip to content

Commit 8cfdd03

Browse files
FantasqueXgregkh
authored andcommitted
net/qla3xxx: fix schedule while atomic in ql_wait_for_drvr_lock and ql_adapter_reset
[ Upstream commit 92766c4 ] 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]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent fbbb209 commit 8cfdd03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/ethernet/qlogic/qla3xxx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev)
154154
"driver lock acquired\n");
155155
return 1;
156156
}
157-
ssleep(1);
157+
mdelay(1000);
158158
} while (++i < 10);
159159

160160
netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n");
@@ -3290,7 +3290,7 @@ static int ql_adapter_reset(struct ql3_adapter *qdev)
32903290
if ((value & ISP_CONTROL_SR) == 0)
32913291
break;
32923292

3293-
ssleep(1);
3293+
mdelay(1000);
32943294
} while ((--max_wait_time));
32953295

32963296
/*
@@ -3326,7 +3326,7 @@ static int ql_adapter_reset(struct ql3_adapter *qdev)
33263326
ispControlStatus);
33273327
if ((value & ISP_CONTROL_FSR) == 0)
33283328
break;
3329-
ssleep(1);
3329+
mdelay(1000);
33303330
} while ((--max_wait_time));
33313331
}
33323332
if (max_wait_time == 0)

0 commit comments

Comments
 (0)