Skip to contentSkip to conversation

rtl8139 (8139too) net problem in linux 2.6.10

PATCH New Marco Rogantini 2 participants 7 messages Feb 5, 2005 – Feb 6, 2005 Pcmcia

lore
Share & tools
lore
#0 lore raw

Hello all,

I have a problem with my RTL-8139C based CardBus network interface. I'm using the 8139too driver of linux-2.6.10.

When outgoing traffic becomes high it is interrupted for several seconds and i get this:

sort kernel: NETDEV WATCHDOG: eth1: transmit timed out sort kernel: eth1: Transmit timeout, status 0d 0000 c07f media 00. sort kernel: eth1: Tx queue start entry 8588 dirty entry 8584. sort kernel: eth1: Tx descriptor 0 is 00120386. (queue head) sort kernel: eth1: Tx descriptor 1 is 0012003c.
sort kernel: eth1: Tx descriptor 2 is 00120056.
sort kernel: eth1: Tx descriptor 3 is 0012003c.
sort kernel: eth1: link up, 100Mbps, full-duplex, lpa 0x41E1

after some seconds the network traffic resumes but almost immediately after I get an other 'transmit timed out' and so on...

Output of 'rtl8139-diag -af' is
rtl8139-diag.c:v2.11 4/22/2003 Donald Becker ([email protected])
http://www.scyld.com/diag/index.html
Index #1: Found a RealTek RTL8139 adapter at 0x4000. RealTek chip registers at 0x4000
0x000: 354f3000 00007fda 80000000 40800000 0008a062 0008a03c 0008a03c
0008a062
0x020: 1f3dc000 1f3dc600 1f3dcc00 1f3dd200 1ec70000 0d0a0000 00640054
0000c07f
0x040: 74000680 0000f7ce 33c2d3de 00000000 000d1000 00000000 0089cd00
00100000
0x060: 1100f00f 01e1782d 000141e1 00000000 00000004 000417c8 b0f243b9
8a36df43.
Realtek station address 00:30:4f:35:da:7f, chip type 'rtl8139C'.
Receiver configuration: Normal unicast and hashed multicast
Rx FIFO threshold 2048 bytes, maximum burst 2048 bytes, 32KB ring
Transmitter enabled with NONSTANDARD! settings, maximum burst 1024
bytes.

    Tx entry #0 status 0008a062 complete, 98 bytes.
    Tx entry #1 status 0008a03c complete, 60 bytes.
    Tx entry #2 status 0008a03c complete, 60 bytes.
    Tx entry #3 status 0008a062 complete, 98 bytes.

Flow control: Tx disabled Rx disabled.
The chip configuration is 0x10 0x0d, MII half-duplex mode. No interrupt sources are pending.

Can anybody please help me ?

Many thanks,

-marco

#1 lore raw
Quoted 2 lines · Marco Rogantini

sort kernel: NETDEV WATCHDOG: eth1: transmit timed out sort kernel: eth1: Transmit timeout, status 0d 0000 c07f media 00.

This state seems the hardware problem. Probably TX pending was not processed, so any pending interrupts is nothing.

What CardBus bridge are you using? If TI12xx bridge, can you try the attached patch? (Try "disable_clkrun" module option with yenta_socket.ko)

Signature · 66 lines
OGAWA Hirofumi <[email protected]>



[PATCH] pcmcia: Add disable_clkrun option

I received report that transmission of Realtek 8139 doesn't work.  The
cause of this problem was CLKRUN protocols of laptop's TI 12xx CardBus
bridge.

And I remember that this problem had happened on Thinkpad before. In
the case, problem seems solved by similar workaround of sound/oss/cs46xx.c.

This patch adds "disable_clkrun" option as workaround of problem to
yenta_socket.

Please apply.

Signed-off-by: OGAWA Hirofumi <[email protected]>
---

 drivers/pcmcia/ti113x.h       |   11 ++++++++---
 drivers/pcmcia/yenta_socket.c |    3 +++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff -puN drivers/pcmcia/ti113x.h~pcmcia-clkrun-disable drivers/pcmcia/ti113x.h
