rt2x00: Wakeup hardware before loading firmware
authorIvo van Doorn <ivdoorn@gmail.com>
Mon, 30 Aug 2010 19:13:54 +0000 (21:13 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 31 Aug 2010 18:22:24 +0000 (14:22 -0400)
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2800lib.c
drivers/net/wireless/rt2x00/rt2800pci.c

index 1a8170068b1c11b48b379ee6c6176312975829d1..a5455f46cec1f6abaaabab51223b63604e63efef 100644 (file)
@@ -384,6 +384,12 @@ int rt2800_load_firmware(struct rt2x00_dev *rt2x00dev,
        unsigned int i;
        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.
         */
index 4d93204b221f33e1b36587e3586305d6692f79f9..2bcb1507e3ac57289e536a8646f34b24b7818eec 100644 (file)
@@ -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
         */