]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
8139cp/8139too: terminate the eeprom access with the right opmode
authorJason Wang <jasowang@redhat.com>
Thu, 31 May 2012 18:19:48 +0000 (18:19 +0000)
committerJoe Jin <joe.jin@oracle.com>
Wed, 29 Aug 2012 00:22:20 +0000 (08:22 +0800)
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.

(cherry picked from commit 0bc777bca480357941418952cf228484f5485daf)
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/8139cp.c
drivers/net/8139too.c

index bfd97051f624b6538440ccc4662f8cea02eaa2eb..2004409215b612328cb0f06f70b55c516e45667d 100644 (file)
@@ -1662,7 +1662,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 ();
 }
 
index 4fda2f73856b6b5dabdad229f3559a4bf6be2ded..1198a31870f7d40b7df7ee9be698c1fd8d556df0 100644 (file)
@@ -1142,7 +1142,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;