Commit 3f6e785f authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

qlge: Move jiffies_to_usecs immediately before loop

30 usecs (or really, 1 jiffy) can go by pretty fast.

Move the set of the timeout immediately before the loop.

Remove the unnecessary max(1ul, usecs_to_jiffies(30)) as
usecs_to_jiffies with a non-zero constant is guaranteed
to be non-zero.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4ac2dc89
...@@ -3871,9 +3871,6 @@ static int ql_adapter_reset(struct ql_adapter *qdev) ...@@ -3871,9 +3871,6 @@ static int ql_adapter_reset(struct ql_adapter *qdev)
return status; return status;
} }
end_jiffies = jiffies +
max((unsigned long)1, usecs_to_jiffies(30));
/* Check if bit is set then skip the mailbox command and /* Check if bit is set then skip the mailbox command and
* clear the bit, else we are in normal reset process. * clear the bit, else we are in normal reset process.
*/ */
...@@ -3888,6 +3885,7 @@ static int ql_adapter_reset(struct ql_adapter *qdev) ...@@ -3888,6 +3885,7 @@ static int ql_adapter_reset(struct ql_adapter *qdev)
ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR); ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR);
end_jiffies = jiffies + usecs_to_jiffies(30);
do { do {
value = ql_read32(qdev, RST_FO); value = ql_read32(qdev, RST_FO);
if ((value & RST_FO_FR) == 0) if ((value & RST_FO_FR) == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment