Skip to content

Commit

Permalink
smsc911x: check for FFWD success before checking for timeout
Browse files Browse the repository at this point in the history
This patch from Juha Leppanen suppresses a false warning if a fast
forward operation succeeds on the very last attempt.

Juha> If smsc911x_reg_read loop is executed 500 times, timeout reaches 0
Juha> and the 500th smsc911x_reg_read result in val is ignored. If
Juha> testing order is changed, then val is checked first. The 500th
Juha> reg_read might be GOOD, why ignore it!

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Steve Glendinning authored and David S. Miller committed Mar 13, 2009
1 parent 273ae44 commit 8dacd54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/smsc911x.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes)
do {
udelay(1);
val = smsc911x_reg_read(pdata, RX_DP_CTRL);
} while (--timeout && (val & RX_DP_CTRL_RX_FFWD_));
} while ((val & RX_DP_CTRL_RX_FFWD_) && --timeout);

if (unlikely(timeout == 0))
SMSC_WARNING(HW, "Timed out waiting for "
Expand Down

0 comments on commit 8dacd54

Please sign in to comment.