From owner-freebsd-bugs@FreeBSD.ORG Mon Mar 21 22:50:08 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F27516A4CF for ; Mon, 21 Mar 2005 22:50:08 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2FDBF43D49 for ; Mon, 21 Mar 2005 22:50:08 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j2LMo8wc067488 for ; Mon, 21 Mar 2005 22:50:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j2LMo83l067482; Mon, 21 Mar 2005 22:50:08 GMT (envelope-from gnats) Date: Mon, 21 Mar 2005 22:50:08 GMT Message-Id: <200503212250.j2LMo83l067482@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: "Andrew Bernard" Subject: Re: kern/76893: Fatal divide in booting processes with Buslogic BT 958 FW SCSI disk controler. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Andrew Bernard List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2005 22:50:08 -0000 The following reply was made to PR kern/76893; it has been noted by GNATS. From: "Andrew Bernard" To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: kern/76893: Fatal divide in booting processes with Buslogic BT 958 FW SCSI disk controler. Date: 21 Mar 2005 17:44:04 -0500 Hi, I've been having the same problem with FreeBSD 5.3 and my BT-958. It looks like the drive or the BT-958 is returning zero for its "period factor" for whatever reason. The kernel code in src/sys/cam/scsi/scsi_all.c doesn't check for this (probably invalid) case and proceeds to use zero as a divisor at line 2329. Applying the following patch at line 2302 heads off the divide by zero and assumes that a "period factor" of zero means 20 mbit/sec SCSI: 2302c2302,2303 < { 0x0c, 5000 } /* FAST-20 */ --- > { 0x0c, 5000 }, /* FAST-20 */ > { 0x00, 5000 } /* FAST-20 */ This enables the drive to come up normally. I've been using this patch on my home system for about a month now, with no apparent problems (but use at your own risk!). I don't know whether it's safe to assume FAST-20 when the BT-958 returns zero for its "period factor", but I think that the kernel should at least be checking for a zero divisor and reporting a device error (instead of bringing the whole system down on a zero divide fault). Please let me know if any additional information would be helpful. Thanks, Andrew Bernard