Skip to content

Commit

Permalink
mwl8k: use cond_resched() when loading firmware blocks
Browse files Browse the repository at this point in the history
Since each firmware block takes on the order of several hundred usec
to upload to the hardware, using msleep in the inner loop would make
the firmware loading process take a lot more time than just doing
busy-waiting like we do now.  But if we keep the busy-waiting, we can
at least add a cond_resched() to the inner loop so that we give other
tasks a chance to run while the firmware is being loaded.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Lennert Buytenhek authored and John W. Linville committed Nov 4, 2009
1 parent 32060e1 commit 3d76e82
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wireless/mwl8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/list.h>
#include <linux/pci.h>
Expand Down Expand Up @@ -428,6 +429,7 @@ mwl8k_send_fw_load_cmd(struct mwl8k_priv *priv, void *data, int length)
break;
}

cond_resched();
udelay(1);
} while (--loops);

Expand Down

0 comments on commit 3d76e82

Please sign in to comment.