Skip to contentSkip to conversation

Correction: 2.6.16-git12 killed networking -- 3c900 card

DISCUSSION Pete Clements 3 participants 24 messages Mar 27, 2006 – Mar 30, 2006 Network drivers

lore
Share & tools
lore
#0 lore raw

Reported this earlier as a 3c509 card in error, should have been 3c900 (3c59x driver).

FYI:
Single 3c900 card, UP i386
Lost networking with .16-git12, message
ADDRCONF(NETDEV_UP): eth0: link is not ready

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

No problems observed git1-git10

Signature · 1 line
Pete Clements 
#1 lore raw
Quoted 7 lines · Pete Clements

Reported this earlier as a 3c509 card in error, should have been 3c900 (3c59x driver).

FYI:
Single 3c900 card, UP i386
Lost networking with .16-git12, message
ADDRCONF(NETDEV_UP): eth0: link is not ready

This could be due to the recent driver update.
I can not reproduce this with a 3c900B-Combo,
so I need some more information to track it down.

Quoted 2 lines

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

Is this for sure that these messages occured first time with git11? There were no changes in the 3c59x driver between git10 and git11.

Quoted 3 lines

No problems observed git1-git10

If you are willing to provide me with some information you can send the following:

1. output of lspci -vvv (just the ethernet controller related part)

2. your Kernel configuration

3. modprobe the driver with debug=4 and send
the 3c59x related lines of your logs for both, git11 and git12. (From driver startup about 15 seconds should be sufficiant for now)

4. the output of "vortex-diag -aem" and "mii-diag".
You can find these tools at http://www.scyld.com/ethercard_diag.html

Steffen

#2 lore raw

Quoting Steffen Klassert

Quoted 9 lines
Quoted 5 lines

FYI:
Single 3c900 card, UP i386
Lost networking with .16-git12, message
ADDRCONF(NETDEV_UP): eth0: link is not ready

This could be due to the recent driver update.
I can not reproduce this with a 3c900B-Combo,
so I need some more information to track it down.

Data attached. Note:
1) Using coax 10base2.
2) Driver is compiled in, not a module. If you need I'll recompile with debug set.

Quoted 6 lines
Quoted 3 lines

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

Is this for sure that these messages occured first time with git11? There were no changes in the 3c59x driver between git10 and git11.

Only occurrance in git11, 4 hits during a local net ftp. Low network load system.

Quoted 22 lines
Quoted 4 lines

No problems observed git1-git10

If you are willing to provide me with some information you can send the following:

1. output of lspci -vvv (just the ethernet controller related part)

2. your Kernel configuration

3. modprobe the driver with debug=4 and send
the 3c59x related lines of your logs for both, git11 and git12. (From driver startup about 15 seconds should be sufficiant for now)

4. the output of "vortex-diag -aem" and "mii-diag".
You can find these tools at http://www.scyld.com/ethercard_diag.html

Steffen
-

Signature · 1 line
Pete Clements 
#3 lore raw
Quoted 7 lines · Pete Clements

Quoting Steffen Klassert

Quoted 6 lines
Quoted 5 lines

FYI:
Single 3c900 card, UP i386
Lost networking with .16-git12, message
ADDRCONF(NETDEV_UP): eth0: link is not ready

Quoted 6 lines
Quoted 3 lines

This could be due to the recent driver update.
I can not reproduce this with a 3c900B-Combo,
so I need some more information to track it down.

Data attached. Note:
1) Using coax 10base2.

Somehow 10base2 does not like a netif_carrier_off.

Please try the pach below. It makes 10base2 work again for me.

Steffen

drivers/net/3c59x.c +0 -1
@@ -1723,7 +1723,6 @@
 		printk(KERN_DEBUG "vortex_up(): writing 0x%x to InternalConfig\n", config);
 	iowrite32(config, ioaddr + Wn3_Config);
 
-	netif_carrier_off(dev);
 	if (dev->if_port == XCVR_MII || dev->if_port == XCVR_NWAY) {
 		EL3WINDOW(4);
 		vortex_check_media(dev, 1);
#4 lore raw

Patch gives me the network back (applied to git16). Timeout problem remains, trying Andrews patches.

Quoted 29 lines
Quoted 11 lines
Quoted 8 lines
Quoted 4 lines

FYI:
Single 3c900 card, UP i386
Lost networking with .16-git12, message
ADDRCONF(NETDEV_UP): eth0: link is not ready

This could be due to the recent driver update.
I can not reproduce this with a 3c900B-Combo,
so I need some more information to track it down.

Data attached. Note:
1) Using coax 10base2.

Somehow 10base2 does not like a netif_carrier_off.

Please try the pach below. It makes 10base2 work again for me.

Steffen

