Skip to contentSkip to conversation

pcnet32 79C975 fiber fix

PATCH Applied [email protected] 3 participants 4 messages Mar 15, 2005 – Mar 22, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 12/13 pcnet32 79C975 fiber fix

From: "HARDY, Steven" <[email protected]>

I have found a bug in the pcnet32 driver (drivers/net/pcnet32.c) affecting all ethernet cards based on the AMD79C975 chip, using the fiber interface.

It's a one line fix, where some config registers get corrupted during initialisation (which stops the Fiber interface working with this chip)

This bug was introduced somewhere betweeen 2.4.17 and 2.6.x (noticed whilst upgrading to 2.6), and it may affect other chips too. I have checked all versions up to 2.6.11-bk6 and they are all broken.

---

 25-akpm/drivers/net/pcnet32.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/pcnet32.c renamed from drivers/net/pcnet32.c~pcnet32-bug-79c975-fiber-fix +2 -1
diff -puN drivers/net/pcnet32.c~pcnet32-bug-79c975-fiber-fix drivers/net/pcnet32.c
@@ -1351,7 +1351,8 @@ pcnet32_probe1(unsigned long ioaddr, int
 	printk(KERN_INFO "%s: registered as %s\n", dev->name, lp->name);
     cards_found++;
 
-    a->write_bcr(ioaddr, 2, 0x1002);	/* enable LED writes */
+    /* enable LED writes */
+    a->write_bcr(ioaddr, 2, a->read_bcr(ioaddr, 2) | 0x1002);
 
     return 0;
 

_

#1 lore raw

I had not seen this problem until now. The patch looks ok and probably should have been written that way initially. I have been able to do a quick touch test with a 970A, 971, 972, 973, 975, 976, and 978 (some on ia32 and others on ppc64) without any adverse effects. The 975 I have is copper not fiber.

Since only bit 12 is needed to enable LED writes, the code could really be "a->write_bcr(ioaddr, 2, a->read_bcr(ioaddr, 2) | 0x1000);" During pcnet32_open the ASEL bit is changed anyway.

This change should also be applied to 2.4.30 as well.

Quoted 34 lines · On Tue, Mar 15, 2005 at 02:22:48PM -0800, [email protected] wrote:

From: "HARDY, Steven" <[email protected]>

I have found a bug in the pcnet32 driver (drivers/net/pcnet32.c) affecting all ethernet cards based on the AMD79C975 chip, using the fiber interface.

It's a one line fix, where some config registers get corrupted during initialisation (which stops the Fiber interface working with this chip)

This bug was introduced somewhere betweeen 2.4.17 and 2.6.x (noticed whilst upgrading to 2.6), and it may affect other chips too. I have checked all versions up to 2.6.11-bk6 and they are all broken.

---

 25-akpm/drivers/net/pcnet32.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN drivers/net/pcnet32.c~pcnet32-bug-79c975-fiber-fix drivers/net/pcnet32.c

drivers/net/pcnet32.c renamed from drivers/net/pcnet32.c~pcnet32-bug-79c975-fiber-fix +2 -1
@@ -1351,7 +1351,8 @@ pcnet32_probe1(unsigned long ioaddr, int
 	printk(KERN_INFO "%s: registered as %s\n", dev->name, lp->name);
     cards_found++;
 
-    a->write_bcr(ioaddr, 2, 0x1002);	/* enable LED writes */
+    /* enable LED writes */
+    a->write_bcr(ioaddr, 2, a->read_bcr(ioaddr, 2) | 0x1002);
 
     return 0;
 

_

Signature · 2 lines
Don Fry
[email protected]
#2 lore raw
Quoted 6 lines · Don Fry

I had not seen this problem until now. The patch looks ok and
probably should have been written that way initially. I have been able to do a quick touch test with a 970A, 971, 972, 973, 975, 976, and 978 (some on ia32 and others on ppc64) without any adverse effects. The 975 I have is copper not fiber.

Great, thanks.

Quoted 3 lines

Since only bit 12 is needed to enable LED writes, the code could really be "a->write_bcr(ioaddr, 2, a->read_bcr(ioaddr, 2) | 0x1000);" During pcnet32_open the ASEL bit is changed anyway.

OK, could you please prepare a final patch sometime and get it into Jeff? cc me as well please so I can update the patch I have.

Quoted 1 line

This change should also be applied to 2.4.30 as well.

And that too, I guess.

#3 lore raw
Quoted 12 lines · Andrew Morton
Quoted 5 lines · Don Fry

I had not seen this problem until now. The patch looks ok and probably should have been written that way initially. I have been able to do a quick touch test with a 970A, 971, 972, 973, 975, 976, and 978 (some on ia32 and others on ppc64) without any adverse effects. The 975 I have is copper not fiber.

Great, thanks.

Quoted 6 lines
Quoted 3 lines

Since only bit 12 is needed to enable LED writes, the code could really be "a->write_bcr(ioaddr, 2, a->read_bcr(ioaddr, 2) | 0x1000);" During pcnet32_open the ASEL bit is changed anyway.

OK, could you please prepare a final patch sometime and get it into Jeff? cc me as well please so I can update the patch I have.

Yes, please do Don, if you have the time.

Jeff