lkml.org 
[lkml]   [2009]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: r8169 MAC problem
Please Cc: Ivan.

Tim Durack <tdurack@gmail.com> :
[...]
> Any ideas?

Damn me, I should have noticed that the delay was below spec :o(

Can you try the patch below on top of the current git kernel ?

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index b347340..dfd42db 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1970,9 +1970,14 @@ static const struct net_device_ops rtl8169_netdev_ops = {
};

/* Delay between EEPROM clock transitions. Force out buffered PCI writes. */
-#define RTL_EEPROM_DELAY() RTL_R8(Cfg9346)
#define RTL_EEPROM_READ_CMD 6

+static void rtl_eeprom_delay(void __iomem *ioaddr)
+{
+ RTL_R8(Cfg9346);
+ ndelay(450);
+}
+
/* read 16bit word stored in EEPROM. EEPROM is addressed by words. */
static u16 rtl_eeprom_read(void __iomem *ioaddr, int addr)
{
@@ -1992,7 +1997,7 @@ static u16 rtl_eeprom_read(void __iomem *ioaddr, int addr)

/* enter programming mode */
RTL_W8(Cfg9346, Cfg9346_Program | Cfg9346_EECS);
- RTL_EEPROM_DELAY();
+ rtl_eeprom_delay(ioaddr);

/* write command and requested address */
while (cmd_len--) {
@@ -2002,29 +2007,29 @@ static u16 rtl_eeprom_read(void __iomem *ioaddr, int addr)

/* write a bit */
RTL_W8(Cfg9346, x);
- RTL_EEPROM_DELAY();
+ rtl_eeprom_delay(ioaddr);

/* raise clock */
RTL_W8(Cfg9346, x | Cfg9346_EESK);
- RTL_EEPROM_DELAY();
+ rtl_eeprom_delay(ioaddr);
}

/* lower clock */
RTL_W8(Cfg9346, Cfg9346_Program | Cfg9346_EECS);
- RTL_EEPROM_DELAY();
+ rtl_eeprom_delay(ioaddr);

/* read back 16bit value */
for (i = 16; i > 0; i--) {
/* raise clock */
RTL_W8(Cfg9346, Cfg9346_Program | Cfg9346_EECS | Cfg9346_EESK);
- RTL_EEPROM_DELAY();
+ rtl_eeprom_delay(ioaddr);

result <<= 1;
result |= (RTL_R8(Cfg9346) & Cfg9346_EEDO) ? 1 : 0;

/* lower clock */
RTL_W8(Cfg9346, Cfg9346_Program | Cfg9346_EECS);
- RTL_EEPROM_DELAY();
+ rtl_eeprom_delay(ioaddr);
}

RTL_W8(Cfg9346, Cfg9346_Program);
--
Ueimor

\
 
 \ /
  Last update: 2009-03-06 21:05    [W:0.044 / U:5.808 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site