drivers/net/3c59x.c +0 -1
@@ -1723,7 +1723,6 @@
 		printk(KERN_DEBUG "vortex_up(): writing 0x%x to InternalConfig\n", config);
 	iowrite32(config, ioaddr + Wn3_Config);
 
-	netif_carrier_off(dev);
 	if (dev->if_port == XCVR_MII || dev->if_port == XCVR_NWAY) {
 		EL3WINDOW(4);
 		vortex_check_media(dev, 1);
Signature · 1 line
Pete Clements 
#5 lore raw
In reply to Steffen Klassert

Quoting Steffen Klassert

Quoted 6 lines
Quoted 2 lines

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

Is this for sure that these messages occured first time with git11? There were no changes in the 3c59x driver between git10 and git11.

Tried the the same ftp with a 2.6.16 and get the time out. I'll try 2.6.15 to see what happens.
--
Pete Clements

#6 lore raw
In reply to Steffen Klassert

Quoting Steffen Klassert

Quoted 6 lines
Quoted 2 lines

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

Is this for sure that these messages occured first time with git11? There were no changes in the 3c59x driver between git10 and git11.

Tried 2.6.15 and could not get a timed out condition. Looks like that defect is between 15 and 16 in my case.

Be glad to do any testing that I can.

--
Pete Clements

#7 lore raw
Quoted 5 lines · Pete Clements

Quoting Steffen Klassert

Quoted 3 lines
Quoted 2 lines

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

Quoted 8 lines
Quoted 3 lines

Is this for sure that these messages occured first time with git11? There were no changes in the 3c59x driver between git10 and git11.

Tried 2.6.15 and could not get a timed out condition. Looks like that defect is between 15 and 16 in my case.

Be glad to do any testing that I can.

Well here's one. Steffen, please confirm.

From: Andrew Morton <[email protected]>

The pre-2.6.16 patch "3c59x collision statistics fix" accidentally caused vortex_error() to not run iowrite16(TxEnable, ioaddr + EL3_CMD) if we got a maxCollisions interrupt but MAX_COLLISION_RESET is not set.

Cc Steffen Klassert <[email protected]>
Cc Pete Clements <[email protected]>

---

 drivers/net/3c59x.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
drivers/net/3c59x.c renamed from drivers/net/3c59x.c~3c59x-collision-statistics-fix-fix +5 -7
diff -puN drivers/net/3c59x.c~3c59x-collision-statistics-fix-fix drivers/net/3c59x.c
@@ -2085,16 +2085,14 @@ vortex_error(struct net_device *dev, int
 		}
 		if (tx_status & 0x14)  vp->stats.tx_fifo_errors++;
 		if (tx_status & 0x38)  vp->stats.tx_aborted_errors++;
+		if (tx_status & 0x08)  vp->xstats.tx_max_collisions++;
 		iowrite8(0, ioaddr + TxStatus);
 		if (tx_status & 0x30) {			/* txJabber or txUnderrun */
 			do_tx_reset = 1;
-		} else if (tx_status & 0x08) {	/* maxCollisions */
-			vp->xstats.tx_max_collisions++;
-			if (vp->drv_flags & MAX_COLLISION_RESET) {
-				do_tx_reset = 1;
-				reset_mask = 0x0108;		/* Reset interface logic, but not download logic */
-			}
-		} else {						/* Merely re-enable the transmitter. */
+		} else if ((tx_status & 0x08) && (vp->drv_flags & MAX_COLLISION_RESET))  {	/* maxCollisions */
+			do_tx_reset = 1;
+			reset_mask = 0x0108;		/* Reset interface logic, but not download logic */
+		} else {				/* Merely re-enable the transmitter. */
 			iowrite16(TxEnable, ioaddr + EL3_CMD);
 		}
 	}

_

#8 lore raw
Quoted 6 lines · Andrew Morton
Quoted 5 lines · Pete Clements

Quoting Steffen Klassert

Quoted 3 lines
Quoted 2 lines

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

Is this for sure that these messages occured first time with git11? There were no changes in the 3c59x driver between git10 and git11.

Tried 2.6.15 and could not get a timed out condition. Looks like that defect is between 15 and 16 in my case.

Be glad to do any testing that I can.

I will try to borrow a coax cable and see whats up with 10base2.

Quoted 9 lines

Well here's one. Steffen, please confirm.

From: Andrew Morton <[email protected]>

The pre-2.6.16 patch "3c59x collision statistics fix" accidentally caused vortex_error() to not run iowrite16(TxEnable, ioaddr + EL3_CMD) if we got a maxCollisions interrupt but MAX_COLLISION_RESET is not set.

True, this can explain the transmit timed out messages.

