提交 16092b5c 编写于 作者: J Juuso Oikarinen 提交者: John W. Linville

wl1271: Improve command polling

In testing I noticed that the wl1271 commands fall into two categories. In the
first category are "fast" commands, these mostly take only 0 or 1 polls to
complete, but occasionally upto 50 (giving a 0.5ms execution time.) In the
second category, the command completion takes well more than 0.5ms (from
1.5ms upwards.)

This patch fixes command polling such that it is optimal for the fast commands,
but also allows sleep for the longer ones.
Signed-off-by: NJuuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: NLuciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: NLuciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 62dad5b0
......@@ -36,7 +36,7 @@
#include "wl1271_cmd.h"
#include "wl1271_event.h"
#define WL1271_CMD_POLL_COUNT 5
#define WL1271_CMD_FAST_POLL_COUNT 50
/*
* send command to firmware
......@@ -76,11 +76,11 @@ int wl1271_cmd_send(struct wl1271 *wl, u16 id, void *buf, size_t len,
goto out;
}
udelay(10);
poll_count++;
if (poll_count == WL1271_CMD_POLL_COUNT)
wl1271_info("cmd polling took over %d cycles",
poll_count);
if (poll_count < WL1271_CMD_FAST_POLL_COUNT)
udelay(10);
else
msleep(1);
intr = wl1271_read32(wl, ACX_REG_INTERRUPT_NO_CLEAR);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册