aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-04-15 15:13:36 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-16 15:59:59 -0400
commitba380013b681e91e059f95b51002f8d43024b371 (patch)
treef2b77c5d9a421f59396321bd319241dc5074118c /drivers/net
parent059ff8266104d4919c693d6bf974c9e350da513e (diff)
b43: Add fastpath to b43_mac_suspend()
This adds a fastpath for the common workloads to the MAC suspend flushing. In common workloads the FIFO flush will take between 100 and 200 microseconds. So we want to avoid calling msleep() in the common case, as it will waste over 800 microseconds + scheduler overhead. This fastpath will hit in workloads where only small chunks of data are transmitted (downloading a file) or when a TX rate bigger or equal to 24MBit/s is used when transmitting lots of stuff (iperf). So in the commonly used workloads it will basically always hit. In case the fastpath is not hit, there's no real performance or latency disadvantage from that. And yes, I measured this. So this is not one of these bad Programmer Likeliness Assumptions that are always wrong. ;) Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/b43/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 345c34bdae9a..cf5c046c9fa8 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2343,6 +2343,13 @@ static void b43_mac_suspend(struct b43_wldev *dev)
2343 & ~B43_MACCTL_ENABLED); 2343 & ~B43_MACCTL_ENABLED);
2344 /* force pci to flush the write */ 2344 /* force pci to flush the write */
2345 b43_read32(dev, B43_MMIO_MACCTL); 2345 b43_read32(dev, B43_MMIO_MACCTL);
2346 for (i = 35; i; i--) {
2347 tmp = b43_read32(dev, B43_MMIO_GEN_IRQ_REASON);
2348 if (tmp & B43_IRQ_MAC_SUSPENDED)
2349 goto out;
2350 udelay(10);
2351 }
2352 /* Hm, it seems this will take some time. Use msleep(). */
2346 for (i = 40; i; i--) { 2353 for (i = 40; i; i--) {
2347 tmp = b43_read32(dev, B43_MMIO_GEN_IRQ_REASON); 2354 tmp = b43_read32(dev, B43_MMIO_GEN_IRQ_REASON);
2348 if (tmp & B43_IRQ_MAC_SUSPENDED) 2355 if (tmp & B43_IRQ_MAC_SUSPENDED)