Quoted 35 lines
Cc Steffen Klassert <[email protected]>
Cc Pete Clements <[email protected]>

---

 drivers/net/3c59x.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff -puN drivers/net/3c59x.c~3c59x-collision-statistics-fix-fix drivers/net/3c59x.c

drivers/net/3c59x.c renamed from drivers/net/3c59x.c~3c59x-collision-statistics-fix-fix +5 -7
@@ -2085,16 +2085,14 @@ vortex_error(struct net_device *dev, int
 		}
 		if (tx_status & 0x14)  vp->stats.tx_fifo_errors++;
 		if (tx_status & 0x38)  vp->stats.tx_aborted_errors++;
+		if (tx_status & 0x08)  vp->xstats.tx_max_collisions++;
 		iowrite8(0, ioaddr + TxStatus);
 		if (tx_status & 0x30) {			/* txJabber or txUnderrun */
 			do_tx_reset = 1;
-		} else if (tx_status & 0x08) {	/* maxCollisions */
-			vp->xstats.tx_max_collisions++;
-			if (vp->drv_flags & MAX_COLLISION_RESET) {
-				do_tx_reset = 1;
-				reset_mask = 0x0108;		/* Reset interface logic, but not download logic */
-			}
-		} else {						/* Merely re-enable the transmitter. */
+		} else if ((tx_status & 0x08) && (vp->drv_flags & MAX_COLLISION_RESET))  {	/* maxCollisions */
+			do_tx_reset = 1;
+			reset_mask = 0x0108;		/* Reset interface logic, but not download logic */
+		} else {				/* Merely re-enable the transmitter. */
 			iowrite16(TxEnable, ioaddr + EL3_CMD);
 		}
 	}

_

#9 lore raw
In reply to Andrew Morton

Quoting Andrew Morton

Patch applied to 2.6.16, timeouts remain. Will try the other also.

Quoted 59 lines
Quoted 5 lines · Pete Clements

Quoting Steffen Klassert

Quoted 3 lines
Quoted 2 lines

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

Quoted 8 lines
Quoted 3 lines

Is this for sure that these messages occured first time with git11? There were no changes in the 3c59x driver between git10 and git11.

Tried 2.6.15 and could not get a timed out condition. Looks like that defect is between 15 and 16 in my case.

Be glad to do any testing that I can.

Well here's one. Steffen, please confirm.

From: Andrew Morton <[email protected]>

The pre-2.6.16 patch "3c59x collision statistics fix" accidentally caused vortex_error() to not run iowrite16(TxEnable, ioaddr + EL3_CMD) if we got a maxCollisions interrupt but MAX_COLLISION_RESET is not set.

Cc Steffen Klassert <[email protected]>
Cc Pete Clements <[email protected]>

---

 drivers/net/3c59x.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff -puN drivers/net/3c59x.c~3c59x-collision-statistics-fix-fix drivers/net/3c59x.c

drivers/net/3c59x.c renamed from drivers/net/3c59x.c~3c59x-collision-statistics-fix-fix +5 -7
@@ -2085,16 +2085,14 @@ vortex_error(struct net_device *dev, int
 		}
 		if (tx_status & 0x14)  vp->stats.tx_fifo_errors++;
 		if (tx_status & 0x38)  vp->stats.tx_aborted_errors++;
+		if (tx_status & 0x08)  vp->xstats.tx_max_collisions++;
 		iowrite8(0, ioaddr + TxStatus);
 		if (tx_status & 0x30) {			/* txJabber or txUnderrun */
 			do_tx_reset = 1;
-		} else if (tx_status & 0x08) {	/* maxCollisions */
-			vp->xstats.tx_max_collisions++;
-			if (vp->drv_flags & MAX_COLLISION_RESET) {
-				do_tx_reset = 1;
-				reset_mask = 0x0108;		/* Reset interface logic, but not download logic */
-			}
-		} else {						/* Merely re-enable the transmitter. */
+		} else if ((tx_status & 0x08) && (vp->drv_flags & MAX_COLLISION_RESET))  {	/* maxCollisions */
+			do_tx_reset = 1;
+			reset_mask = 0x0108;		/* Reset interface logic, but not download logic */
+		} else {				/* Merely re-enable the transmitter. */
 			iowrite16(TxEnable, ioaddr + EL3_CMD);
 		}
 	}

_

Signature · 1 line
Pete Clements 
#10 lore raw
In reply to Pete Clements
Quoted 5 lines · Pete Clements

Quoting Steffen Klassert

Quoted 3 lines
Quoted 2 lines

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

Quoted 8 lines
Quoted 3 lines

Is this for sure that these messages occured first time with git11? There were no changes in the 3c59x driver between git10 and git11.

Tried 2.6.15 and could not get a timed out condition. Looks like that defect is between 15 and 16 in my case.

