aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-04-27 18:34:54 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-28 04:53:12 -0400
commit3935358ebcb8320965478c0e8ee070e1d65851c8 (patch)
treed64c72e3152919fdbbe06d5efef21f3dee3b1ae1 /drivers/net/igb
parent833cc67c7722e35863c6aaee9df56b442ef957ae (diff)
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>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r--drivers/net/igb/e1000_mbx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/igb/e1000_mbx.c b/drivers/net/igb/e1000_mbx.c
index 840782fb5736..ed9058eca45c 100644
--- a/drivers/net/igb/e1000_mbx.c
+++ b/drivers/net/igb/e1000_mbx.c
@@ -140,13 +140,13 @@ static s32 igb_poll_for_msg(struct e1000_hw *hw, u16 mbx_id)
140 struct e1000_mbx_info *mbx = &hw->mbx; 140 struct e1000_mbx_info *mbx = &hw->mbx;
141 int countdown = mbx->timeout; 141 int countdown = mbx->timeout;
142 142
143 if (!mbx->ops.check_for_msg) 143 if (!countdown || !mbx->ops.check_for_msg)
144 goto out; 144 goto out;
145 145
146 while (mbx->ops.check_for_msg(hw, mbx_id)) { 146 while (mbx->ops.check_for_msg(hw, mbx_id)) {
147 countdown--;
147 if (!countdown) 148 if (!countdown)
148 break; 149 break;
149 countdown--;
150 udelay(mbx->usec_delay); 150 udelay(mbx->usec_delay);
151 } 151 }
152out: 152out:
@@ -165,13 +165,13 @@ static s32 igb_poll_for_ack(struct e1000_hw *hw, u16 mbx_id)
165 struct e1000_mbx_info *mbx = &hw->mbx; 165 struct e1000_mbx_info *mbx = &hw->mbx;
166 int countdown = mbx->timeout; 166 int countdown = mbx->timeout;
167 167
168 if (!mbx->ops.check_for_ack) 168 if (!countdown || !mbx->ops.check_for_ack)
169 goto out; 169 goto out;
170 170
171 while (mbx->ops.check_for_ack(hw, mbx_id)) { 171 while (mbx->ops.check_for_ack(hw, mbx_id)) {
172 countdown--;
172 if (!countdown) 173 if (!countdown)
173 break; 174 break;
174 countdown--;
175 udelay(mbx->usec_delay); 175 udelay(mbx->usec_delay);
176 } 176 }
177out: 177out: