netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] dev_open() and dev_close() require RTNL
@ 2008-05-06 18:26 Ben Hutchings
  2008-05-06 18:34 ` [PATCH 1/4] Added ASSERT_RTNL() to dev_open() and dev_close() Ben Hutchings
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Ben Hutchings @ 2008-05-06 18:26 UTC (permalink / raw)
  To: Jeff Garzik, David Miller; +Cc: netdev

dev_open() and dev_close() clearly require the RTNL, but this isn't
commented or asserted.  The following series adds assertions and fixes
three drivers that call dev_close() without holding the RTNL.  The
driver changes are only compile-tested.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.

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

* [PATCH 1/4] Added ASSERT_RTNL() to dev_open() and dev_close().
  2008-05-06 18:26 [PATCH 0/4] dev_open() and dev_close() require RTNL Ben Hutchings
@ 2008-05-06 18:34 ` Ben Hutchings
  2008-05-08  9:53   ` David Miller
  2008-05-06 18:36 ` [PATCH 2/4] qla3xxx: Hold RTNL while calling dev_close() Ben Hutchings
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 17+ messages in thread
From: Ben Hutchings @ 2008-05-06 18:34 UTC (permalink / raw)
  To: David Miller; +Cc: Jeff Garzik, netdev

dev_open() and dev_close() must be called holding the RTNL, since they
call device functions and netdevice notifiers that are promised the RTNL.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 net/core/dev.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index d334446..e76f4fd 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -994,6 +994,8 @@ int dev_open(struct net_device *dev)
 {
 	int ret = 0;
 
+	ASSERT_RTNL();
+
 	/*
 	 *	Is it already up?
 	 */
@@ -1060,6 +1062,8 @@ int dev_open(struct net_device *dev)
  */
 int dev_close(struct net_device *dev)
 {
+	ASSERT_RTNL();
+
 	might_sleep();
 
 	if (!(dev->flags & IFF_UP))

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.


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

* [PATCH 2/4] qla3xxx: Hold RTNL while calling dev_close()
  2008-05-06 18:26 [PATCH 0/4] dev_open() and dev_close() require RTNL Ben Hutchings
  2008-05-06 18:34 ` [PATCH 1/4] Added ASSERT_RTNL() to dev_open() and dev_close() Ben Hutchings
@ 2008-05-06 18:36 ` Ben Hutchings
  2008-05-08  9:53   ` David Miller
  2008-06-27  5:32   ` Jeff Garzik
  2008-05-06 18:39 ` [PATCH 3/4] sky2: " Ben Hutchings
  2008-05-06 18:41 ` [PATCH 4/4] Hold RTNL while calling dev_close() Ben Hutchings
  3 siblings, 2 replies; 17+ messages in thread
From: Ben Hutchings @ 2008-05-06 18:36 UTC (permalink / raw)
  To: Jeff Garzik, Ron Mercer; +Cc: David Miller, netdev

dev_close() must be called holding the RTNL.  Compile-tested only.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/qla3xxx.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index b7f7b22..bccee68 100644
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -3701,7 +3701,9 @@ static int ql_cycle_adapter(struct ql3_adapter *qdev, int reset)
 		printk(KERN_ERR PFX
 				"%s: Driver up/down cycle failed, "
 				"closing device\n",qdev->ndev->name);
+		rtnl_lock();
 		dev_close(qdev->ndev);
+		rtnl_unlock();
 		return -1;
 	}
 	return 0;

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.

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

* [PATCH 3/4] sky2: Hold RTNL while calling dev_close()
  2008-05-06 18:26 [PATCH 0/4] dev_open() and dev_close() require RTNL Ben Hutchings
  2008-05-06 18:34 ` [PATCH 1/4] Added ASSERT_RTNL() to dev_open() and dev_close() Ben Hutchings
  2008-05-06 18:36 ` [PATCH 2/4] qla3xxx: Hold RTNL while calling dev_close() Ben Hutchings
@ 2008-05-06 18:39 ` Ben Hutchings
  2008-05-06 20:26   ` Stephen Hemminger
  2008-05-06 23:17   ` Stephen Hemminger
  2008-05-06 18:41 ` [PATCH 4/4] Hold RTNL while calling dev_close() Ben Hutchings
  3 siblings, 2 replies; 17+ messages in thread
From: Ben Hutchings @ 2008-05-06 18:39 UTC (permalink / raw)
  To: Jeff Garzik, Stephen Hemminger; +Cc: David Miller, netdev

dev_close() must be called holding the RTNL.  Compile-tested only.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sky2.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index f226bca..9b046dd 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -2952,7 +2952,9 @@ static void sky2_restart(struct work_struct *work)
 			if (err) {
 				printk(KERN_INFO PFX "%s: could not restart %d\n",
 				       dev->name, err);
+				rtnl_lock();
 				dev_close(dev);
+				rtnl_unlock();
 			}
 		}
 	}

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.

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

