8139cp/8139too: do not read into reserved registers
authorJason Wang <jasowang@redhat.com>
Fri, 30 Dec 2011 23:44:33 +0000 (23:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Jan 2012 17:47:50 +0000 (12:47 -0500)
delay_eeprom() use long read for Cfg9346 register(offset 0x50) which may read
into the area of reserved register(offset 0x53). Use byte read instead.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/8139cp.c
drivers/net/ethernet/realtek/8139too.c

index 87cff10f7be7432c167d3c721a2ba5012cb605b5..886e6bec971a3ecaf6a44ed23813a6a7dd675a6a 100644 (file)
@@ -1589,7 +1589,7 @@ static int cp_set_mac_address(struct net_device *dev, void *p)
    No extra delay is needed with 33Mhz PCI, but 66Mhz may change this.
  */
 
-#define eeprom_delay() readl(ee_addr)
+#define eeprom_delay() readb(ee_addr)
 
 /* The EEPROM commands include the alway-set leading bit. */
 #define EE_EXTEND_CMD  (4)
index d9c72273e428891d33eea4be4daf3ebb97ceef9a..a8779bedb3d9afbd3125a09f13ef0ce93f473f1a 100644 (file)
@@ -1122,7 +1122,7 @@ static void __devexit rtl8139_remove_one (struct pci_dev *pdev)
    No extra delay is needed with 33Mhz PCI, but 66Mhz may change this.
  */
 
-#define eeprom_delay() (void)RTL_R32(Cfg9346)
+#define eeprom_delay() (void)RTL_R8(Cfg9346)
 
 /* The EEPROM commands include the alway-set leading bit. */
 #define EE_WRITE_CMD   (5)