Be glad to do any testing that I can.

Please try adding the 3c59x module parameter `global_enable_wol=0', see if that helps.

#11 lore raw

Quoting Andrew Morton

Quoted 7 lines
Quoted 7 lines

Quoting Steffen Klassert

Quoted 6 lines
Quoted 2 lines

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

Is this for sure that these messages occured first time with git11? There were no changes in the 3c59x driver between git10 and git11.

Quoted 9 lines
Quoted 5 lines

Tried 2.6.15 and could not get a timed out condition. Looks like that defect is between 15 and 16 in my case.

Be glad to do any testing that I can.

Please try adding the 3c59x module parameter `global_enable_wol=0', see if that helps.

Driver is compiled in, not module.

Signature · 1 line
Pete Clements 
#12 lore raw
Quoted 12 lines · Pete Clements

Quoting Andrew Morton

Quoted 10 lines
Quoted 10 lines

Quoting Steffen Klassert

Quoted 6 lines
Quoted 2 lines

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

Is this for sure that these messages occured first time with git11? There were no changes in the 3c59x driver between git10 and git11.

Tried 2.6.15 and could not get a timed out condition. Looks like that defect is between 15 and 16 in my case.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Be glad to do any testing that I can.

Please try adding the 3c59x module parameter `global_enable_wol=0', see if that helps.

Driver is compiled in, not module.

Boot with 3c59x.global_enable_wol=0 on the kernel command line.

#13 lore raw

Quoting Andrew Morton

Quoted 17 lines
Quoted 15 lines · Pete Clements

Quoting Andrew Morton

Quoted 13 lines
Quoted 12 lines

Quoting Steffen Klassert

Quoted 6 lines
Quoted 2 lines

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

Is this for sure that these messages occured first time with git11? There were no changes in the 3c59x driver between git10 and git11.

Tried 2.6.15 and could not get a timed out condition. Looks like that defect is between 15 and 16 in my case.

Be glad to do any testing that I can.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Please try adding the 3c59x module parameter `global_enable_wol=0', see if that helps.

Driver is compiled in, not module.

Boot with 3c59x.global_enable_wol=0 on the kernel command line.

Backed out your second patch and booted with the parameter. Not seeing the time outs.

Signature · 1 line
Pete Clements 
#14 lore raw
Quoted 22 lines · Pete Clements

Quoting Andrew Morton

Quoted 20 lines
Quoted 18 lines · Pete Clements

Quoting Andrew Morton

Quoted 16 lines
Quoted 4 lines

Quoting Steffen Klassert

Quoted 3 lines
Quoted 2 lines

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

Quoted 8 lines
Quoted 3 lines

Is this for sure that these messages occured first time with git11? There were no changes in the 3c59x driver between git10 and git11.

Tried 2.6.15 and could not get a timed out condition. Looks like that defect is between 15 and 16 in my case.

Be glad to do any testing that I can.

