Skip to contentSkip to conversation

docs: 3c509: remove note about card detection failing with overclock

PATCH In review Ethan Nelson-Moore 4 participants 7 messages Jan 7 – May 20

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

PATCH 1/1 docs: 3c509: remove note about card detection failing with overclock

The id_read_eeprom() function has been fixed to use a time-based delay, so this issue can no longer occur.

---
 .../networking/device_drivers/ethernet/3com/3c509.rst       | 6 ------
 1 file changed, 6 deletions(-)
Documentation/networking/device_drivers/ethernet/3com/3c509.rst +0 -6
index 47f706bacdd9..99ec25225e56 100644
@@ -177,12 +177,6 @@ While the updated driver works with most PnP BIOS programs, it does not work
 with all. This can be fixed by disabling PnP support using the 3Com-supplied
 setup program.
 
-3c509 card is not detected on overclocked machines
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Increase the delay time in id_read_eeprom() from the current value, 500,
-to an absurdly high value, such as 5000.
-
 
 Decoding Status and Error Messages
 ----------------------------------
Signature · 1 line
2.43.0
reviewer
#1 lore raw
Quoted 2 lines · Ethan Nelson-Moore

The id_read_eeprom() function has been fixed to use a time-based delay, so this issue can no longer occur.

Hi Ethan,

I guess this was fixed quite some time ago, given that the driver doesn't see much attention these days.

In any case, I think it would be worth providing a reference to the commit where this was fixed.

Quoted 2 lines

...

#2 lore raw
Quoted 2 lines · Simon Horman

In any case, I think it would be worth providing a reference to the commit where this was fixed.

I just checked with git blame and all of the mdelay/udelay references in the driver predate Git history.

#3 lore raw
Quoted 5 lines · Ethan Nelson-Moore
Quoted 2 lines · Simon Horman

In any case, I think it would be worth providing a reference to the commit where this was fixed.

I just checked with git blame and all of the mdelay/udelay references in the driver predate Git history.

For commits before the beginning of git, we just use the first commit in git.

Andrew

#4 lore raw
Quoted 7 lines · Andrew Lunn
Quoted 4 lines
Quoted 2 lines

In any case, I think it would be worth providing a reference to the commit where this was fixed.

I just checked with git blame and all of the mdelay/udelay references in the driver predate Git history.

For commits before the beginning of git, we just use the first commit in git.

As an active user of the driver I did some digging and tracked it down to
Linux 2.1.100, where we have this (among others):

drivers/net/3c509.c renamed from linux/drivers/net/3c509.c +7 -1
diff -u --recursive --new-file v2.1.99/linux/drivers/net/3c509.c linux/drivers/net/3c509.c
@@ -27,10 +27,22 @@
 	FIXES:
 		Alan Cox:       Removed the 'Unexpected interrupt' bug.
 		Michael Meskes:	Upgraded to Donald Becker's version 1.07.
-		Phil Blundell:  Media selection support.
+		Alan Cox:	Increased the eeprom delay. Regardless of 
+				what the docs say some people definitely
+				get problems with lower (but in card spec)
+				delays
+		v1.10 4/21/97 Fixed module code so that multiple cards may be detected,
+				other cleanups.  -djb
+		Andrea Arcangeli:	Upgraded to Donald Becker's version 1.12.
 */

[...]
/* Read a word from the EEPROM using the regular EEPROM access register.
Assume that we are in register window zero.
*/
-__initfunc(static ushort read_eeprom(short ioaddr, int index)) +static ushort read_eeprom(short ioaddr, int index)
{
outw(EEPROM_READ + index, ioaddr + 10);
/* Pause for at least 162 us. for the read to take place. */
- udelay (300);
+ udelay (500);
return inw(ioaddr + 12);
}

/* Read a word from the EEPROM when in the ISA ID probe state. */
-__initfunc(static ushort id_read_eeprom(int index)) +static ushort id_read_eeprom(int index)
{
int bit, word = 0;

@@ -340,8 +340,8 @@
outb(EEPROM_READ + index, id_port);

/* Pause for at least 162 us. for the read to take place. */
- udelay (300);
-
+ udelay (500);
+
for (bit = 15; bit >= 0; bit--)
word = (word << 1) + (inb(id_port) & 0x01);

-- so it's not about using a time-based vs some other kind of delay. The comment to be removed was only added along with the whole document on the 3c509 driver with Linux 2.5.13, much later (2002 vs 1998), and therefore still stands.

NAK for the change then. Where has the idea to drop this comment come
from anyway?

Maciej

#5 lore raw

Hi, Maciej,

Sorry for the extreme delay in responding - I somehow missed this message.

Quoted 4 lines · On 26 Jan 2026 Maciej W. Rozycki wrote:

-- so it's not about using a time-based vs some other kind of delay. The comment to be removed was only added along with the whole document on the 3c509 driver with Linux 2.5.13, much later (2002 vs 1998), and therefore still stands.

I traced back the usage of udelay in this driver and found that id_read_eeprom did in fact use a busy waiting loop before kernel 2.0.14:

https://github.com/schwabe/davej-history/commit/8cf64f0c94dcbf029dc3b12cb8e2afba590f8f72#diff-9acb56ec07fd10ccce51b1dc719976d60ee5a947dec31174e2a96f871fde72f9L331

This is probably what the comment was referring to, and therefore it is in fact incorrect. The documentation appears to have been imported from the Scyld out-of-tree driver (the basis of the mainline driver), which still mentioned the issue in 2003:
https://web.archive.org/web/20030605134029/http://www.scyld.com/network/3c509.html

I was not able to find a copy of an old Scyld driver easily to see if it was affected by the issue.

Hope that clarifies the situation.

Ethan

#6 lore raw
Quoted 5 lines · Ethan Nelson-Moore
Quoted 4 lines

-- so it's not about using a time-based vs some other kind of delay. The comment to be removed was only added along with the whole document on the 3c509 driver with Linux 2.5.13, much later (2002 vs 1998), and therefore still stands.

Quoted 7 lines

I traced back the usage of udelay in this driver and found that id_read_eeprom did in fact use a busy waiting loop before kernel 2.0.14:

https://github.com/schwabe/davej-history/commit/8cf64f0c94dcbf029dc3b12cb8e2afba590f8f72#diff-9acb56ec07fd10ccce51b1dc719976d60ee5a947dec31174e2a96f871fde72f9L331

This is probably what the comment was referring to, and therefore it is in fact incorrect.

Nope, the driver used to use:

	udelay (500);

which is what documentation refers to, quoting the delay value of 500 verbatim, as I noted in my reply, and as from 2.5.46 it has respectively:

	mdelay(2);

and:

	mdelay(4);

instead, so the commit description proposed was indeed incorrect as the delay mechanism didn't change, as I indicated.

Now the documentation piece discussed wasn't updated accordingly in
2.5.46 and likely asks for a fix or maybe removal, but the justification needs to be correct.

Maciej