* [PATCH 4/4] Hold RTNL while calling dev_close()
  2008-05-06 18:26 [PATCH 0/4] dev_open() and dev_close() require RTNL Ben Hutchings
                   ` (2 preceding siblings ...)
  2008-05-06 18:39 ` [PATCH 3/4] sky2: " Ben Hutchings
@ 2008-05-06 18:41 ` Ben Hutchings
  2008-05-08  9:54   ` David Miller
  2008-06-27  5:32   ` Jeff Garzik
  3 siblings, 2 replies; 17+ messages in thread
From: Ben Hutchings @ 2008-05-06 18:41 UTC (permalink / raw)
  To: Jeff Garzik, linux-x25; +Cc: David Miller, netdev

dev_close() must be called holding the RTNL.  Compile-tested only.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/wan/x25_asy.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index 249e180..069f8bb 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -32,6 +32,7 @@
 #include <linux/x25.h>
 #include <linux/lapb.h>
 #include <linux/init.h>
+#include <linux/rtnetlink.h>
 #include "x25_asy.h"
 
 #include <net/x25device.h>
@@ -601,8 +602,10 @@ static void x25_asy_close_tty(struct tty_struct *tty)
 	if (!sl || sl->magic != X25_ASY_MAGIC)
 		return;
 
+	rtnl_lock();
 	if (sl->dev->flags & IFF_UP)
 		dev_close(sl->dev);
+	rtnl_unlock();
 
 	tty->disc_data = NULL;
 	sl->tty = NULL;

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.

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

* Re: [PATCH 3/4] sky2: Hold RTNL while calling dev_close()
  2008-05-06 18:39 ` [PATCH 3/4] sky2: " Ben Hutchings
@ 2008-05-06 20:26   ` Stephen Hemminger
  2008-05-06 23:17   ` Stephen Hemminger
  1 sibling, 0 replies; 17+ messages in thread
From: Stephen Hemminger @ 2008-05-06 20:26 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Jeff Garzik, David Miller, netdev

On Tue, 6 May 2008 19:39:58 +0100
Ben Hutchings <bhutchings@solarflare.com> wrote:

> dev_close() must be called holding the RTNL.  Compile-tested only.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
>  drivers/net/sky2.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
> index f226bca..9b046dd 100644
> --- a/drivers/net/sky2.c
> +++ b/drivers/net/sky2.c
> @@ -2952,7 +2952,9 @@ static void sky2_restart(struct work_struct *work)
>  			if (err) {
>  				printk(KERN_INFO PFX "%s: could not restart %d\n",
>  				       dev->name, err);
> +				rtnl_lock();
>  				dev_close(dev);
> +				rtnl_unlock();
>  			}
>  		}
>  	}
> 

Ack, but this is in a real corner case so no need to send it to stable.

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

* Re: [PATCH 3/4] sky2: Hold RTNL while calling dev_close()
  2008-05-06 18:39 ` [PATCH 3/4] sky2: " Ben Hutchings
  2008-05-06 20:26   ` Stephen Hemminger
@ 2008-05-06 23:17   ` Stephen Hemminger
  2008-05-06 23:59     ` Ben Hutchings
  1 sibling, 1 reply; 17+ messages in thread
From: Stephen Hemminger @ 2008-05-06 23:17 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Jeff Garzik, David Miller, netdev

On Tue, 6 May 2008 19:39:58 +0100
Ben Hutchings <bhutchings@solarflare.com> wrote:

