提交 66c965f5 编写于 作者: P Prashant Sreedharan 提交者: David S. Miller

tg3: Change nvram command timeout value to 50ms

Commit 506724c4 "tg3: Override clock,
link aware and link idle mode during NVRAM dump" changed the timeout
value for nvram command execution from 100ms to 1ms. But the 1ms
timeout value was only sufficient for nvram read operations but not
write operations for most of the devices supported by tg3 driver.
This patch sets the MAX to 50ms. Also it uses usleep_range instead
of udelay.
Signed-off-by: NPrashant Sreedharan <prashant@broadcom.com>
Signed-off-by: NMichael Chan <mchan@broadcom.com>
Suggested-by: NDavid Miller <davem@davemloft.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ee9a33b2
...@@ -3224,7 +3224,7 @@ static int tg3_nvram_read_using_eeprom(struct tg3 *tp, ...@@ -3224,7 +3224,7 @@ static int tg3_nvram_read_using_eeprom(struct tg3 *tp,
return 0; return 0;
} }
#define NVRAM_CMD_TIMEOUT 100 #define NVRAM_CMD_TIMEOUT 5000
static int tg3_nvram_exec_cmd(struct tg3 *tp, u32 nvram_cmd) static int tg3_nvram_exec_cmd(struct tg3 *tp, u32 nvram_cmd)
{ {
...@@ -3232,7 +3232,7 @@ static int tg3_nvram_exec_cmd(struct tg3 *tp, u32 nvram_cmd) ...@@ -3232,7 +3232,7 @@ static int tg3_nvram_exec_cmd(struct tg3 *tp, u32 nvram_cmd)
tw32(NVRAM_CMD, nvram_cmd); tw32(NVRAM_CMD, nvram_cmd);
for (i = 0; i < NVRAM_CMD_TIMEOUT; i++) { for (i = 0; i < NVRAM_CMD_TIMEOUT; i++) {
udelay(10); usleep_range(10, 40);
if (tr32(NVRAM_CMD) & NVRAM_CMD_DONE) { if (tr32(NVRAM_CMD) & NVRAM_CMD_DONE) {
udelay(10); udelay(10);
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册