Skip to content

Commit

Permalink
8139cp/8139too: terminate the eeprom access with the right opmode
Browse files Browse the repository at this point in the history
Currently, we terminate the eeprom access through clearing the CS by:

RTL_W8 (Cfg9346, ~EE_CS); or writeb (~EE_CS, ee_addr);

This would left the eeprom into "Config. Register Write Enable:"
state which is not expcted as the highest two bits were set to
0x11 ( expected is the "Normal" mode (0x00)). Solving this by write
0x0 instead of ~EE_CS when terminating the eeprom access.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jason Wang authored and David S. Miller committed Jun 1, 2012
1 parent b01af45 commit 0bc777b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/realtek/8139cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ static void eeprom_cmd(void __iomem *ee_addr, int cmd, int cmd_len)

static void eeprom_cmd_end(void __iomem *ee_addr)
{
writeb (~EE_CS, ee_addr);
writeb(0, ee_addr);
eeprom_delay ();
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/realtek/8139too.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ static int __devinit read_eeprom (void __iomem *ioaddr, int location, int addr_l
}

/* Terminate the EEPROM access. */
RTL_W8 (Cfg9346, ~EE_CS);
RTL_W8(Cfg9346, 0);
eeprom_delay ();

return retval;
Expand Down

0 comments on commit 0bc777b

Please sign in to comment.