> dev_close() must be called holding the RTNL.  Compile-tested only.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
>  drivers/net/sky2.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
> index f226bca..9b046dd 100644
> --- a/drivers/net/sky2.c
> +++ b/drivers/net/sky2.c
> @@ -2952,7 +2952,9 @@ static void sky2_restart(struct work_struct *work)
>  			if (err) {
>  				printk(KERN_INFO PFX "%s: could not restart %d\n",
>  				       dev->name, err);
> +				rtnl_lock();
>  				dev_close(dev);
> +				rtnl_unlock();
>  			}
>  		}
>  	}
> 

No this is bogus.  The rtnl mutex is already held.
Look a little wider

static void sky2_restart(struct work_struct *work)
{
	struct sky2_hw *hw = container_of(work, struct sky2_hw, restart_work);
	struct net_device *dev;
	int i, err;

	rtnl_lock();
	for (i = 0; i < hw->ports; i++) {
		dev = hw->dev[i];
		if (netif_running(dev))
			sky2_down(dev);
	}

	napi_disable(&hw->napi);
	sky2_write32(hw, B0_IMSK, 0);
	sky2_reset(hw);
	sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
	napi_enable(&hw->napi);

	for (i = 0; i < hw->ports; i++) {
		dev = hw->dev[i];
		if (netif_running(dev)) {
			err = sky2_up(dev);
			if (err) {
				printk(KERN_INFO PFX "%s: could not restart %d\n",
				       dev->name, err);
				dev_close(dev);
			}
		}
	}

	rtnl_unlock();
}

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

* Re: [PATCH 3/4] sky2: Hold RTNL while calling dev_close()
  2008-05-06 23:17   ` Stephen Hemminger
@ 2008-05-06 23:59     ` Ben Hutchings
  2008-05-31 15:52       ` [PATCH] sky2: Hold RTNL while calling dev_close() [2nd try] Ben Hutchings
  0 siblings, 1 reply; 17+ messages in thread
From: Ben Hutchings @ 2008-05-06 23:59 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Jeff Garzik, David Miller, netdev

Stephen Hemminger wrote:
> On Tue, 6 May 2008 19:39:58 +0100
> Ben Hutchings <bhutchings@solarflare.com> wrote:
> 
> > dev_close() must be called holding the RTNL.  Compile-tested only.
> > 
> > Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> > ---
> >  drivers/net/sky2.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
> > index f226bca..9b046dd 100644
> > --- a/drivers/net/sky2.c
> > +++ b/drivers/net/sky2.c
> > @@ -2952,7 +2952,9 @@ static void sky2_restart(struct work_struct *work)
> >  			if (err) {
> >  				printk(KERN_INFO PFX "%s: could not restart %d\n",
> >  				       dev->name, err);
> > +				rtnl_lock();
> >  				dev_close(dev);
> > +				rtnl_unlock();
> >  			}
> >  		}
> >  	}
> > 
> 
> No this is bogus.  The rtnl mutex is already held.
> Look a little wider
<snip>

Sorry about that.  I made a list of functions to check and then edited
them in a second pass.  The function that needs locking in sky2.c is
sky2_resume() not sky2_restart().

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.

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

* Re: [PATCH 1/4] Added ASSERT_RTNL() to dev_open() and dev_close().
  2008-05-06 18:34 ` [PATCH 1/4] Added ASSERT_RTNL() to dev_open() and dev_close() Ben Hutchings
@ 2008-05-08  9:53   ` David Miller
  0 siblings, 0 replies; 17+ messages in thread
From: David Miller @ 2008-05-08  9:53 UTC (permalink / raw)
  To: bhutchings; +Cc: jgarzik, netdev

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Tue, 6 May 2008 19:34:06 +0100

> dev_open() and dev_close() must be called holding the RTNL, since they
> call device functions and netdevice notifiers that are promised the RTNL.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>

Applied, thanks Ben.

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

* Re: [PATCH 2/4] qla3xxx: Hold RTNL while calling dev_close()
  2008-05-06 18:36 ` [PATCH 2/4] qla3xxx: Hold RTNL while calling dev_close() Ben Hutchings
@ 2008-05-08  9:53   ` David Miller
  2008-06-27  5:32   ` Jeff Garzik
  1 sibling, 0 replies; 17+ messages in thread
From: David Miller @ 2008-05-08  9:53 UTC (permalink / raw)
  To: bhutchings; +Cc: jgarzik, linux-driver, netdev

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Tue, 6 May 2008 19:36:26 +0100

> dev_close() must be called holding the RTNL.  Compile-tested only.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>

Acked-by: David S. Miller <davem@davemloft.net>