Please try adding the 3c59x module parameter `global_enable_wol=0', see if that helps.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Driver is compiled in, not module.

Boot with 3c59x.global_enable_wol=0 on the kernel command line.

Backed out your second patch and booted with the parameter. Not seeing the time outs.

Oh damn. So you're sure that 3c59x.global_enable_wol=0 actually makes the driver behave better?

For years the driver required a special module parameter to enable WOL, because there was some problem with some hardware. It's all lost in the mists of time.

So the situation as I understand it now is:

- We need to apply the "vortex_error() to not run iowrite16" fix

- The "do mdio_read() twice if we're reading MII_BMSR" patch does indeed fix something (what did it fix, again?) but we don't recall why the driver was reading it twice in the first place.

Both patches are appended below.

If we do both of those things, does the driver still require 3c59x.global_enable_wol=0 to function properly?

(This driver supports a huge number of cards spread across 15 or more years and it has large amounts of tricky trial-and-error knowledge in it. It's generally best not to touch it).

From: Andrew Morton <[email protected]>

The pre-2.6.16 patch "3c59x collision statistics fix" accidentally caused vortex_error() to not run iowrite16(TxEnable, ioaddr + EL3_CMD) if we got a maxCollisions interrupt but MAX_COLLISION_RESET is not set.

Cc Steffen Klassert <[email protected]>
Cc Pete Clements <[email protected]>

---

 drivers/net/3c59x.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
drivers/net/3c59x.c renamed from drivers/net/3c59x.c~3c59x-collision-statistics-fix-fix +5 -7
diff -puN drivers/net/3c59x.c~3c59x-collision-statistics-fix-fix drivers/net/3c59x.c
@@ -2085,16 +2085,14 @@ vortex_error(struct net_device *dev, int
 		}
 		if (tx_status & 0x14)  vp->stats.tx_fifo_errors++;
 		if (tx_status & 0x38)  vp->stats.tx_aborted_errors++;
+		if (tx_status & 0x08)  vp->xstats.tx_max_collisions++;
 		iowrite8(0, ioaddr + TxStatus);
 		if (tx_status & 0x30) {			/* txJabber or txUnderrun */
 			do_tx_reset = 1;
-		} else if (tx_status & 0x08) {	/* maxCollisions */
-			vp->xstats.tx_max_collisions++;
-			if (vp->drv_flags & MAX_COLLISION_RESET) {
-				do_tx_reset = 1;
-				reset_mask = 0x0108;		/* Reset interface logic, but not download logic */
-			}
-		} else {						/* Merely re-enable the transmitter. */
+		} else if ((tx_status & 0x08) && (vp->drv_flags & MAX_COLLISION_RESET))  {	/* maxCollisions */
+			do_tx_reset = 1;
+			reset_mask = 0x0108;		/* Reset interface logic, but not download logic */
+		} else {				/* Merely re-enable the transmitter. */
 			iowrite16(TxEnable, ioaddr + EL3_CMD);
 		}
 	}

_

From: Andrew Morton <[email protected]>

---

 drivers/net/3c59x.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)
drivers/net/3c59x.c renamed from drivers/net/3c59x.c~revert-3c59x-avoid-blindly-reading-link-status-twice +8 -1
diff -puN drivers/net/3c59x.c~revert-3c59x-avoid-blindly-reading-link-status-twice drivers/net/3c59x.c
@@ -3196,7 +3196,7 @@ static void mdio_sync(void __iomem *ioad
 	}
 }
 
-static int mdio_read(struct net_device *dev, int phy_id, int location)
+static int __mdio_read(struct net_device *dev, int phy_id, int location)
 {
 	int i;
 	struct vortex_private *vp = netdev_priv(dev);
@@ -3227,6 +3227,13 @@ static int mdio_read(struct net_device *
 	return retval & 0x20000 ? 0xffff : retval>>1 & 0xffff;
 }
 
+static int mdio_read(struct net_device *dev, int phy_id, int location)
+{
+	if (location == MII_BMSR)
+		__mdio_read(dev, phy_id, location);
+	return __mdio_read(dev, phy_id, location);
+}
+
 static void mdio_write(struct net_device *dev, int phy_id, int location, int value)
 {
 	struct vortex_private *vp = netdev_priv(dev);

_

#15 lore raw

Quoting Andrew Morton

Quoted 4 lines

Oh damn. So you're sure that 3c59x.global_enable_wol=0 actually makes the driver behave better?

I seem to have lost the ability to time out. Let me get back to a fresh 16 build and work forward again.
--
Pete Clements

#16 lore raw
In reply to Andrew Morton

Quoting Andrew Morton

Quoted 4 lines

Oh damn. So you're sure that 3c59x.global_enable_wol=0 actually makes the driver behave better?

Ok, new results.
Built a new virgin 2.6.16.
1) able to stimulate a tx time out message
2) rebooted with 3c59x.global_enable_wol=0 on command line, able to stimulate a tx time out message

Applied the collision statistics fix fix. Changed the extraversion in the top Makefile to preserve my baseline, also make does more work than previous.
1) Booted and unable to stimulate a tx time out message

Rebooted to virgin 2.6.16
1) able to stimulate a tx time out message
2) rebooted with 3c59x.global_enable_wol=0 on command line, able to stimulate a tx time out message

Rebooted to the patched driver kernel (collision statistics fix fix)
1) unable to stimulate a tx time out message.

Rebooted to virgin 2.6.16
1) able to stimulate a tx time out message

Appears that earlier results were tainted.

--
Pete Clements

#17 lore raw
Quoted 22 lines · Pete Clements

Quoting Andrew Morton

Quoted 4 lines

Oh damn. So you're sure that 3c59x.global_enable_wol=0 actually makes the driver behave better?

Ok, new results.
Built a new virgin 2.6.16.
1) able to stimulate a tx time out message
2) rebooted with 3c59x.global_enable_wol=0 on command line, able to stimulate a tx time out message

Applied the collision statistics fix fix. Changed the extraversion in the top Makefile to preserve my baseline, also make does more work than previous.
1) Booted and unable to stimulate a tx time out message

Rebooted to virgin 2.6.16
1) able to stimulate a tx time out message
2) rebooted with 3c59x.global_enable_wol=0 on command line, able to stimulate a tx time out message

Quoted 8 lines

Rebooted to the patched driver kernel (collision statistics fix fix)
1) unable to stimulate a tx time out message.

Rebooted to virgin 2.6.16
1) able to stimulate a tx time out message

Appears that earlier results were tainted.

OK, thanks. So it looks like 3c59x-collision-statistics-fix-fix.patch is the only patch which we need to return your machine to working condition?

#18 lore raw

Quoting Andrew Morton

Quoted 26 lines
Quoted 25 lines · Pete Clements

Quoting Andrew Morton

Quoted 4 lines

Oh damn. So you're sure that 3c59x.global_enable_wol=0 actually makes the driver behave better?

Ok, new results.
Built a new virgin 2.6.16.
1) able to stimulate a tx time out message
2) rebooted with 3c59x.global_enable_wol=0 on command line, able to stimulate a tx time out message

Applied the collision statistics fix fix. Changed the extraversion in the top Makefile to preserve my baseline, also make does more work than previous.
1) Booted and unable to stimulate a tx time out message

Rebooted to virgin 2.6.16
1) able to stimulate a tx time out message
2) rebooted with 3c59x.global_enable_wol=0 on command line, able to stimulate a tx time out message

Rebooted to the patched driver kernel (collision statistics fix fix)
1) unable to stimulate a tx time out message.

Quoted 9 lines
Quoted 5 lines

Rebooted to virgin 2.6.16
1) able to stimulate a tx time out message

Appears that earlier results were tainted.

OK, thanks. So it looks like 3c59x-collision-statistics-fix-fix.patch is the only patch which we need to return your machine to working condition?

Looks like that is the case until -git12, which Steffen has identified. Tested on git18 (with git12 fix) and looks good.

Signature · 1 line
Pete Clements 
#19 lore raw
Quoted 3 lines · Pete Clements

Looks like that is the case until -git12, which Steffen has identified. Tested on git18 (with git12 fix) and looks good.

This Patch is a candidate for the final fix to make 10base2 work again. Could you please try this together with Andrews 3c59x-collision-statistics-fix-fix.patch?

Steffen

drivers/net/3c59x.c +12 -9
@@ -788,7 +788,7 @@
 	int options;						/* User-settable misc. driver options. */
 	unsigned int media_override:4, 		/* Passed-in media type. */
 		default_media:4,				/* Read from the EEPROM/Wn3_Config. */
-		full_duplex:1, force_fd:1, autoselect:1,
+		full_duplex:1, autoselect:1,
 		bus_master:1,					/* Vortex can only do a fragment bus-m. */
 		full_bus_master_tx:1, full_bus_master_rx:2, /* Boomerang  */
 		flow_ctrl:1,					/* Use 802.3x flow control (PAUSE only) */
@@ -1633,12 +1633,6 @@
 			((vp->full_duplex && vp->flow_ctrl && vp->partner_flow_ctrl) ?
 					0x100 : 0),
 			ioaddr + Wn3_MAC_Ctrl);
-
-	issue_and_wait(dev, TxReset);
-	/*
-	 * Don't reset the PHY - that upsets autonegotiation during DHCP operations.
-	 */
-	issue_and_wait(dev, RxReset|0x04);
 }
 
 static void vortex_check_media(struct net_device *dev, unsigned int init)
@@ -1663,7 +1657,7 @@
 	struct vortex_private *vp = netdev_priv(dev);
 	void __iomem *ioaddr = vp->ioaddr;
 	unsigned int config;
-	int i;
+	int i, mii_reg1, mii_reg5;
 
 	if (VORTEX_PCI(vp)) {
 		pci_set_power_state(VORTEX_PCI(vp), PCI_D0);	/* Go active */
@@ -1723,14 +1717,23 @@
 		printk(KERN_DEBUG "vortex_up(): writing 0x%x to InternalConfig\n", config);
 	iowrite32(config, ioaddr + Wn3_Config);
 
-	netif_carrier_off(dev);
 	if (dev->if_port == XCVR_MII || dev->if_port == XCVR_NWAY) {
 		EL3WINDOW(4);
+		mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
+		mii_reg5 = mdio_read(dev, vp->phys[0], MII_LPA);
+		vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0);
+
 		vortex_check_media(dev, 1);
 	}
 	else
 		vortex_set_duplex(dev);
 
+	issue_and_wait(dev, TxReset);
+	/*
+	 * Don't reset the PHY - that upsets autonegotiation during DHCP operations.
+	 */
+	issue_and_wait(dev, RxReset|0x04);
+
 
 	iowrite16(SetStatusEnb | 0x00, ioaddr + EL3_CMD);
 
author Applied
#20 lore raw

Quoting Steffen Klassert

Quoted 61 lines · Pete Clements
Quoted 3 lines

Looks like that is the case until -git12, which Steffen has identified. Tested on git18 (with git12 fix) and looks good.

This Patch is a candidate for the final fix to make 10base2 work again. Could you please try this together with Andrews 3c59x-collision-statistics-fix-fix.patch?

Steffen

drivers/net/3c59x.c +6 -9
@@ -788,7 +788,7 @@
 	int options;						/* User-settable misc. driver options. */
 	unsigned int media_override:4, 		/* Passed-in media type. */
 		default_media:4,				/* Read from the EEPROM/Wn3_Config. */
-		full_duplex:1, force_fd:1, autoselect:1,
+		full_duplex:1, autoselect:1,
 		bus_master:1,					/* Vortex can only do a fragment bus-m. */
 		full_bus_master_tx:1, full_bus_master_rx:2, /* Boomerang  */
 		flow_ctrl:1,					/* Use 802.3x flow control (PAUSE only) */
@@ -1633,12 +1633,6 @@
 			((vp->full_duplex && vp->flow_ctrl && vp->partner_flow_ctrl) ?
 					0x100 : 0),
 			ioaddr + Wn3_MAC_Ctrl);
-
-	issue_and_wait(dev, TxReset);
-	/*
-	 * Don't reset the PHY - that upsets autonegotiation during DHCP operations.
-	 */
-	issue_and_wait(dev, RxReset|0x04);
 }
 
 static void vortex_check_media(struct net_device *dev, unsigned int init)
@@ -1663,7 +1657,7 @@
 	struct vortex_private *vp = netdev_priv(dev);
 	void __iomem *ioaddr = vp->ioaddr;
 	unsigned int config;
-	int i;
+	int i, mii_reg1, mii_reg5;
 
 	if (VORTEX_PCI(vp)) {
 		pci_set_power_state(VORTEX_PCI(vp), PCI_D0);	/* Go active */
@@ -1723,14 +1717,23 @@
 		printk(KERN_DEBUG "vortex_up(): writing 0x%x to InternalConfig\n", config);
 	iowrite32(config, ioaddr + Wn3_Config);
 
-	netif_carrier_off(dev);
 	if (dev->if_port == XCVR_MII || dev->if_port == XCVR_NWAY) {
 		EL3WINDOW(4);
+		mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
+		mii_reg5 = mdio_read(dev, vp->phys[0], MII_LPA);
+		vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0);
+
 		vortex_check_media(dev, 1);
 	}
 	else
 		vortex_set_duplex(dev);

drivers/net/3c59x.c line 1739

Quoted 10 lines
drivers/net/3c59x.c +6 -0
 
+	issue_and_wait(dev, TxReset);
+	/*
+	 * Don't reset the PHY - that upsets autonegotiation during DHCP operations.
+	 */
+	issue_and_wait(dev, RxReset|0x04);
+
 
 	iowrite16(SetStatusEnb | 0x00, ioaddr + EL3_CMD);
 

Applied to a fresh git18, all looks good.

Signature · 1 line
Pete Clements 
#21 lore raw
In reply to Pete Clements
Quoted 5 lines · Pete Clements

Quoting Steffen Klassert

Quoted 3 lines
Quoted 2 lines

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

Quoted 7 lines
Quoted 3 lines

Is this for sure that these messages occured first time with git11? There were no changes in the 3c59x driver between git10 and git11.

Tried 2.6.15 and could not get a timed out condition. Looks like that defect is between 15 and 16 in my case.

Be glad to do any testing that I can.

If it's noether of those then I'd expect the problem relates to the conversion to use the standard mii layer. Possibly we need to re-port some mdo reading oddity into 3c59x.c:mdio_read(), but it would take some effort to work out which one.

You could try this shot-in-the-dark:

drivers/net/3c59x.c renamed from drivers/net/3c59x.c~revert-3c59x-avoid-blindly-reading-link-status-twice +8 -1
diff -puN drivers/net/3c59x.c~revert-3c59x-avoid-blindly-reading-link-status-twice drivers/net/3c59x.c
@@ -3196,7 +3196,7 @@ static void mdio_sync(void __iomem *ioad
 	}
 }
 
-static int mdio_read(struct net_device *dev, int phy_id, int location)
+static int __mdio_read(struct net_device *dev, int phy_id, int location)
 {
 	int i;
 	struct vortex_private *vp = netdev_priv(dev);
@@ -3227,6 +3227,13 @@ static int mdio_read(struct net_device *
 	return retval & 0x20000 ? 0xffff : retval>>1 & 0xffff;
 }
 
+static int mdio_read(struct net_device *dev, int phy_id, int location)
+{
+	if (location == MII_BMSR)
+		__mdio_read(dev, phy_id, location);
+	return __mdio_read(dev, phy_id, location);
+}
+
 static void mdio_write(struct net_device *dev, int phy_id, int location, int value)
 {
 	struct vortex_private *vp = netdev_priv(dev);

_

#22 lore raw

Patch applied on top of previous patch to 2.6.16, no longer seeing the timeouts.

Quoted 50 lines
Quoted 5 lines · Pete Clements

Quoting Steffen Klassert

Quoted 3 lines
Quoted 2 lines

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

Quoted 7 lines
Quoted 3 lines

Is this for sure that these messages occured first time with git11? There were no changes in the 3c59x driver between git10 and git11.

Tried 2.6.15 and could not get a timed out condition. Looks like that defect is between 15 and 16 in my case.

Be glad to do any testing that I can.

If it's noether of those then I'd expect the problem relates to the conversion to use the standard mii layer. Possibly we need to re-port some mdo reading oddity into 3c59x.c:mdio_read(), but it would take some effort to work out which one.

You could try this shot-in-the-dark:

diff -puN drivers/net/3c59x.c~revert-3c59x-avoid-blindly-reading-link-status-twice drivers/net/3c59x.c

drivers/net/3c59x.c renamed from drivers/net/3c59x.c~revert-3c59x-avoid-blindly-reading-link-status-twice +8 -1
@@ -3196,7 +3196,7 @@ static void mdio_sync(void __iomem *ioad
 	}
 }
 
-static int mdio_read(struct net_device *dev, int phy_id, int location)
+static int __mdio_read(struct net_device *dev, int phy_id, int location)
 {
 	int i;
 	struct vortex_private *vp = netdev_priv(dev);
@@ -3227,6 +3227,13 @@ static int mdio_read(struct net_device *
 	return retval & 0x20000 ? 0xffff : retval>>1 & 0xffff;
 }
 
+static int mdio_read(struct net_device *dev, int phy_id, int location)
+{
+	if (location == MII_BMSR)
+		__mdio_read(dev, phy_id, location);
+	return __mdio_read(dev, phy_id, location);
+}
+
 static void mdio_write(struct net_device *dev, int phy_id, int location, int value)
 {
 	struct vortex_private *vp = netdev_priv(dev);

_

Signature · 1 line
Pete Clements 
#23 lore raw
In reply to Pete Clements

Quoting Pete Clements

Quoted 55 lines

From linux-kernel-owner+clem=40clem.clem-digital.net-S1751558AbWC0CMb@vger.kernel.org Sun Mar 26 21:12:57 2006
Return-Path: <linux-kernel-owner+clem=40clem.clem-digital.net-S1751558AbWC0CMb@vger.kernel.org>
Received: from vger.kernel.org (vger.kernel.org [209.132.176.167])

	by clem.clem-digital.net (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k2R2Cuso003676
	for <[email protected]>; Sun, 26 Mar 2006 21:12:56 -0500
Received: ([email protected]) by vger.kernel.org via listexpand
	id S1751558AbWC0CMb (ORCPT <rfc822;[email protected]>);
	Sun, 26 Mar 2006 21:12:31 -0500
Received: ([email protected]) by vger.kernel.org id S1751560AbWC0CMb
	(ORCPT <rfc822;linux-kernel-outgoing>);
	Sun, 26 Mar 2006 21:12:31 -0500
Received: from clem.clem-digital.net ([68.16.168.10]:47329 "EHLO
	clem.clem-digital.net") by vger.kernel.org with ESMTP
	id S1751547AbWC0CMb (ORCPT <rfc822;[email protected]>);
	Sun, 26 Mar 2006 21:12:31 -0500
Received: from clem.clem-digital.net (clem@localhost [127.0.0.1])
	by clem.clem-digital.net (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k2R2CUJe003656
	for <[email protected]>; Sun, 26 Mar 2006 21:12:30 -0500
Received: (from clem@localhost)
	by clem.clem-digital.net (8.13.4/8.13.4/Submit) id k2R2CUki003654
	for [email protected]; Sun, 26 Mar 2006 21:12:30 -0500

From: Pete Clements <[email protected]>
Message-Id: <[email protected]>
Subject: Correction: 2.6.16-git12 killed networking -- 3c900 card
To: [email protected] (linux-kernel)
Date: Sun, 26 Mar 2006 21:12:30 -0500 (EST)
X-Mailer: ELM [version 2.5 PL7]
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: [email protected]
Precedence: bulk
X-Mailing-List: [email protected]

Reported this earlier as a 3c509 card in error, should have been 3c900 (3c59x driver).

FYI:
Single 3c900 card, UP i386
Lost networking with .16-git12, message
ADDRCONF(NETDEV_UP): eth0: link is not ready

Had several of these with git11
NETDEV WATCHDOG: eth0: transmit timed out

No problems observed git1-git10

Signature · 6 lines
Pete Clements 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Signature · 1 line
Pete Clements