--- linux-2.6.10/drivers/pcmcia/ti113x.h~pcmcia-clkrun-disable	2004-12-25 23:37:27.000000000 +0900
+++ linux-2.6.10-hirofumi/drivers/pcmcia/ti113x.h	2004-12-25 23:37:27.000000000 +0900
@@ -592,15 +592,20 @@ out:
 
 static int ti12xx_override(struct yenta_socket *socket)
 {
-	u32 val;
+	u32 val, val_orig;
 
 	/* make sure that memory burst is active */
-	val = config_readl(socket, TI113X_SYSTEM_CONTROL);
+	val_orig = val = config_readl(socket, TI113X_SYSTEM_CONTROL);
+	if (disable_clkrun && PCI_FUNC(socket->dev->devfn) == 0) {
+		printk(KERN_INFO "Yenta: Disabling CLKRUN feature\n");
+		val |= TI113X_SCR_KEEPCLK;
+	}
 	if (!(val & TI122X_SCR_MRBURSTUP)) {
 		printk(KERN_INFO "Yenta: Enabling burst memory read transactions\n");
 		val |= TI122X_SCR_MRBURSTUP;
-		config_writel(socket, TI113X_SYSTEM_CONTROL, val);
 	}
+	if (val_orig != val)
+		config_writel(socket, TI113X_SYSTEM_CONTROL, val);
 
 	/*
 	 * for EnE bridges only: clear testbit TLTEnable. this makes the
diff -puN drivers/pcmcia/yenta_socket.c~pcmcia-clkrun-disable drivers/pcmcia/yenta_socket.c
--- linux-2.6.10/drivers/pcmcia/yenta_socket.c~pcmcia-clkrun-disable	2004-12-25 23:37:27.000000000 +0900
+++ linux-2.6.10-hirofumi/drivers/pcmcia/yenta_socket.c	2004-12-25 23:37:27.000000000 +0900
@@ -28,6 +28,9 @@
 #include "yenta_socket.h"
 #include "i82365.h"
 
+static int disable_clkrun;
+module_param(disable_clkrun, bool, 0444);
+MODULE_PARM_DESC(disable_clkrun, "If PC card doesn't function properly, please try this option");
 
 #if 0
 #define debug(x,args...) printk(KERN_DEBUG "%s: " x, __func__ , ##args)
_
#2 lore raw

Hello,

Quoted 11 lines · OGAWA Hirofumi
Quoted 2 lines · Marco Rogantini

sort kernel: NETDEV WATCHDOG: eth1: transmit timed out sort kernel: eth1: Transmit timeout, status 0d 0000 c07f media 00.

This state seems the hardware problem. Probably TX pending was not processed, so any pending interrupts is nothing.

What CardBus bridge are you using? If TI12xx bridge, can you try the attached patch? (Try "disable_clkrun" module option with yenta_socket.ko)

Many thanks for your help,

I'm using a TI-PCI4510 on a Dell Inspiron 8500.
Kernel is linux-2.6.11-rc3 and your patch is already included there.

I tried to load the module with 'disable_clkrun' option but nothing has changed... :-(

dmesg extract:

Linux Kernel Card Services
options: [pci] [cardbus] [pm]
PCI: Enabling device 0000:02:01.0 (0000 -> 0002)
ACPI: PCI interrupt 0000:02:01.0[A] -> GSI 11 (level, low) -> IRQ 11
Yenta: CardBus bridge found at 0000:02:01.0 [1028:013e]
Yenta: ISA IRQ mask 0x04d8, PCI irq 11
Socket status: 30000020
8139too Fast Ethernet driver 0.9.27
PCI: Enabling device 0000:03:00.0 (0000 -> 0003)
ACPI: PCI interrupt 0000:03:00.0[A] -> GSI 11 (level, low) -> IRQ 11
PCI: Setting latency timer of device 0000:03:00.0 to 64
eth1: RealTek RTL8139 at 0xe0824000, 00:30:4f:35:da:7f, IRQ 11
eth1: Identified 8139 chip type 'RTL-8139C'

lspci | grep -i cardbus:

0000:02:01.0 CardBus bridge: Texas Instruments PCI4510 PC card Cardbus Controller (rev 02)

It is perhaps that IRQ11 is shared with a lot of other devices?

cat /proc/interrupts:

CPU0

  0:     872193          XT-PIC  timer
  1:        652          XT-PIC  i8042
  2:          0          XT-PIC  cascade
  8:          4          XT-PIC  rtc
  9:          2          XT-PIC  acpi
 11:      32031          XT-PIC  ehci_hcd, uhci_hcd, uhci_hcd, uhci_hcd, 
yenta, eth0, eth1
 12:        106          XT-PIC  i8042
 14:       4432          XT-PIC  ide0
 15:         12          XT-PIC  ide1
NMI:          0
LOC:     872045
ERR:          0
MIS:          0

In any case, many thanks for your contributions!

-marco

#3 lore raw
Quoted 5 lines · Marco Rogantini

I'm using a TI-PCI4510 on a Dell Inspiron 8500.
Kernel is linux-2.6.11-rc3 and your patch is already included there.

I tried to load the module with 'disable_clkrun' option but nothing has changed... :-(

Umm... Bit strange...

I couldn't find the PCI4510 in yenta_table. Did you add the PCI4510 to yenta_table? Could you send "lspci -n" (what vendor-id and device-id)?

Quoted 9 lines

dmesg extract:

Linux Kernel Card Services
options: [pci] [cardbus] [pm]
PCI: Enabling device 0000:02:01.0 (0000 -> 0002)
ACPI: PCI interrupt 0000:02:01.0[A] -> GSI 11 (level, low) -> IRQ 11
Yenta: CardBus bridge found at 0000:02:01.0 [1028:013e]
Yenta: ISA IRQ mask 0x04d8, PCI irq 11
Socket status: 30000020

The disable_clkrun code didn't run. If it was running, you should see the following message.

"Yenta: Disabling CLKRUN feature"

Signature · 1 line
OGAWA Hirofumi <[email protected]>
#4 lore raw
Quoted 4 lines · OGAWA Hirofumi

Umm... Bit strange...

I couldn't find the PCI4510 in yenta_table. Did you add the PCI4510 to yenta_table? Could you send "lspci -n" (what vendor-id and device-id)?

Grr... Ok, probably that was processed as default bridge.

Could you please try the following patch for debug?

---

 drivers/pcmcia/yenta_socket.c |    2 ++
 1 files changed, 2 insertions(+)
drivers/pcmcia/yenta_socket.c renamed from drivers/pcmcia/yenta_socket.c~yenta-pci4510-debug +2 -0
diff -puN drivers/pcmcia/yenta_socket.c~yenta-pci4510-debug drivers/pcmcia/yenta_socket.c
@@ -1105,6 +1105,8 @@ static struct pci_device_id yenta_table 
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4410, TI12XX),
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4450, TI12XX),
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4451, TI12XX),
+#define PCI_DEVICE_ID_TI_4510		0xac44
+	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4510, TI12XX),
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4520, TI12XX),
 
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1250, TI1250),

_

Signature · 1 line
OGAWA Hirofumi <[email protected]>
#5 lore raw

Hello!

Quoted 6 lines · OGAWA Hirofumi
Quoted 4 lines · OGAWA Hirofumi

Umm... Bit strange...

I couldn't find the PCI4510 in yenta_table. Did you add the PCI4510 to yenta_table? Could you send "lspci -n" (what vendor-id and device-id)?

0000:02:01.0 CardBus bridge: Texas Instruments PCI4510 PC card Cardbus Controller (rev 02) 0000:02:01.0 0607: 104c:ac44 (rev 02)

drivers/pcmcia/yenta_socket.c static struct pci_device_id yenta_table · line 1109

Quoted 7 lines

Grr... Ok, probably that was processed as default bridge.

Could you please try the following patch for debug?

drivers/pcmcia/yenta_socket.c renamed from drivers/pcmcia/yenta_socket.c~yenta-pci4510-debug +2 -0
+#define PCI_DEVICE_ID_TI_4510		0xac44
+	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4510, TI12XX),

:-) It solved the problem! However I still must use the 'disable_clkrun' parameter to get the bridge working correctly.

Linux Kernel Card Services
options: [pci] [cardbus] [pm]
PCI: Enabling device 0000:02:01.0 (0000 -> 0002)
ACPI: PCI interrupt 0000:02:01.0[A] -> GSI 11 (level, low) -> IRQ 11
Yenta: CardBus bridge found at 0000:02:01.0 [1028:013e]
Yenta: Disabling CLKRUN feature
Yenta: Using CSCINT to route CSC interrupts to PCI
Yenta: Routing CardBus interrupts to PCI
Yenta TI: socket 0000:02:01.0, mfunc 0x012c1202, devctl 0x64
Yenta: ISA IRQ mask 0x04d8, PCI irq 11
Socket status: 30000020

Many, many thanks for your help, you made me a happy man!

-marco

#6 lore raw

PATCH 1/1 pcmcia: Add support TI PCI4510 CardBus bridge

Quoted 5 lines · Marco Rogantini

drivers/pcmcia/yenta_socket.c static struct pci_device_id yenta_table · line 1109

Quoted 2 lines
drivers/pcmcia/yenta_socket.c renamed from drivers/pcmcia/yenta_socket.c~yenta-pci4510-debug +2 -0
+#define PCI_DEVICE_ID_TI_4510		0xac44
+	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4510, TI12XX),

:-) It solved the problem! However I still must use the 'disable_clkrun' parameter to get the bridge working correctly.

Great! Thanks. I checked the datasheet, and added zoom_video support. New patch is attached.

Andrew, could you apply this patch to your tree for testing?

Signature · 55 lines
OGAWA Hirofumi <[email protected]>



This does setup PCI4510 properly, and supports the "disable_clkrun" option.

1) Add PCI_DEVICE_ID_TI_4510 to pci_id.h.
2) Add PCI4510 to yenta_table (that uses TI12XX handlers).
3) Add zoom_video handler support.

TI12XX handlers can disable CLKRUN feature with "disable_clkrun" option.
Some devices or bridge itself seems to be needing this option as workaround.

Signed-off-by: OGAWA Hirofumi <[email protected]>
---

 drivers/pcmcia/ti113x.h       |    1 +
 drivers/pcmcia/yenta_socket.c |    1 +
 include/linux/pci_ids.h       |    1 +
 3 files changed, 3 insertions(+)

diff -puN drivers/pcmcia/ti113x.h~yenta-pci4510-support drivers/pcmcia/ti113x.h
--- linux-2.6.11-rc3/drivers/pcmcia/ti113x.h~yenta-pci4510-support	2005-02-07 01:46:12.000000000 +0900
+++ linux-2.6.11-rc3-hirofumi/drivers/pcmcia/ti113x.h	2005-02-07 01:46:12.000000000 +0900
@@ -262,6 +262,7 @@ static void ti_set_zv(struct yenta_socke
 			case PCI_DEVICE_ID_TI_1220:
 			case PCI_DEVICE_ID_TI_1221:
 			case PCI_DEVICE_ID_TI_1225:
+			case PCI_DEVICE_ID_TI_4510:
 				socket->socket.zoom_video = ti_zoom_video;
 				break;	
 			case PCI_DEVICE_ID_TI_1250:
diff -puN drivers/pcmcia/yenta_socket.c~yenta-pci4510-support drivers/pcmcia/yenta_socket.c
--- linux-2.6.11-rc3/drivers/pcmcia/yenta_socket.c~yenta-pci4510-support	2005-02-07 01:46:12.000000000 +0900
+++ linux-2.6.11-rc3-hirofumi/drivers/pcmcia/yenta_socket.c	2005-02-07 01:46:12.000000000 +0900
@@ -1105,6 +1105,7 @@ static struct pci_device_id yenta_table 
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4410, TI12XX),
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4450, TI12XX),
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4451, TI12XX),
+	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4510, TI12XX),
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4520, TI12XX),
 
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1250, TI1250),
diff -puN include/linux/pci_ids.h~yenta-pci4510-support include/linux/pci_ids.h
--- linux-2.6.11-rc3/include/linux/pci_ids.h~yenta-pci4510-support	2005-02-07 01:46:12.000000000 +0900
+++ linux-2.6.11-rc3-hirofumi/include/linux/pci_ids.h	2005-02-07 01:46:12.000000000 +0900
@@ -753,6 +753,7 @@
 #define PCI_DEVICE_ID_TI_1251B		0xac1f
 #define PCI_DEVICE_ID_TI_4410		0xac41
 #define PCI_DEVICE_ID_TI_4451		0xac42
+#define PCI_DEVICE_ID_TI_4510		0xac44
 #define PCI_DEVICE_ID_TI_4520		0xac46
 #define PCI_DEVICE_ID_TI_1410		0xac50
 #define PCI_DEVICE_ID_TI_1420		0xac51
_