Skip to content

Commit

Permalink
net/qla3xxx: fix schedule while atomic in ql_wait_for_drvr_lock and q…
Browse files Browse the repository at this point in the history
…l_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 <fantasquex@gmail.com>
Signed-off-by: Letu Ren <fantasquex@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
FantasqueX authored and gregkh committed Aug 12, 2021
1 parent fbbb209 commit 8cfdd03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/qlogic/qla3xxx.c
Expand Up @@ -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");
Expand Down Expand Up @@ -3290,7 +3290,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));

/*
Expand Down Expand Up @@ -3326,7 +3326,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)
Expand Down

0 comments on commit 8cfdd03

Please sign in to comment.