From: Lennert Buytenhek Date: Thu, 22 Oct 2009 18:20:16 +0000 (+0200) Subject: mwl8k: use cond_resched() when loading firmware blocks X-Git-Tag: v3.12-rc1~12159^2~449^2~71 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d76e82c9538d8104e578ca460d35f214bfddfd3;p=kernel%2Fkernel-generic.git mwl8k: use cond_resched() when loading firmware blocks 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 Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index fcf7139..496d3c5 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -428,6 +429,7 @@ mwl8k_send_fw_load_cmd(struct mwl8k_priv *priv, void *data, int length) break; } + cond_resched(); udelay(1); } while (--loops);