Re: linux-2.1.102/drivers/scsi/fdomain.c as module hangs system

Linus Torvalds (torvalds@transmeta.com)
Tue, 19 May 1998 22:04:55 -0700 (PDT)


On Wed, 20 May 1998, Paul Gortmaker wrote:
>
> That should be udelay, not usleep of course,

Duh. Yes.

> but it gives me an excuse
> to bring up another point. A comment near the udelay code hints that
> you shouldn't use it for > 1000us. Yet this seems largely ignored in
> various driver source files (with delays up to 1000000us being used)

With too large values, the udelay counter will simply overflow. I suspect
anything under a second is reasonably safe, but precision is probably
horrible.

> My question is, do we:
>
> (a) ignore it
> (b) when >1000, replace each occurence with:
> {unsigned int msec = XXXX; while (--msec) udelay(1000);}
> (c) indroduce a "mdelay()" that does (b)
> (d) order a pizza

My answer currently seems to be "all of the above".

(c) would certainly make sense.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu