From owner-freebsd-current@FreeBSD.ORG Sun Sep 7 04:47:58 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BAA0216A4BF for ; Sun, 7 Sep 2003 04:47:58 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id B391043FBF for ; Sun, 7 Sep 2003 04:47:56 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id VAA05500; Sun, 7 Sep 2003 21:47:47 +1000 Date: Sun, 7 Sep 2003 21:47:46 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Mark Dixon In-Reply-To: <3F5A7970.8000805@markdnet.demon.co.uk> Message-ID: <20030907212417.E13751@delplex.bde.org> References: <3F5A7970.8000805@markdnet.demon.co.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: current@freebsd.org Subject: Re: LS120, ATANg and Atapicam X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Sep 2003 11:47:58 -0000 On Sun, 7 Sep 2003, Mark Dixon wrote: > I'm not sure if this is a known problem, but I don't see any references > to it. I've gone from 5.1-RELEASE to todays CURRENT to try to get rid of > a different panic (no news on that yet), but I have hit this one. > > If I boot my system with no floppy in the LS-120, the system panics > where atapicam creates da0 for it. If there is a disk in the drive, it > works fine. > > As yet, I havn't got the details of the panic, but if this is of > interest to anyone here, I will be willing to provide them with them > (they wil have to be be copied out by hand, so I'm lothe to do it if > nobody is interested). I see similar bugs for a 1 ZIP drive 2 CDROM drives. The panic is mostly for division by 0 in cam_calc_geometry(), but sometimes there is division by a garbage value and the error is detected before it causes a panic. Debugging one of the CDROM drives shows that all SCSI commands done as part of cdopen() succeed although there is no disk in the drive! Most of the commands are reads and the reads are apparently null, leaving garbage in the buffers. In particular, the disk geometry is garbage and dividing by a garbage sector size of 0 causes the panic. The SCSI commands get at least as far as ata_completed() (via ata_command() and ata_interrupt() so they apparently get sent to the drive, but no errors are detected. For ATAPI drives, there are no problems unless the drives are explicitly accessed since GEOM doesn't probe them unconditonally. Panics for the ZIP drive are deterministic here since GEOM accesses it unconditionally at boot time when the garbage is more likely to be 0. Bruce