netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ibmveth: lost IRQ while closing/opening device leads to service loss
@ 2010-07-15 20:21 Robert Jennings
  2010-07-16 14:57 ` [PATCH] " Robert Jennings
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Jennings @ 2010-07-15 20:21 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Santiago Leon, Brian King

The order of freeing the IRQ and freeing the device in firmware
in ibmveth_close can cause the adapter to become unusable after a
subsequent ibmveth_open.  Only a reboot of the OS will make the
network device usable again.  This is seen when cycling the adapter
up and down while there is network activity.

There is a window where an IRQ will be left unserviced (H_EOI will not
be called).  The solution is to make a VIO_IRQ_DISABLE h_call, free the
device with firmware, and then call free_irq.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>

---
 drivers/net/ibmveth.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: b/drivers/net/ibmveth.c
===================================================================
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -677,7 +677,7 @@ static int ibmveth_close(struct net_devi
 	if (!adapter->pool_config)
 		netif_stop_queue(netdev);
 
-	free_irq(netdev->irq, netdev);
+	h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE);
 
 	do {
 		lpar_rc = h_free_logical_lan(adapter->vdev->unit_address);
@@ -689,6 +689,8 @@ static int ibmveth_close(struct net_devi
 				     lpar_rc);
 	}
 
+	free_irq(netdev->irq, netdev);
+
 	adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8);
 
 	ibmveth_cleanup(adapter);


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

* [PATCH] ibmveth: lost IRQ while closing/opening device leads to service loss
  2010-07-15 20:21 ibmveth: lost IRQ while closing/opening device leads to service loss Robert Jennings
@ 2010-07-16 14:57 ` Robert Jennings
  2010-07-16 20:16   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Jennings @ 2010-07-16 14:57 UTC (permalink / raw)
  To: netdev, David S. Miller, Santiago Leon, Brian King

The order of freeing the IRQ and freeing the device in firmware
in ibmveth_close can cause the adapter to become unusable after a
subsequent ibmveth_open.  Only a reboot of the OS will make the
network device usable again. This is seen when cycling the adapter
up and down while there is network activity.

There is a window where an IRQ will be left unserviced (H_EOI will not
be called).  The solution is to make a VIO_IRQ_DISABLE h_call, free the
device with firmware, and then call free_irq.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>

---
No changes to the patch, I realized I left out '[PATCH]' in the subject
and I didn't want any automated tools missing this fix.

---
 drivers/net/ibmveth.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: b/drivers/net/ibmveth.c
===================================================================
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -677,7 +677,7 @@ static int ibmveth_close(struct net_devi
 	if (!adapter->pool_config)
 		netif_stop_queue(netdev);
 
-	free_irq(netdev->irq, netdev);
+	h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE);
 
 	do {
 		lpar_rc = h_free_logical_lan(adapter->vdev->unit_address);
@@ -689,6 +689,8 @@ static int ibmveth_close(struct net_devi
 				     lpar_rc);
 	}
 
+	free_irq(netdev->irq, netdev);
+
 	adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8);
 
 	ibmveth_cleanup(adapter);

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

* Re: [PATCH] ibmveth: lost IRQ while closing/opening device leads to service loss
  2010-07-16 14:57 ` [PATCH] " Robert Jennings
@ 2010-07-16 20:16   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-07-16 20:16 UTC (permalink / raw)
  To: rcj; +Cc: netdev, santil, brking

From: Robert Jennings <rcj@linux.vnet.ibm.com>
Date: Fri, 16 Jul 2010 09:57:25 -0500

> The order of freeing the IRQ and freeing the device in firmware
> in ibmveth_close can cause the adapter to become unusable after a
> subsequent ibmveth_open.  Only a reboot of the OS will make the
> network device usable again. This is seen when cycling the adapter
> up and down while there is network activity.
> 
> There is a window where an IRQ will be left unserviced (H_EOI will not
> be called).  The solution is to make a VIO_IRQ_DISABLE h_call, free the
> device with firmware, and then call free_irq.
> 
> Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>

Applied, thanks.

> No changes to the patch, I realized I left out '[PATCH]' in the subject
> and I didn't want any automated tools missing this fix.

Rules may be sometimes seen as anal, but they are not _that_ anal.

Also you can always look in patchwork to see if your change is
there, and your original patch was.

You actually make more work for me if you resubmit patches already
sitting in the queue :-/

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

end of thread, other threads:[~2010-07-16 20:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-15 20:21 ibmveth: lost IRQ while closing/opening device leads to service loss Robert Jennings
2010-07-16 14:57 ` [PATCH] " Robert Jennings
2010-07-16 20:16   ` 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).