Tim Durack writes: > On Fri, Mar 13, 2009 at 4:15 PM, Francois Romieu <romieu@fr.zoreil.com>wrote: > > > Mikael Pettersson <mikpe@it.uu.se> : > > > With the 2.6.29-rc7 kernel I'm unable to 'ifup' eth0 on my ARM-based > > > Thecus n2100 NAS box, which has an RTL8169 NIC (10ec:8169 (rev 10)). > > > A diff of the kernel logs from 2.6.29-rc6 and -rc7 shows that -rc7 > > > first mangles and then zaps the MAC addresses: > > > > Can you apply the attached patch and see if it fixes any of these > > problems ? > > > > Tim, could you give it a try too ? It applies with "patch -p1" from > > the kernel tree directory. > > > > -- > > Ueimor > > > > No luck: No joy here either. 2.6.29-rc8 + this patch shows the same misbehaviour as 2.6.29-rc7 had. Here's a minicom log of an attempted boot: (kernel messages) r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded r8169 0000:00:01.0: no PCI Express capability r8169 0000:00:01.0: MAC address found in EEPROM: 00:14:fd:10:00:00 eth0: RTL8169sb/8110sb at 0xe080c200, 00:00:00:00:00:00, XID 10000000 IRQ 27 r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded r8169 0000:00:02.0: no PCI Express capability r8169 0000:00:02.0: MAC address found in EEPROM: 00:14:fd:10:00:00 eth1: RTL8169sb/8110sb at 0xe0810300, 00:00:00:00:00:00, XID 10000000 IRQ 30 (init messages) Bringing up interface eth0: RTNETLINK answers: Cannot assign requested address Failed to bring up eth0. May I suggest that 6709fe9a27e43a4931938fe0d7f2cc5edef31386 is reverted until this regression is debugged and fixed? /Mikael --
Mikael Pettersson <mikpe@it.uu.se> : Yes. -- Ueimor --
Hello guys,
I made 3rd attempt to enable the ability to initialize r8169's MAC address
on initialization. The proposed patch below works for all my Realtek devices,
but you had some issues with the previous one. Could you please test it on your
devices? I would like to close finally this long term issue.
Thanks,
Ivan
---
drivers/net/r8169.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 92 insertions(+), 2 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 3b19e0c..60c8811 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -80,9 +80,9 @@ static const int multicast_filter_limit = 32;
#define RTL8169_TX_TIMEOUT (6*HZ)
#define RTL8169_PHY_TIMEOUT (10*HZ)
-#define RTL_EEPROM_SIG cpu_to_le32(0x8129)
-#define RTL_EEPROM_SIG_MASK cpu_to_le32(0xffff)
+#define RTL_EEPROM_SIG 0x8129
#define RTL_EEPROM_SIG_ADDR 0x0000
+#define RTL_EEPROM_MAC_ADDR 0x0007
/* write/read MMIO register */
#define RTL_W8(reg, val8) writeb ((val8), ioaddr + (reg))
@@ -292,6 +292,11 @@ enum rtl_register_content {
/* Cfg9346Bits */
Cfg9346_Lock = 0x00,
Cfg9346_Unlock = 0xc0,
+ Cfg9346_Program = 0x88, /* Programming mode */
+ Cfg9346_EECS = 0x08, /* Chip select */
+ Cfg9346_EESK = 0x04, /* Serial data clock */
+ Cfg9346_EEDI = 0x02, /* Data input */
+ Cfg9346_EEDO = 0x01, /* Data output */
/* rx_mode_bits */
AcceptErr = 0x20,
@@ -304,6 +309,7 @@ enum rtl_register_content {
/* RxConfigBits */
RxCfgFIFOShift = 13,
RxCfgDMAShift = 8,
+ RxCfg9356SEL = 6, /* EEPROM type: 0 = 9346, 1 = 9356 */
/* TxConfigBits */
TxInterFrameGapShift = 24,
@@ -1962,6 +1968,88 @@ static const struct net_device_ops rtl8169_netdev_ops = {
};
+/* delay between EEPROM clock transitions - force out buffered PCI writes. */
+#define RTL_EEPROM_DELAY() (void)RTL_R8(Cfg9346)
+#define RTL_EEPROM_READ_CMD 6
+
+/* read 16bit word stored in EEPROM. EEPROM is addressed by words. */
+static u16 rtl_eeprom_read(void ...Ivan Vecera writes: > Francois Romieu napsal(a): > > Mikael Pettersson <mikpe@it.uu.se> : > > [...] > >> May I suggest that 6709fe9a27e43a4931938fe0d7f2cc5edef31386 is reverted > >> until this regression is debugged and fixed? > > > > Yes. > > > Hello guys, > I made 3rd attempt to enable the ability to initialize r8169's MAC address > on initialization. The proposed patch below works for all my Realtek devices, > but you had some issues with the previous one. Could you please test it on your > devices? I would like to close finally this long term issue. Sorry, this one breaks my Thecus n2100 NAS box just like before. Here's a dmesg diff from 2.6.30 vanilla and 2.6.30 + this patch: @@ -158,11 +158,13 @@ r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded r8169 0000:00:01.0: enabling Mem-Wr-Inval r8169 0000:00:01.0: no PCI Express capability -eth0: RTL8169sb/8110sb at 0xe0810200, 00:14:fd:30:11:78, XID 10000000 IRQ 27 +r8169 0000:00:01.0: MAC address found in EEPROM: 00:14:fd:10:00:00 +eth0: RTL8169sb/8110sb at 0xe0810200, 00:00:00:00:00:00, XID 10000000 IRQ 27 r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded r8169 0000:00:02.0: enabling Mem-Wr-Inval r8169 0000:00:02.0: no PCI Express capability -eth1: RTL8169sb/8110sb at 0xe0814300, 00:14:fd:30:11:79, XID 10000000 IRQ 30 +r8169 0000:00:02.0: MAC address found in EEPROM: 00:14:fd:10:00:00 +eth1: RTL8169sb/8110sb at 0xe0814300, 00:00:00:00:00:00, XID 10000000 IRQ 30 physmap platform flash device: 01000000 at f0000000 physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank Intel/Sharp Extended Query Table at 0x0031 @@ -250,6 +246,4 @@ EXT3 FS on sda5, internal journal EXT3-fs: mounted filesystem with ordered data mode. Adding 2008116k swap on /dev/sda3. Priority:-1 extents:1 across:2008116k -r8169: eth0: link up -r8169: eth0: link up warning: `dbus-daemon' uses 32-bit capabilities (legacy support in use) /Mikael --
