b43: Add fastpath to b43_mac_suspend()
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / b43 / main.c
index 345c34bdae9ad1d4d80f62471969fee6541f1336..cf5c046c9fa8e2539cf109239d578897b6afb6f3 100644 (file)
@@ -2343,6 +2343,13 @@ static void b43_mac_suspend(struct b43_wldev *dev)
                            & ~B43_MACCTL_ENABLED);
                /* force pci to flush the write */
                b43_read32(dev, B43_MMIO_MACCTL);
+               for (i = 35; i; i--) {
+                       tmp = b43_read32(dev, B43_MMIO_GEN_IRQ_REASON);
+                       if (tmp & B43_IRQ_MAC_SUSPENDED)
+                               goto out;
+                       udelay(10);
+               }
+               /* Hm, it seems this will take some time. Use msleep(). */
                for (i = 40; i; i--) {
                        tmp = b43_read32(dev, B43_MMIO_GEN_IRQ_REASON);
                        if (tmp & B43_IRQ_MAC_SUSPENDED)