diff mbox

rt2x00dev: cancel all work on disconnect

Message ID 20090729200711.3784.16212.stgit@mj.roinet.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Pavel Roskin July 29, 2009, 8:07 p.m. UTC
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 drivers/net/wireless/rt2x00/rt2x00dev.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Ivo van Doorn July 30, 2009, 6:45 p.m. UTC | #1
Hi,

I assume fixes the bug Michael reported on Linux-wireless yesterday?
The patch looks good, but I have some minor modification request:

On Wednesday 29 July 2009, Pavel Roskin wrote:
> Signed-off-by: Pavel Roskin <proski@gnu.org>
> ---
>  drivers/net/wireless/rt2x00/rt2x00dev.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
> index 658a63b..66b303b 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00dev.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
> @@ -888,6 +888,13 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
>  	clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
>  
>  	/*
> +	 * Cancel all work.
> +	 */
> +	rt2x00link_stop_tuner(rt2x00dev);

This one isn't needed. rt2x00lib_disable_radio() is doing this.

> +	cancel_work_sync(&rt2x00dev->filter_work);
> +	cancel_work_sync(&rt2x00dev->intf_work);

Could you move these 2 until after the call to rt2x00lib_disable_radio()?

> +	/*
>  	 * Disable radio.
>  	 */
>  	rt2x00lib_disable_radio(rt2x00dev);

Thanks,

Ivo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michael Buesch July 30, 2009, 6:58 p.m. UTC | #2
On Thursday 30 July 2009 20:45:15 Ivo van Doorn wrote:
> Hi,
> 
> I assume fixes the bug Michael reported on Linux-wireless yesterday?

I didn't test that, yet, but the patch looks sane anyway.

> The patch looks good, but I have some minor modification request:
> 
> On Wednesday 29 July 2009, Pavel Roskin wrote:
> > Signed-off-by: Pavel Roskin <proski@gnu.org>
> > ---
> >  drivers/net/wireless/rt2x00/rt2x00dev.c |    7 +++++++
> >  1 files changed, 7 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
> > index 658a63b..66b303b 100644
> > --- a/drivers/net/wireless/rt2x00/rt2x00dev.c
> > +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
> > @@ -888,6 +888,13 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
> >  	clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
> >  
> >  	/*
> > +	 * Cancel all work.
> > +	 */
> > +	rt2x00link_stop_tuner(rt2x00dev);
> 
> This one isn't needed. rt2x00lib_disable_radio() is doing this.
> 
> > +	cancel_work_sync(&rt2x00dev->filter_work);
> > +	cancel_work_sync(&rt2x00dev->intf_work);
> 
> Could you move these 2 until after the call to rt2x00lib_disable_radio()?
> 
> > +	/*
> >  	 * Disable radio.
> >  	 */
> >  	rt2x00lib_disable_radio(rt2x00dev);
> 
> Thanks,
> 
> Ivo
> 
>
diff mbox

Patch

diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 658a63b..66b303b 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -888,6 +888,13 @@  void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
 	clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
 
 	/*
+	 * Cancel all work.
+	 */
+	rt2x00link_stop_tuner(rt2x00dev);
+	cancel_work_sync(&rt2x00dev->filter_work);
+	cancel_work_sync(&rt2x00dev->intf_work);
+
+	/*
 	 * Disable radio.
 	 */
 	rt2x00lib_disable_radio(rt2x00dev);