Jeff, please pick this up if you haven't already.

Thanks!

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

* Re: [PATCH 4/4] Hold RTNL while calling dev_close()
  2008-05-06 18:41 ` [PATCH 4/4] Hold RTNL while calling dev_close() Ben Hutchings
@ 2008-05-08  9:54   ` David Miller
  2008-06-27  5:32   ` Jeff Garzik
  1 sibling, 0 replies; 17+ messages in thread
From: David Miller @ 2008-05-08  9:54 UTC (permalink / raw)
  To: bhutchings; +Cc: jgarzik, linux-x25, netdev

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Tue, 6 May 2008 19:41:48 +0100

> dev_close() must be called holding the RTNL.  Compile-tested only.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>

Acked-by: David S. Miller <davem@davemloft.net>

Jeff, please grab this one too.

Thanks.

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

* [PATCH] sky2: Hold RTNL while calling dev_close() [2nd try]
  2008-05-06 23:59     ` Ben Hutchings
@ 2008-05-31 15:52       ` Ben Hutchings
  2008-06-10 22:16         ` Jeff Garzik
  2008-06-10 22:40         ` Jeff Garzik
  0 siblings, 2 replies; 17+ messages in thread
From: Ben Hutchings @ 2008-05-31 15:52 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Jeff Garzik, David Miller, netdev

dev_close() must be called holding the RTNL.  Compile-tested only.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sky2.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index f226bca..b9bdf88 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -4395,7 +4395,9 @@ static int sky2_resume(struct pci_dev *pdev)
 			if (err) {
 				printk(KERN_ERR PFX "%s: could not up: %d\n",
 				       dev->name, err);
+				rtnl_lock();
 				dev_close(dev);
+				rtnl_unlock();
 				goto out;
 			}
 		}

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.

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

* Re: [PATCH] sky2: Hold RTNL while calling dev_close() [2nd try]
  2008-05-31 15:52       ` [PATCH] sky2: Hold RTNL while calling dev_close() [2nd try] Ben Hutchings
@ 2008-06-10 22:16         ` Jeff Garzik
  2008-06-10 22:25           ` Stephen Hemminger
  2008-06-10 22:40         ` Jeff Garzik
  1 sibling, 1 reply; 17+ messages in thread
From: Jeff Garzik @ 2008-06-10 22:16 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Stephen Hemminger, David Miller, netdev

Ben Hutchings wrote:
> dev_close() must be called holding the RTNL.  Compile-tested only.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
>  drivers/net/sky2.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
> index f226bca..b9bdf88 100644
> --- a/drivers/net/sky2.c
> +++ b/drivers/net/sky2.c
> @@ -4395,7 +4395,9 @@ static int sky2_resume(struct pci_dev *pdev)
>  			if (err) {
>  				printk(KERN_ERR PFX "%s: could not up: %d\n",
>  				       dev->name, err);
> +				rtnl_lock();
>  				dev_close(dev);
> +				rtnl_unlock();
>  				goto out;
>  			}

stephen acked this?  I don't see that in my notes...



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

* Re: [PATCH] sky2: Hold RTNL while calling dev_close() [2nd try]
  2008-06-10 22:16         ` Jeff Garzik
@ 2008-06-10 22:25           ` Stephen Hemminger
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Hemminger @ 2008-06-10 22:25 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Ben Hutchings, David Miller, netdev

On Tue, 10 Jun 2008 18:16:42 -0400
Jeff Garzik <jgarzik@pobox.com> wrote:

> Ben Hutchings wrote:
> > dev_close() must be called holding the RTNL.  Compile-tested only.
> > 
> > Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> > ---
> >  drivers/net/sky2.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
> > index f226bca..b9bdf88 100644
> > --- a/drivers/net/sky2.c
> > +++ b/drivers/net/sky2.c
> > @@ -4395,7 +4395,9 @@ static int sky2_resume(struct pci_dev *pdev)
> >  			if (err) {
> >  				printk(KERN_ERR PFX "%s: could not up: %d\n",
> >  				       dev->name, err);
> > +				rtnl_lock();
> >  				dev_close(dev);
> > +				rtnl_unlock();
> >  				goto out;
> >  			}
> 
> stephen acked this?  I don't see that in my notes...
> 
> 

yes. this should go in

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

* Re: [PATCH] sky2: Hold RTNL while calling dev_close() [2nd try]
  2008-05-31 15:52       ` [PATCH] sky2: Hold RTNL while calling dev_close() [2nd try] Ben Hutchings
  2008-06-10 22:16         ` Jeff Garzik
@ 2008-06-10 22:40         ` Jeff Garzik
  1 sibling, 0 replies; 17+ messages in thread
