From nobody@FreeBSD.org  Mon Jan 31 14:31:50 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9EC4916A4F5
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Jan 2005 14:31:50 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8822943D39
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Jan 2005 14:31:50 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j0VEVnWo029562
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Jan 2005 14:31:49 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j0VEVnCm029561;
	Mon, 31 Jan 2005 14:31:49 GMT
	(envelope-from nobody)
Message-Id: <200501311431.j0VEVnCm029561@www.freebsd.org>
Date: Mon, 31 Jan 2005 14:31:49 GMT
From: Paulo Belletato <pbelle@fisica.ufjf.br>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Fatal divide in booting processes with Buslogic BT 958 FW SCSI disk controler.
X-Send-Pr-Version: www-2.3

>Number:         76893
>Category:       kern
>Synopsis:       [cam] [patch] Fatal divide in booting processes with Buslogic BT 958 FW SCSI disk controler.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-scsi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 31 14:40:27 GMT 2005
>Closed-Date:    Fri Aug 20 09:48:15 UTC 2010
>Last-Modified:  Fri Aug 20 09:48:15 UTC 2010
>Originator:     Paulo Belletato
>Release:        Trying 5.3 Release.
>Organization:
Universidade Federal de Juiz de Fora
>Environment:
Trying 5.3 FreeBSD n01.fisica.ufjf.br 4.9-RELEASE FreeBSD 4.9-RELEASE #0: Mon Oct 27 17:51:09 GMT 2003     root@freebsd-stable.sentex.ca:/usr/obj/usr/src/sys/GENERIC  i386Release. Trying 5.3 Release.
>Description:
I've tried to install a 5.3 FreeBSD system in a i396 machine that are already running a FreeBSD 4.9 system. 

While I was in a booting processes the system crashes in to PANIC.

The problem seems to be a division by 0 in the Buslogic bt 958 FW controler.

I've copied (by hand) the error specification, and also I'm sending a copy of a dmesg from the running 4.9 FreeBSD system in the same machine.

Thank you.


5.3 FreeBSD system in installation processes. The system dos not boot properly.

>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:

From: "Andrew Bernard" <andrew@hobnob.com>
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
 

From: "Paulo Belletato" <pbelle@fisica.ufjf.br>
To: <freebsd-gnats-submit@FreeBSD.org>, <pbelle@fisica.ufjf.br>
Cc: <pbelle@fisica.ufjf.br>
Subject: Re: kern/76893: Fatal divide in booting processes with Buslogic BT 958 FW SCSI disk controler.
Date: Wed, 30 Mar 2005 11:17:13 -0300

 Hi,
 
 I've read your message yesterday and I apreciate your coment. Thank you.
 
 But, I don't know how to test your sugestion, because I usualy install
 FreeBSD from Binaries, and I don't have enough free space in my machine
 to try a "Make Build World" from sources distribution.
 
 So, I have to wait that this problem will be corrected in a future
 version of the operational system to try another installation from disk.
 
 Thank you so much,
 
 Paulo Belletato.
State-Changed-From-To: open->closed 
State-Changed-By: brucec 
State-Changed-When: Fri Aug 20 09:46:42 UTC 2010 
State-Changed-Why:  
Duplicate of kern/75603. 
Fixed in r145042 5 years ago. 


Responsible-Changed-From-To: freebsd-bugs->freebsd-scsi 
Responsible-Changed-By: brucec 
Responsible-Changed-When: Fri Aug 20 09:46:42 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=76893 
>Unformatted:
