Skip to contentSkip to conversation

wavelan has fatal error with 2.4.0 (but worked in 2.4.0-test12)

DISCUSSION Jean Tourrilhes 2 participants 5 messages Jan 9, 2001 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 11 lines · John Ruttenberg

I get:

    Jan  9 07:04:51 mojo cardmgr[511]: socket 1: Digital RoamAbout/DS
    Jan  9 07:04:52 mojo cardmgr[511]: executing: 'modprobe wavelan_cs'
    Jan  9 07:04:52 mojo cardmgr[511]: + /lib/modules/2.4.0-test11/pcmcia/wavelan_cs.o: unresolved symbol __bad_udelay
    Jan  9 07:04:52 mojo cardmgr[511]: + /lib/modules/2.4.0-test11/pcmcia/wavelan_cs.o: insmod /lib/modules/2.4.0-test11/pcmcia/wavelan_cs.o failed
    Jan  9 07:04:52 mojo cardmgr[511]: + /lib/modules/2.4.0-test11/pcmcia/wavelan_cs.o: insmod wavelan_cs failed
    Jan  9 07:04:52 mojo cardmgr[511]: modprobe exited with status 255
    Jan  9 07:04:52 mojo cardmgr[511]: executing: 'insmod /lib/modules/2.4.0/pcmcia/wavelan_cs.o'
    Jan  9 07:04:52 mojo cardmgr[511]: + /lib/modules/2.4.0/pcmcia/wavelan_cs.o: unresolved symbol __bad_udelay
    Jan  9 07:04:52 mojo cardmgr[511]: insmod exited with status 1

This is a bug with the definition of udelay(). Somebody tried
to be too clever with udelay(), and the end result is that it breaks perfectly good and valid code.
Therefore, it should be reported as such on LKML, a bug in udelay().

I think that Alan has a ugly workaround for this driver (or
maybe it's only for wavelan.c) in the ac4 tree, so please check there. For my part, I insist that the code is correct, that replacing an inline function by a #define is going backwards and that udelay() should be fixed one way or another (easy, just define __bad_udelay() as returning a compilation warning or an error message).
Also, please remember that the version of wavelan_cs.c in the
kernel is outdated with respect to the version in the Pcmcia package.

	That's it...

	Jean

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
Quoted 4 lines

This is a bug with the definition of udelay(). Somebody tried
to be too clever with udelay(), and the end result is that it breaks perfectly good and valid code.
Therefore, it should be reported as such on LKML, a bug in udelay().

It is a bug in the driver.

Quoted 4 lines

there. For my part, I insist that the code is correct, that replacing an inline function by a #define is going backwards and that udelay() should be fixed one way or another (easy, just define __bad_udelay() as returning a compilation warning or an error message).

You can't #define a function to a #warning or #error in C. Language limitation

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#3 lore raw
In reply to Jean Tourrilhes
Quoted 6 lines · Alan Cox
Quoted 4 lines

This is a bug with the definition of udelay(). Somebody tried
to be too clever with udelay(), and the end result is that it breaks perfectly good and valid code.
Therefore, it should be reported as such on LKML, a bug in udelay().

It is a bug in the driver.

Please check again the code and point me the invalid
udelay(). You will realise that there is no delay in the driver that is longer than 100ms.
The bug is that udelay() can't be passed a variable but only a
constant. Therefore bug in udelay().

Quoted 6 lines
Quoted 4 lines

there. For my part, I insist that the code is correct, that replacing an inline function by a #define is going backwards and that udelay() should be fixed one way or another (easy, just define __bad_udelay() as returning a compilation warning or an error message).

You can't #define a function to a #warning or #error in C. Language limitation

Yes. Tough.

Jean
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#4 lore raw
Quoted 5 lines
Quoted 1 line

It is a bug in the driver.

Please check again the code and point me the invalid
udelay(). You will realise that there is no delay in the driver that is longer than 100ms.

The udelay limit is set a lot lower than 100mS. It has to be somewhat lower otherwise you have to do two levels of loops which will throw small udelay timings a fair whack.

Quoted 2 lines

The bug is that udelay() can't be passed a variable but only a
constant. Therefore bug in udelay().

Sounds like a compiler bug.

#define udelay(n) (__builtin_constant_p(n) ? \
	((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \
	__udelay(n))

non constants are covered.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#5 lore raw
In reply to Jean Tourrilhes
Quoted 9 lines · Alan Cox
Quoted 5 lines
Quoted 1 line

It is a bug in the driver.

Please check again the code and point me the invalid
udelay(). You will realise that there is no delay in the driver that is longer than 100ms.

The udelay limit is set a lot lower than 100mS. It has to be somewhat lower otherwise you have to do two levels of loops which will throw small udelay timings a fair whack.

Sorry, I mixed up my units. All the delays are lower than 100us.

Quoted 10 lines
Quoted 2 lines

The bug is that udelay() can't be passed a variable but only a
constant. Therefore bug in udelay().

Sounds like a compiler bug.

#define udelay(n) (__builtin_constant_p(n) ? \
	((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \
	__udelay(n))

non constants are covered.

Therefore, compiler bug. Ouch !

Jean
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/