Commit ba380013 authored by Michael Buesch's avatar Michael Buesch Committed by John W. Linville
Browse files

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

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: default avatarMichael Buesch <>
Signed-off-by: default avatarJohn W. Linville <>
parent 059ff826
......@@ -2343,6 +2343,13 @@ static void b43_mac_suspend(struct b43_wldev *dev)
/* 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;
/* 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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment