netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next PATCH 1/6] igb: reconfigure mailbox timeout logic
@ 2009-04-28  8:34 Jeff Kirsher
  2009-04-28  8:35 ` [net-next PATCH 2/6] igb: make rxcsum configuration seperate from multiqueue Jeff Kirsher
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Jeff Kirsher @ 2009-04-28  8:34 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, Alexander Duyck, Jeff Kirsher

From: Alexander Duyck <alexander.h.duyck@intel.com>

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>
---

 drivers/net/igb/e1000_mbx.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/igb/e1000_mbx.c b/drivers/net/igb/e1000_mbx.c
index 840782f..ed9058e 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)
 	struct e1000_mbx_info *mbx = &hw->mbx;
 	int countdown = mbx->timeout;
 
-	if (!mbx->ops.check_for_msg)
+	if (!countdown || !mbx->ops.check_for_msg)
 		goto out;
 
 	while (mbx->ops.check_for_msg(hw, mbx_id)) {
+		countdown--;
 		if (!countdown)
 			break;
-		countdown--;
 		udelay(mbx->usec_delay);
 	}
 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;
 	int countdown = mbx->timeout;
 
-	if (!mbx->ops.check_for_ack)
+	if (!countdown || !mbx->ops.check_for_ack)
 		goto out;
 
 	while (mbx->ops.check_for_ack(hw, mbx_id)) {
+		countdown--;
 		if (!countdown)
 			break;
-		countdown--;
 		udelay(mbx->usec_delay);
 	}
 out:


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-04-28  8:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-28  8:34 [net-next PATCH 1/6] igb: reconfigure mailbox timeout logic Jeff Kirsher
2009-04-28  8:35 ` [net-next PATCH 2/6] igb: make rxcsum configuration seperate from multiqueue Jeff Kirsher
2009-04-28  8:54   ` David Miller
2009-04-28  8:35 ` [net-next PATCH 3/6] igb/ixgbe: remove unecessary checks for CHECKSUM_UNNECESSARY Jeff Kirsher
2009-04-28  8:54   ` David Miller
2009-04-28  8:35 ` [net-next PATCH 4/6] sctp: add feature bit for SCTP offload in hardware Jeff Kirsher
2009-04-28  8:54   ` David Miller
2009-04-28  8:36 ` [net-next PATCH 5/6] igb: Enable SCTP checksum offloading Jeff Kirsher
2009-04-28  8:54   ` David Miller
2009-04-28  8:36 ` [net-next PATCH 6/6] ixgbe: enable hardware offload for sctp Jeff Kirsher
2009-04-28  8:55   ` David Miller
2009-04-28  8:54 ` [net-next PATCH 1/6] igb: reconfigure mailbox timeout logic David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).