netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] qlge: Replacing add_timer() to mod_timer()
@ 2010-07-01 13:00 leitao
  2010-07-01 13:00 ` [PATCH 2/2] qlge: fix a eeh handler to not add a pending timer leitao
  2010-07-03  4:59 ` [PATCH 1/2] qlge: Replacing add_timer() to mod_timer() David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: leitao @ 2010-07-01 13:00 UTC (permalink / raw)
  To: davem; +Cc: netdev, Breno Leitao, Ron Mercer

Currently qlge driver calls add_timer() instead of mod_timer().
This patch changes add_timer() to mod_timer(), which seems a better
solution.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
---
 drivers/net/qlge/qlge_main.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index fa4b24c..509dadc 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -4611,8 +4611,7 @@ static void ql_timer(unsigned long data)
 		return;
 	}
 
-	qdev->timer.expires = jiffies + (5*HZ);
-	add_timer(&qdev->timer);
+	mod_timer(&qdev->timer, jiffies + (5*HZ));
 }
 
 static int __devinit qlge_probe(struct pci_dev *pdev,
@@ -4808,8 +4807,7 @@ 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);
+	mod_timer(&qdev->timer, jiffies + (5*HZ));
 	netif_device_attach(ndev);
 }
 
@@ -4871,8 +4869,7 @@ static int qlge_resume(struct pci_dev *pdev)
 			return err;
 	}
 
-	qdev->timer.expires = jiffies + (5*HZ);
-	add_timer(&qdev->timer);
+	mod_timer(&qdev->timer, jiffies + (5*HZ));
 	netif_device_attach(ndev);
 
 	return 0;
-- 
1.6.5.2


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

* [PATCH 2/2] qlge: fix a eeh handler to not add a pending timer
  2010-07-01 13:00 [PATCH 1/2] qlge: Replacing add_timer() to mod_timer() leitao
@ 2010-07-01 13:00 ` leitao
  2010-07-03  4:59   ` David Miller
  2010-07-03  4:59 ` [PATCH 1/2] qlge: Replacing add_timer() to mod_timer() David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: leitao @ 2010-07-01 13:00 UTC (permalink / raw)
  To: davem; +Cc: netdev, Breno Leitao, Ron Mercer

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 removes the timer during the EEH recovery.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
---
 drivers/net/qlge/qlge_main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 509dadc..d10bcef 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -4712,6 +4712,8 @@ static void ql_eeh_close(struct net_device *ndev)
 		netif_stop_queue(ndev);
 	}
 
+	/* Disabling the timer */
+	del_timer_sync(&qdev->timer);
 	if (test_bit(QL_ADAPTER_UP, &qdev->flags))
 		cancel_delayed_work_sync(&qdev->asic_reset_work);
 	cancel_delayed_work_sync(&qdev->mpi_reset_work);
-- 
1.6.5.2


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

* Re: [PATCH 1/2] qlge: Replacing add_timer() to mod_timer()
  2010-07-01 13:00 [PATCH 1/2] qlge: Replacing add_timer() to mod_timer() leitao
  2010-07-01 13:00 ` [PATCH 2/2] qlge: fix a eeh handler to not add a pending timer leitao
@ 2010-07-03  4:59 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2010-07-03  4:59 UTC (permalink / raw)
  To: leitao; +Cc: netdev, ron.mercer

From: leitao@linux.vnet.ibm.com
Date: Thu,  1 Jul 2010 10:00:17 -0300

> Currently qlge driver calls add_timer() instead of mod_timer().
> This patch changes add_timer() to mod_timer(), which seems a better
> solution.
> 
> Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
> Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>

Applied.

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

* Re: [PATCH 2/2] qlge: fix a eeh handler to not add a pending timer
  2010-07-01 13:00 ` [PATCH 2/2] qlge: fix a eeh handler to not add a pending timer leitao
@ 2010-07-03  4:59   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-07-03  4:59 UTC (permalink / raw)
  To: leitao; +Cc: netdev, ron.mercer

From: leitao@linux.vnet.ibm.com
Date: Thu,  1 Jul 2010 10:00:18 -0300

> 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 removes the timer during the EEH recovery.
> 
> Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
> Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>

Applied.

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

end of thread, other threads:[~2010-07-03  4:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-01 13:00 [PATCH 1/2] qlge: Replacing add_timer() to mod_timer() leitao
2010-07-01 13:00 ` [PATCH 2/2] qlge: fix a eeh handler to not add a pending timer leitao
2010-07-03  4:59   ` David Miller
2010-07-03  4:59 ` [PATCH 1/2] qlge: Replacing add_timer() to mod_timer() 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).