Skip to content

Commit

Permalink
tg3: Change nvram command timeout value to 50ms
Browse files Browse the repository at this point in the history
Commit 506724c "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 <[email protected]>
Signed-off-by: Michael Chan <[email protected]>
Suggested-by: David Miller <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Prashant Sreedharan authored and davem330 committed Jun 25, 2014
1 parent ee9a33b commit 66c965f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -3224,15 +3224,15 @@ 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)
{
int i;

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;
Expand Down

0 comments on commit 66c965f

Please sign in to comment.