* [PATCH -next] qlge: fix a eeh handler to not add a pending timer
@ 2010-06-29 15:24 leitao
0 siblings, 0 replies; only message in thread
From: leitao @ 2010-06-29 15:24 UTC (permalink / raw)
To: ron.mercer; +Cc: netdev, Breno Leitao
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@linux.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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-06-29 15:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-29 15:24 [PATCH -next] qlge: fix a eeh handler to not add a pending timer leitao
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).