Skip to content

Commit

Permalink
qla3xxx: don't allow never end busy loop
Browse files Browse the repository at this point in the history
The counter variable wasn't increased at all which may stuck under
certain circumstances.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andy Shevchenko authored and David S. Miller committed Jan 6, 2015
1 parent 627d2cc commit 2abad79
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/net/ethernet/qlogic/qla3xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,7 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev)
{
int i = 0;

while (i < 10) {
if (i)
ssleep(1);

do {
if (ql_sem_lock(qdev,
QL_DRVR_SEM_MASK,
(QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index)
Expand All @@ -158,7 +155,8 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev)
"driver lock acquired\n");
return 1;
}
}
ssleep(1);
} while (++i < 10);

netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n");
return 0;
Expand Down

0 comments on commit 2abad79

Please sign in to comment.