2004-09-28 20:08:14

by John W. Linville

[permalink] [raw]
Subject: [patch 2.6.9-rc2] 3c59x: do not mask reset of aism logic at rmmod

Some (earlier?) versions of the 3c905(B) card get confused and refuse to
work again after the 3c59x module is removed (even after reloading the
module). Changing vortex_remove_one() to allow the auto-initialize
state machine logic to be reset when the module is removed alleviates
this problem.

Signed-off-by: John W. Linville <[email protected]>
---
See http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=133388 for more
details.

If anyone can suggest a better way to fix this problem, please do so.
I'll be happy to pursue it.

drivers/net/3c59x.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

This patch should apply (with a little fuzz) to 2.4 as well...

--- linux-2.6/drivers/net/3c59x.c.orig
+++ linux-2.6/drivers/net/3c59x.c
@@ -3162,7 +3162,7 @@ static void __devexit vortex_remove_one
pci_restore_state(VORTEX_PCI(vp), vp->power_state);
}
/* Should really use issue_and_wait() here */
- outw(TotalReset|0x14, dev->base_addr + EL3_CMD);
+ outw(TotalReset|0x04, dev->base_addr + EL3_CMD);

pci_free_consistent(pdev,
sizeof(struct boom_rx_desc) * RX_RING_SIZE


2004-09-29 17:17:53

by Donald Becker

[permalink] [raw]
Subject: Re: [patch 2.6.9-rc2] 3c59x: do not mask reset of aism logic at rmmod

On Tue, 28 Sep 2004, John W. Linville wrote:

> Date: Tue, 28 Sep 2004 14:54:55 -0400
> From: John W. Linville <[email protected]>
> To: [email protected]
> Cc: [email protected], [email protected]
> Subject: [patch 2.6.9-rc2] 3c59x: do not mask reset of aism logic at rmmod
>
> Some (earlier?) versions of the 3c905(B) card get confused and refuse to
> work again after the 3c59x module is removed (even after reloading the
> module). Changing vortex_remove_one() to allow the auto-initialize
> state machine logic to be reset when the module is removed alleviates
> this problem.

...and creates a new problem: resetting the link causes operational
problems on many networks. The most obvious example is spanning tree
detection delays on switches, where the switch does not pass traffic.

This 3c59x.c code was changed in 2001 to mask the transceiver reset and
shut the chip down cleanly. This occurred in two steps, with a
discussion on the vortex mailing list for each.
3c59x.c:v0.99Uc 12/5/2001
3c59x.c:v0.99T 7/16/2001
The December change was noted as specifically for the 3c905B.

The correct solution is to reset the transceiver (and thus cause
re-autonegotiation) only if a problem is detected, not an unconditional
or proactive reset.

> --- linux-2.6/drivers/net/3c59x.c.orig
> +++ linux-2.6/drivers/net/3c59x.c
> @@ -3162,7 +3162,7 @@ static void __devexit vortex_remove_one
> pci_restore_state(VORTEX_PCI(vp), vp->power_state);
> }
> /* Should really use issue_and_wait() here */
> - outw(TotalReset|0x14, dev->base_addr + EL3_CMD);
> + outw(TotalReset|0x04, dev->base_addr + EL3_CMD);
>



--
Donald Becker [email protected]
Scyld Software Scyld Beowulf cluster systems
914 Bay Ridge Road, Suite 220 http://www.scyld.com
Annapolis MD 21403 410-990-9993

2004-10-17 15:04:22

by John W. Linville

[permalink] [raw]
Subject: [patch 2.6.9-rc2] 3c59x: remove EEPROM_RESET for 3c905B

Remove the EEPROM_RESET flag for the 3c905B cards.

Signed-off-by: John W. Linville <[email protected]>
---
Looks like I over-reached. Apparently only the 3c905 cards actually
need the EEPROM reset, and the 3c905B cards don't like it...

drivers/net/3c59x.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

--- linux-2.6/drivers/net/3c59x.c.orig 2004-10-17 10:53:38.142281232 -0400
+++ linux-2.6/drivers/net/3c59x.c 2004-10-17 10:54:25.975009552 -0400
@@ -508,12 +508,12 @@ static struct vortex_chip_info {
{"3c905 Boomerang 100baseT4",
PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, },
{"3c905B Cyclone 100baseTx",
- PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE|EEPROM_RESET, 128, },
+ PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },

{"3c905B Cyclone 10/100/BNC",
- PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EEPROM_RESET, 128, },
+ PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, },
{"3c905B-FX Cyclone 100baseFx",
- PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM|EEPROM_RESET, 128, },
+ PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
{"3c905C Tornado",
PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
{"3c920B-EMB-WNM (ATI Radeon 9100 IGP)",
@@ -564,7 +564,7 @@ static struct vortex_chip_info {
{"3c982 Hydra Dual Port B",
PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_HWCKSM|HAS_NWAY, 128, },
{"3c905B-T4",
- PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE|EEPROM_RESET, 128, },
+ PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
{"3c920B-EMB-WNM Tornado",
PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, },

--
John W. Linville
[email protected]

2004-10-17 15:19:38

by John W. Linville

[permalink] [raw]
Subject: [patch 2.4.28-pre3] 3c59x: remove EEPROM_RESET for 3c905B

Remove the EEPROM_RESET flag for the 3c905B cards.

Signed-off-by: John W. Linville <[email protected]>
---
Looks like I over-reached. Apparently only the 3c905 cards actually
need the EEPROM reset, and the 3c905B cards don't like it...

(Virtually identical to the 2.6 patch posted previously...)

drivers/net/3c59x.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

--- linux-2.4/drivers/net/3c59x.c.orig 2004-10-17 11:11:01.023739152 -0400
+++ linux-2.4/drivers/net/3c59x.c 2004-10-17 11:11:24.834119424 -0400
@@ -506,12 +506,12 @@ static struct vortex_chip_info {
{"3c905 Boomerang 100baseT4",
PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, },
{"3c905B Cyclone 100baseTx",
- PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE|EEPROM_RESET, 128, },
+ PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },

{"3c905B Cyclone 10/100/BNC",
- PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EEPROM_RESET, 128, },
+ PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, },
{"3c905B-FX Cyclone 100baseFx",
- PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM|EEPROM_RESET, 128, },
+ PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
{"3c905C Tornado",
PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
{"3c920B-EMB-WNM (ATI Radeon 9100 IGP)",
@@ -562,7 +562,7 @@ static struct vortex_chip_info {
{"3c982 Hydra Dual Port B",
PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_HWCKSM|HAS_NWAY, 128, },
{"3c905B-T4",
- PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE|EEPROM_RESET, 128, },
+ PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
{"3c920B-EMB-WNM Tornado",
PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, },

--
John W. Linville
[email protected]