netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv1 net] xen-netback: stop the VIF thread before unbinding IRQs
@ 2013-11-21 15:26 David Vrabel
  2013-11-21 15:50 ` Wei Liu
  2013-11-21 18:17 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: David Vrabel @ 2013-11-21 15:26 UTC (permalink / raw)
  To: xen-devel
  Cc: David Vrabel, Konrad Rzeszutek Wilk, Boris Ostrovsky,
	Ian Campbell, Wei Liu, netdev

From: David Vrabel <david.vrabel@citrix.com>

If the VIF thread is still running after unbinding the Tx and Rx IRQs
in xenvif_disconnect(), the thread may attempt to raise an event which
will BUG (as the irq is unbound).

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
 drivers/net/xen-netback/interface.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index b78ee10..2329ccc 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -461,6 +461,9 @@ void xenvif_disconnect(struct xenvif *vif)
 	if (netif_carrier_ok(vif->dev))
 		xenvif_carrier_off(vif);
 
+	if (vif->task)
+		kthread_stop(vif->task);
+
 	if (vif->tx_irq) {
 		if (vif->tx_irq == vif->rx_irq)
 			unbind_from_irqhandler(vif->tx_irq, vif);
@@ -471,9 +474,6 @@ void xenvif_disconnect(struct xenvif *vif)
 		vif->tx_irq = 0;
 	}
 
-	if (vif->task)
-		kthread_stop(vif->task);
-
 	xenvif_unmap_frontend_rings(vif);
 }
 
-- 
1.7.2.5

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

* Re: [PATCHv1 net] xen-netback: stop the VIF thread before unbinding IRQs
  2013-11-21 15:26 [PATCHv1 net] xen-netback: stop the VIF thread before unbinding IRQs David Vrabel
@ 2013-11-21 15:50 ` Wei Liu
  2013-11-21 18:17 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Wei Liu @ 2013-11-21 15:50 UTC (permalink / raw)
  To: David Vrabel
  Cc: xen-devel, Konrad Rzeszutek Wilk, Boris Ostrovsky, Ian Campbell,
	Wei Liu, netdev

On Thu, Nov 21, 2013 at 03:26:09PM +0000, David Vrabel wrote:
> From: David Vrabel <david.vrabel@citrix.com>
> 
> If the VIF thread is still running after unbinding the Tx and Rx IRQs
> in xenvif_disconnect(), the thread may attempt to raise an event which
> will BUG (as the irq is unbound).
> 
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

Thanks
Wei.

> ---
>  drivers/net/xen-netback/interface.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
> index b78ee10..2329ccc 100644
> --- a/drivers/net/xen-netback/interface.c
> +++ b/drivers/net/xen-netback/interface.c
> @@ -461,6 +461,9 @@ void xenvif_disconnect(struct xenvif *vif)
>  	if (netif_carrier_ok(vif->dev))
>  		xenvif_carrier_off(vif);
>  
> +	if (vif->task)
> +		kthread_stop(vif->task);
> +
>  	if (vif->tx_irq) {
>  		if (vif->tx_irq == vif->rx_irq)
>  			unbind_from_irqhandler(vif->tx_irq, vif);
> @@ -471,9 +474,6 @@ void xenvif_disconnect(struct xenvif *vif)
>  		vif->tx_irq = 0;
>  	}
>  
> -	if (vif->task)
> -		kthread_stop(vif->task);
> -
>  	xenvif_unmap_frontend_rings(vif);
>  }
>  
> -- 
> 1.7.2.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCHv1 net] xen-netback: stop the VIF thread before unbinding IRQs
  2013-11-21 15:26 [PATCHv1 net] xen-netback: stop the VIF thread before unbinding IRQs David Vrabel
  2013-11-21 15:50 ` Wei Liu
@ 2013-11-21 18:17 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-11-21 18:17 UTC (permalink / raw)
  To: david.vrabel
  Cc: xen-devel, konrad.wilk, boris.ostrovsky, ian.campbell, wei.liu2, netdev

From: David Vrabel <david.vrabel@citrix.com>
Date: Thu, 21 Nov 2013 15:26:09 +0000

> From: David Vrabel <david.vrabel@citrix.com>
> 
> If the VIF thread is still running after unbinding the Tx and Rx IRQs
> in xenvif_disconnect(), the thread may attempt to raise an event which
> will BUG (as the irq is unbound).
> 
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>

Applied.

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

end of thread, other threads:[~2013-11-21 18:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-21 15:26 [PATCHv1 net] xen-netback: stop the VIF thread before unbinding IRQs David Vrabel
2013-11-21 15:50 ` Wei Liu
2013-11-21 18:17 ` 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).