[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1277825078-2992-1-git-send-email-leitao@linux.vnet.ibm.com>
Date: Tue, 29 Jun 2010 12:24:38 -0300
From: leitao@...ux.vnet.ibm.com
To: ron.mercer@...gic.com
Cc: netdev@...r.kernel.org, Breno Leitao <leitao@...ux.vnet.ibm.com>
Subject: [PATCH -next] qlge: fix a eeh handler to not add a pending timer
On some ocasions the function qlge_io_resume() tries to add a
pending timer, which causes the system to hit the BUG() on
add_timer() function.
This patch only add a new timer if the timer is not pending, if so,
it just reload it.
Signed-off-by: Breno Leitao <leitao@...ux.vnet.ibm.com>
---
drivers/net/qlge/qlge_main.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index fa4b24c..7b10521 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -4808,8 +4808,14 @@ static void qlge_io_resume(struct pci_dev *pdev)
netif_err(qdev, ifup, qdev->ndev,
"Device was not running prior to EEH.\n");
}
- qdev->timer.expires = jiffies + (5*HZ);
- add_timer(&qdev->timer);
+
+ if (timer_pending(&qdev->timer))
+ mod_timer(&qdev->timer, jiffies + (5*HZ));
+ else{
+ qdev->timer.expires = jiffies + (5*HZ);
+ add_timer(&qdev->timer);
+ }
+
netif_device_attach(ndev);
}
--
1.6.5.2
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists