mirror of https://gitee.com/openkylin/linux.git
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'. Reported-by: Letu Ren <fantasquex@gmail.com> Signed-off-by: Letu Ren <fantasquex@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2ebda02714
commit
92766c4628
|
@ -154,7 +154,7 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev)
|
||||||
"driver lock acquired\n");
|
"driver lock acquired\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
ssleep(1);
|
mdelay(1000);
|
||||||
} while (++i < 10);
|
} while (++i < 10);
|
||||||
|
|
||||||
netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n");
|
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)
|
if ((value & ISP_CONTROL_SR) == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ssleep(1);
|
mdelay(1000);
|
||||||
} while ((--max_wait_time));
|
} while ((--max_wait_time));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3310,7 +3310,7 @@ static int ql_adapter_reset(struct ql3_adapter *qdev)
|
||||||
ispControlStatus);
|
ispControlStatus);
|
||||||
if ((value & ISP_CONTROL_FSR) == 0)
|
if ((value & ISP_CONTROL_FSR) == 0)
|
||||||
break;
|
break;
|
||||||
ssleep(1);
|
mdelay(1000);
|
||||||
} while ((--max_wait_time));
|
} while ((--max_wait_time));
|
||||||
}
|
}
|
||||||
if (max_wait_time == 0)
|
if (max_wait_time == 0)
|
||||||
|
|
Loading…
Reference in New Issue