From: Jeff Garzik @ 2008-06-10 22:40 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Stephen Hemminger, David Miller, netdev

Ben Hutchings wrote:
> dev_close() must be called holding the RTNL.  Compile-tested only.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
>  drivers/net/sky2.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
> index f226bca..b9bdf88 100644
> --- a/drivers/net/sky2.c
> +++ b/drivers/net/sky2.c
> @@ -4395,7 +4395,9 @@ static int sky2_resume(struct pci_dev *pdev)
>  			if (err) {
>  				printk(KERN_ERR PFX "%s: could not up: %d\n",
>  				       dev->name, err);
> +				rtnl_lock();
>  				dev_close(dev);
> +				rtnl_unlock();
>  				goto out;

applied



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

* Re: [PATCH 4/4] Hold RTNL while calling dev_close()
  2008-05-06 18:41 ` [PATCH 4/4] Hold RTNL while calling dev_close() Ben Hutchings
  2008-05-08  9:54   ` David Miller
@ 2008-06-27  5:32   ` Jeff Garzik
  1 sibling, 0 replies; 17+ messages in thread
From: Jeff Garzik @ 2008-06-27  5:32 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: linux-x25, David Miller, netdev

Ben Hutchings wrote:
> dev_close() must be called holding the RTNL.  Compile-tested only.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
>  drivers/net/wan/x25_asy.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)

applied



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

* Re: [PATCH 2/4] qla3xxx: Hold RTNL while calling dev_close()
  2008-05-06 18:36 ` [PATCH 2/4] qla3xxx: Hold RTNL while calling dev_close() Ben Hutchings
  2008-05-08  9:53   ` David Miller
@ 2008-06-27  5:32   ` Jeff Garzik
  1 sibling, 0 replies; 17+ messages in thread
From: Jeff Garzik @ 2008-06-27  5:32 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Ron Mercer, David Miller, netdev

Ben Hutchings wrote:
> dev_close() must be called holding the RTNL.  Compile-tested only.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
>  drivers/net/qla3xxx.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
> index b7f7b22..bccee68 100644
> --- a/drivers/net/qla3xxx.c
> +++ b/drivers/net/qla3xxx.c
> @@ -3701,7 +3701,9 @@ static int ql_cycle_adapter(struct ql3_adapter *qdev, int reset)
>  		printk(KERN_ERR PFX
>  				"%s: Driver up/down cycle failed, "
>  				"closing device\n",qdev->ndev->name);
> +		rtnl_lock();
>  		dev_close(qdev->ndev);
> +		rtnl_unlock();
>  		return -1;

applied



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

end of thread, other threads:[~2008-06-27  5:32 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-06 18:26 [PATCH 0/4] dev_open() and dev_close() require RTNL Ben Hutchings
2008-05-06 18:34 ` [PATCH 1/4] Added ASSERT_RTNL() to dev_open() and dev_close() Ben Hutchings
2008-05-08  9:53   ` David Miller
2008-05-06 18:36 ` [PATCH 2/4] qla3xxx: Hold RTNL while calling dev_close() Ben Hutchings
2008-05-08  9:53   ` David Miller
2008-06-27  5:32   ` Jeff Garzik
2008-05-06 18:39 ` [PATCH 3/4] sky2: " Ben Hutchings
2008-05-06 20:26   ` Stephen Hemminger
2008-05-06 23:17   ` Stephen Hemminger
2008-05-06 23:59     ` Ben Hutchings
2008-05-31 15:52       ` [PATCH] sky2: Hold RTNL while calling dev_close() [2nd try] Ben Hutchings
2008-06-10 22:16         ` Jeff Garzik
2008-06-10 22:25           ` Stephen Hemminger
2008-06-10 22:40         ` Jeff Garzik
2008-05-06 18:41 ` [PATCH 4/4] Hold RTNL while calling dev_close() Ben Hutchings
2008-05-08  9:54   ` David Miller
2008-06-27  5:32   ` Jeff Garzik

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).