rt2800: initialize queues before giving up due to DMA error
authorJakub Kicinski <kubakici@wp.pl>
Tue, 3 Apr 2012 01:40:49 +0000 (03:40 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 13 Apr 2012 18:32:48 +0000 (14:32 -0400)
Don't immediately abort .start if DMA is busy before we
initialize the queues. Some drivers do not deinitialize
queues properly and we would fail to take over after them.

This behaviour is consistent with legacy driver.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2800lib.c
drivers/net/wireless/rt2x00/rt2800pci.c

index cc6ca183f3bf4c3114336e26de034ec45f541c51..bd1980202f19a5eae9bb33f449479884e27531dd 100644 (file)
@@ -290,7 +290,7 @@ int rt2800_wait_wpdma_ready(struct rt2x00_dev *rt2x00dev)
                msleep(10);
        }
 
-       ERROR(rt2x00dev, "WPDMA TX/RX busy, aborting.\n");
+       ERROR(rt2x00dev, "WPDMA TX/RX busy [0x%08x].\n", reg);
        return -EACCES;
 }
 EXPORT_SYMBOL_GPL(rt2800_wait_wpdma_ready);
index e499389d8cd35a7986f8deed95c041eda5285506..4366c23672f020eb313502e71802103c4e94af0e 100644 (file)
@@ -496,8 +496,10 @@ static int rt2800pci_enable_radio(struct rt2x00_dev *rt2x00dev)
 {
        int retval;
 
-       if (unlikely(rt2800_wait_wpdma_ready(rt2x00dev) ||
-                    rt2800pci_init_queues(rt2x00dev)))
+       /* Wait for DMA, ignore error until we initialize queues. */
+       rt2800_wait_wpdma_ready(rt2x00dev);
+
+       if (unlikely(rt2800pci_init_queues(rt2x00dev)))
                return -EIO;
 
        retval = rt2800_enable_radio(rt2x00dev);