linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] rt61pci: fix module reloading
@ 2009-08-02 18:30 Pavel Roskin
  2009-08-02 18:30 ` [PATCH 2/2] rt2x00: cancel all work on disconnect Pavel Roskin
  2009-08-04 17:12 ` [PATCH 1/2] rt61pci: fix module reloading Ivo van Doorn
  0 siblings, 2 replies; 4+ messages in thread
From: Pavel Roskin @ 2009-08-02 18:30 UTC (permalink / raw)
  To: linux-wireless, John Linville, users

Unloading rt61pci can leave the device in such state that reloading
rt61pci would fail to reinitialize it.  Bogus data would be read from
the EEPROM and the RF version won't be recognized.

It appears that unloading rt61pci with power saving enabled would have
such effect.  To initialize the device properly, SOFT_RESET_CSR should
be set to the same value as rt61pci_config_ps() uses to wake up the
device.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 drivers/net/wireless/rt2x00/rt61pci.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index fb95b8c..e20dd74 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2601,6 +2601,11 @@ static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev)
 	int retval;
 
 	/*
+	 * Disable power saving.
+	 */
+	rt2x00pci_register_write(rt2x00dev, SOFT_RESET_CSR, 0x00000007);
+
+	/*
 	 * Allocate eeprom data.
 	 */
 	retval = rt61pci_validate_eeprom(rt2x00dev);

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

* [PATCH 2/2] rt2x00: cancel all work on disconnect
  2009-08-02 18:30 [PATCH 1/2] rt61pci: fix module reloading Pavel Roskin
@ 2009-08-02 18:30 ` Pavel Roskin
  2009-08-04 17:09   ` [rt2x00-users] " Ivo van Doorn
  2009-08-04 17:12 ` [PATCH 1/2] rt61pci: fix module reloading Ivo van Doorn
  1 sibling, 1 reply; 4+ messages in thread
From: Pavel Roskin @ 2009-08-02 18:30 UTC (permalink / raw)
  To: linux-wireless, John Linville, users

Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 drivers/net/wireless/rt2x00/rt2x00dev.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 658a63b..b4c696d 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -893,6 +893,12 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
 	rt2x00lib_disable_radio(rt2x00dev);
 
 	/*
+	 * Stop all work.
+	 */
+	cancel_work_sync(&rt2x00dev->filter_work);
+	cancel_work_sync(&rt2x00dev->intf_work);
+
+	/*
 	 * Uninitialize device.
 	 */
 	rt2x00lib_uninitialize(rt2x00dev);

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

* Re: [rt2x00-users] [PATCH 2/2] rt2x00: cancel all work on disconnect
  2009-08-02 18:30 ` [PATCH 2/2] rt2x00: cancel all work on disconnect Pavel Roskin
@ 2009-08-04 17:09   ` Ivo van Doorn
  0 siblings, 0 replies; 4+ messages in thread
From: Ivo van Doorn @ 2009-08-04 17:09 UTC (permalink / raw)
  To: users; +Cc: Pavel Roskin, linux-wireless, John Linville

On Sunday 02 August 2009, Pavel Roskin wrote:
> Signed-off-by: Pavel Roskin <proski@gnu.org>

Thanks,

Acked-by: Ivo van Doorn <IvDoorn@gmail.com>

> ---
>  drivers/net/wireless/rt2x00/rt2x00dev.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
> index 658a63b..b4c696d 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00dev.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
> @@ -893,6 +893,12 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
>  	rt2x00lib_disable_radio(rt2x00dev);
>  
>  	/*
> +	 * Stop all work.
> +	 */
> +	cancel_work_sync(&rt2x00dev->filter_work);
> +	cancel_work_sync(&rt2x00dev->intf_work);
> +
> +	/*
>  	 * Uninitialize device.
>  	 */
>  	rt2x00lib_uninitialize(rt2x00dev);
> 
> _______________________________________________
> users mailing list
> users@rt2x00.serialmonkey.com
> http://rt2x00.serialmonkey.com/mailman/listinfo/users_rt2x00.serialmonkey.com
> 



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

* Re: [PATCH 1/2] rt61pci: fix module reloading
  2009-08-02 18:30 [PATCH 1/2] rt61pci: fix module reloading Pavel Roskin
  2009-08-02 18:30 ` [PATCH 2/2] rt2x00: cancel all work on disconnect Pavel Roskin
@ 2009-08-04 17:12 ` Ivo van Doorn
  1 sibling, 0 replies; 4+ messages in thread
From: Ivo van Doorn @ 2009-08-04 17:12 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: linux-wireless, John Linville, users

On Sunday 02 August 2009, Pavel Roskin wrote:
> Unloading rt61pci can leave the device in such state that reloading
> rt61pci would fail to reinitialize it.  Bogus data would be read from
> the EEPROM and the RF version won't be recognized.
> 
> It appears that unloading rt61pci with power saving enabled would have
> such effect.  To initialize the device properly, SOFT_RESET_CSR should
> be set to the same value as rt61pci_config_ps() uses to wake up the
> device.
> 
> Signed-off-by: Pavel Roskin <proski@gnu.org>

I'm not really happy with the patch, but if it works, it works.
I got no better alternative to fix this correctly so we might as well merge
this into wireless-testing now. :)

Thanks.

Acked-by: Ivo van Doorn <IvDoorn@gmail.com>

> ---
>  drivers/net/wireless/rt2x00/rt61pci.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
> index fb95b8c..e20dd74 100644
> --- a/drivers/net/wireless/rt2x00/rt61pci.c
> +++ b/drivers/net/wireless/rt2x00/rt61pci.c
> @@ -2601,6 +2601,11 @@ static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev)
>  	int retval;
>  
>  	/*
> +	 * Disable power saving.
> +	 */
> +	rt2x00pci_register_write(rt2x00dev, SOFT_RESET_CSR, 0x00000007);
> +
> +	/*
>  	 * Allocate eeprom data.
>  	 */
>  	retval = rt61pci_validate_eeprom(rt2x00dev);
> --
> 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
> 



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

end of thread, other threads:[~2009-08-04 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-02 18:30 [PATCH 1/2] rt61pci: fix module reloading Pavel Roskin
2009-08-02 18:30 ` [PATCH 2/2] rt2x00: cancel all work on disconnect Pavel Roskin
2009-08-04 17:09   ` [rt2x00-users] " Ivo van Doorn
2009-08-04 17:12 ` [PATCH 1/2] rt61pci: fix module reloading Ivo van Doorn

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