diff mbox

[net,v2] tg3: Change nvram command timeout value to 50ms

Message ID 1403332095-30038-1-git-send-email-prashant@broadcom.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Prashant Sreedharan June 21, 2014, 6:28 a.m. UTC
Commit 506724c463fcd63477a5e404728a980b71f80bb7 "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: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Suggested-by: David Miller <davem@davemloft.net>
---
---
 drivers/net/ethernet/broadcom/tg3.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

David Miller June 25, 2014, 10:56 p.m. UTC | #1
From: Prashant Sreedharan <prashant@broadcom.com>
Date: Fri, 20 Jun 2014 23:28:15 -0700

> Commit 506724c463fcd63477a5e404728a980b71f80bb7 "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: Prashant Sreedharan <prashant@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
> Suggested-by: David Miller <davem@davemloft.net>

Applied, thank you.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index df2792d..074c7c6 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -3224,7 +3224,7 @@  static int tg3_nvram_read_using_eeprom(struct tg3 *tp,
 	return 0;
 }
 
-#define NVRAM_CMD_TIMEOUT 100
+#define NVRAM_CMD_TIMEOUT 5000
 
 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);
 	for (i = 0; i < NVRAM_CMD_TIMEOUT; i++) {
-		udelay(10);
+		usleep_range(10, 40);
 		if (tr32(NVRAM_CMD) & NVRAM_CMD_DONE) {
 			udelay(10);
 			break;