NetBSD Problem Report #8645
Received: (qmail 24723 invoked from network); 18 Oct 1999 18:01:58 -0000
Message-Id: <199910181801.MAA11062@news.msu.montana.edu>
Date: Mon, 18 Oct 1999 12:01:58 -0600 (MDT)
From: mhitch@montana.edu
Reply-To: mhitch@montana.edu
To: gnats-bugs@gnats.netbsd.org
Subject: SCSI tape spacing times out immediately on 32-bit archs with clocks > 150Hz
X-Send-Pr-Version: 3.95
>Number: 8645
>Category: kern
>Synopsis: Tape spacing times out immediately on 32 bit architectures with RTC clock > 150 Hz
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: mjacob
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Oct 18 11:03:00 +0000 1999
>Closed-Date: Fri Apr 04 21:42:10 +0000 2003
>Last-Modified: Fri Apr 04 21:42:10 +0000 2003
>Originator: Michael L. Hitch
>Release: 1.4.1
>Organization:
ITC
Montana State University
>Environment:
System: NetBSD news.msu.montana.edu 1.4 NetBSD 1.4 (NEWS) #990517C-5: Wed Jul 7 16:11:57 MDT 1999 mhitch@news.msu.montana.edu:/d/d/sys/arch/pmax/compile/NEWS pmax
>Description:
On 32 bit architectures running with an RTC clock faster than 150Hz
(such as DECstations) a tape spacing operation with the ncr53c9x
driver will timeout immediately. It appears to me that this should
also occur with several other SCSI drivers that compute the
timeout in the same manner.
The problem is that the timeout is computed as:
timeout(ncr53c9x_timeout, ecb,
(ecb->timeout * hz) / 1000);
The value for hz on DECstations is 256, and the ecb->timeout value
for some tape commands is 4 * 60 * 60 * 1000. The multiply
overflows a 32 bit signed integer, resulting in a negative timeout.
Values for hz between 150 and 298 result in negative overflows.
>How-To-Repeat:
Build a DECstation kernel using the MI ncr53c9x and try to use a
tape drive. The ncr53c9x driver immediately times out.
>Fix:
I was able to workaround this by making ecb->timeout an unsigned
value.
Another possibilty would be to do the divide by 1000 before
multiplying by hz, but this would result in inaccuracies for
small timeout values. Doing the multiply first for small timeouts
and the divide first for larger timeouts should result in more
accurate calculations, at the expense of slightly more code.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->mjacob
Responsible-Changed-By: mjacob
Responsible-Changed-When: Wed Sep 13 08:04:56 PDT 2000
Responsible-Changed-Why:
I'll take this.
State-Changed-From-To: open->feedback
State-Changed-By: mjacob
State-Changed-When: Thu Mar 21 18:07:40 PST 2002
State-Changed-Why:
Need feedback as to whether this is still a problem
From: "Perry E. Metzger" <perry@piermont.com>
To: mhitch@montana.edu
Cc: gnats-bugs@gnats.netbsd.org, mjacob@netbsd.org, perry@piermont.com
Subject: Re: kern/8645
Date: 04 Apr 2003 15:57:11 -0500
>Synopsis: Tape spacing times out immediately on 32 bit architectures with RTC clock > 150 Hz
I'm cleaning out old PRs -- is this problem still present in -current?
Perry
From: "Michael L. Hitch" <mhitch@msu.oscs.montana.edu>
To: perry@piermont.com
Cc: gnats-bugs@gnats.netbsd.org, mjacob@netbsd.org
Subject: Re: kern/8645
Date: Fri, 4 Apr 2003 14:35:54 -0700
perry@snark.piermont.com writes:
> >Synopsis: Tape spacing times out immediately on 32 bit architectures with RTC clock > 150 Hz
>
> I'm cleaning out old PRs -- is this problem still present in -current?
When I last checked this (about a year ago), the problem appeared to have
been fixed. I haven't tried a tape drive on a pmax since that time, so
I can't say it's still working in -current. The original fix appears to
have been changed around a bit, but looks like it should do the same
thing and should be working ok.
Michael
---
Michael L. Hitch mhitch@montana.edu
Operations Consulting, Information Technology Center
Montana State University, Bozeman, MT USA
State-Changed-From-To: feedback->closed
State-Changed-By: perry
State-Changed-When: Fri Apr 4 13:41:43 PST 2003
State-Changed-Why:
The submitter believes the problem is now fixed.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.