linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: linux-wireless@vger.kernel.org,
	John Linville <linville@tuxdriver.com>,
	users@rt2x00.serialmonkey.com
Subject: [PATCH 1/2] rt61pci: fix module reloading
Date: Sun, 02 Aug 2009 14:30:02 -0400	[thread overview]
Message-ID: <20090802183002.16766.4142.stgit@ct.roinet.com> (raw)

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

             reply	other threads:[~2009-08-02 18:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-02 18:30 Pavel Roskin [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090802183002.16766.4142.stgit@ct.roinet.com \
    --to=proski@gnu.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=users@rt2x00.serialmonkey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).