igb: reconfigure mailbox timeout logic
This change updates the timeout logic so that it is not possible to have a sucessful check for message and still return an error if countdown = 0. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Reported-by: Juha Leppanen <juha_motorsportscom@luukku.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
833cc67c77
commit
3935358ebc
@ -140,13 +140,13 @@ static s32 igb_poll_for_msg(struct e1000_hw *hw, u16 mbx_id)
|
|||||||
struct e1000_mbx_info *mbx = &hw->mbx;
|
struct e1000_mbx_info *mbx = &hw->mbx;
|
||||||
int countdown = mbx->timeout;
|
int countdown = mbx->timeout;
|
||||||
|
|
||||||
if (!mbx->ops.check_for_msg)
|
if (!countdown || !mbx->ops.check_for_msg)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
while (mbx->ops.check_for_msg(hw, mbx_id)) {
|
while (mbx->ops.check_for_msg(hw, mbx_id)) {
|
||||||
|
countdown--;
|
||||||
if (!countdown)
|
if (!countdown)
|
||||||
break;
|
break;
|
||||||
countdown--;
|
|
||||||
udelay(mbx->usec_delay);
|
udelay(mbx->usec_delay);
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
@ -165,13 +165,13 @@ static s32 igb_poll_for_ack(struct e1000_hw *hw, u16 mbx_id)
|
|||||||
struct e1000_mbx_info *mbx = &hw->mbx;
|
struct e1000_mbx_info *mbx = &hw->mbx;
|
||||||
int countdown = mbx->timeout;
|
int countdown = mbx->timeout;
|
||||||
|
|
||||||
if (!mbx->ops.check_for_ack)
|
if (!countdown || !mbx->ops.check_for_ack)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
while (mbx->ops.check_for_ack(hw, mbx_id)) {
|
while (mbx->ops.check_for_ack(hw, mbx_id)) {
|
||||||
|
countdown--;
|
||||||
if (!countdown)
|
if (!countdown)
|
||||||
break;
|
break;
|
||||||
countdown--;
|
|
||||||
udelay(mbx->usec_delay);
|
udelay(mbx->usec_delay);
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user