linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com
Subject: [PATCH 05/10] rt2x00: Wakeup hardware before loading firmware
Date: Mon, 30 Aug 2010 21:13:54 +0200	[thread overview]
Message-ID: <201008302113.55101.IvDoorn@gmail.com> (raw)
In-Reply-To: <201008302113.31006.IvDoorn@gmail.com>

According to the legacy drivers the AUTOWAKEUP_CFG
register must be reset to 0 before loading the firmware.

Instead of during rt2800{pci,usb}_write_firmware it
must actually be done in rt2800_load_firmware() before
resetting the WPDMA_GLO_CFG and PWR_PIN_CFG registers.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
 drivers/net/wireless/rt2x00/rt2800lib.c |    6 ++++++
 drivers/net/wireless/rt2x00/rt2800pci.c |    2 --
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index c8af221..1bc7f49 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -385,6 +385,12 @@ int rt2800_load_firmware(struct rt2x00_dev *rt2x00dev,
 	u32 reg;
 
 	/*
+	 * If driver doesn't wake up firmware here,
+	 * rt2800_load_firmware will hang forever when interface is up again.
+	 */
+	rt2800_register_write(rt2x00dev, AUTOWAKEUP_CFG, 0x00000000);
+
+	/*
 	 * Wait for stable hardware.
 	 */
 	if (rt2800_wait_csr_ready(rt2x00dev))
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 4d93204..2bcb150 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -196,8 +196,6 @@ static int rt2800pci_write_firmware(struct rt2x00_dev *rt2x00dev,
 {
 	u32 reg;
 
-	rt2800_register_write(rt2x00dev, AUTOWAKEUP_CFG, 0x00000000);
-
 	/*
 	 * enable Host program ram write selection
 	 */
-- 
1.7.2.2


  reply	other threads:[~2010-08-30 19:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-30 19:12 [PATCH 01/10] rt2x00: Rename txentry_desc.queue -> txentry_desc.qid Ivo van Doorn
2010-08-30 19:12 ` [PATCH 02/10] rt2x00: Update rt2800 comments regarding AMPDU and PACKET_ID in TXWI Ivo van Doorn
2010-08-30 19:13   ` [PATCH 03/10] rt2x00: Add rt2800_wait_csr_ready Ivo van Doorn
2010-08-30 19:13     ` [PATCH 04/10] rt2x00: Validate TX status results with current data entry Ivo van Doorn
2010-08-30 19:13       ` Ivo van Doorn [this message]
2010-08-30 19:14         ` [PATCH 06/10] rt2x00: Don't set unicast/BSSID masks when clearning MAC or BSSID Ivo van Doorn
2010-08-30 19:14           ` [PATCH 07/10] rt2x00: Set PWR_PIN_CFG during initialization Ivo van Doorn
2010-08-30 19:14             ` [PATCH 08/10] rt2x00: Correctly kill beacon queue Ivo van Doorn
2010-08-30 19:15               ` [PATCH 09/10] rt2x00: Split watchdog check into a DMA and STATUS timeout Ivo van Doorn
2010-08-30 19:15                 ` [PATCH 10/10] rt2x00: Cleanup rt2x00usb_watchdog_reset_tx 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=201008302113.55101.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --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).