Subject: Re: kern/10575: siop driver can't handle large timeouts
To: Dave Huang <khym@bga.com>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 07/18/2000 21:02:24
On Wed, Jul 12, 2000 at 10:22:48PM -0500, Dave Huang wrote:
> The timeout calculation in the siop driver overflows a 32-bit int
> if the requested timeout is sufficiently large... for example, scsictl's
> low level format option asks for 21600000ms (6 hours); if hz=100 (i386),
> 21600000 * hz = 2160000000 (0x80BEFC00), slightly too big for a signed
> int.
The problem is more critical on alpha, where hz is > 1000
> [...]
> >Fix:
> This seems to work, although it increases the granularity to 1 second...
This can be a problem, some commands requires much less than 1s.
What about using 64bit integers instead ?
>
> --- /usr/src/sys/dev/ic/siop.c Tue Jun 27 05:27:17 2000
> +++ siop.c Wed Jul 12 21:43:25 2000
> @@ -1355,8 +1355,8 @@
> XS_CTL_POLL) == 0) {
> /* start exire timer */
> timeout =
> - siop_cmd->xs->timeout *
> - hz / 1000;
> + siop_cmd->xs->timeout /
> + 1000 * hz;
> if (timeout == 0)
> timeout = 1;
> callout_reset(
--
Manuel Bouyer <bouyer@antioche.eu.org>
--