From andre.albsmeier@mchp.siemens.de  Fri Feb 18 03:52:02 2000
Return-Path: <andre.albsmeier@mchp.siemens.de>
Received: from david.siemens.de (david.siemens.de [192.35.17.14])
	by hub.freebsd.org (Postfix) with ESMTP id 5639B37B8AE
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 18 Feb 2000 03:51:38 -0800 (PST)
	(envelope-from andre.albsmeier@mchp.siemens.de)
Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14])
	by david.siemens.de (8.9.3/8.9.3) with ESMTP id MAA00030
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 18 Feb 2000 12:51:36 +0100 (MET)
Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.42.7])
	by mail1.siemens.de (8.9.3/8.9.3) with ESMTP id MAA21244
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 18 Feb 2000 12:51:35 +0100 (MET)
Received: (from daemon@localhost)
	by curry.mchp.siemens.de (8.9.3/8.9.3) id MAA18215
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 18 Feb 2000 12:51:35 +0100 (CET)
Message-Id: <200002181151.MAA56021@internal>
Date: Fri, 18 Feb 2000 12:51:32 +0100 (CET)
From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Newer Adaptec controllers make system hang with slices ending 1023/255/63
X-Send-Pr-Version: 3.2

>Number:         16803
>Category:       kern
>Synopsis:       Newer Adaptec controllers make system hang with slices ending 1023/255/63
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 18 04:00:01 PST 2000
>Closed-Date:    Wed Jun 14 05:03:27 PDT 2000
>Last-Modified:  Wed Jun 14 05:04:29 PDT 2000
>Originator:     Andre Albsmeier
>Release:        FreeBSD 3.4-STABLE i386
>Organization:
>Environment:

All FreeBSD systems using an fdisk slice entry that end's with
cyl 1023/ sector 63/ head 255 in order to shut up error messages
during verbose booting.

>Description:

During boot, /sys/i386/isa/diskslice_machdep.c tries to verify in
check_part() that the slice entries in the partition table are somehow
consistent.

If booting verbose an error message is generated if this isn't true. To
provide a possibility to shut up this message, the 1023/255/63 geometry
is always allowed.

If you have entered this 1023/255/63 geometry for the end of a slice,
newer Adaptec controller (e.g. the 2940UW with BIOS 2.20 or the 2940U2W)
will make the system freeze when it should start to load _any_ operating
system.

This is _not_ a FreeBSD problem. It is enough to have any harddisk
containing a slice ending with the above geometry attached to the bus
and have the 'Include in BIOS Scan' entry set to yes in the Adaptec
BIOS to make the system hang.

I could not observe the problem on a 2940UW running BIOS 1.34.3
or on an ASUS P2B-LS with a SCSI BIOS 2.11.


>How-To-Repeat:

Take a disk and make a slice ending in 1023/255/63. Attach it to
a controller as described above and set the 'Include in BIOS Scan'
entry to yes for this drive. Boot any OS.

>Fix:

I don't know why this happens. I assume, that the various boot
codes try to read the disk where slices are ending. For the
faked slice entry, they pass 1023/255/63 to the controller and
make it hang now. Interestingly 1023/254/63 works. This maybe
due to the fact that an ending head entry of 255 means that 256
heads are used. The Adaptec controllers are normally translating
the drives to a 255/63 geometry which would require a 254/63 entry
for the end of the slice. (Who invented this f*cked up spec?!?)

Maybe we should accept the geometry 1023/254/63 as well for
the end of slice entry in /sys/i386/isa/diskslice_machdep.c?
This could be accomplished by this patch:

--- diskslice_machdep.c.ORI	Fri Feb 18 12:35:21 2000
+++ diskslice_machdep.c	Fri Feb 18 12:38:27 2000
@@ -121,13 +121,13 @@
 		  + mbr_offset;
 	esector1 = ssector1 + dp->dp_size - 1;
 
-	/* Allow certain bogus C/H/S values for esector, as above. */
+	/* Allow certain bogus C/H/S values for esector, as above and 1023/254/63. */
 	if (esector < esector1
 	    && ((chs_esect == nsectors && dp->dp_ehd == ntracks - 1
 		 && chs_ecyl == 1023)
 		|| (secpercyl != 0
 		    && (esector1 - esector) % (1024 * secpercyl) == 0))
-	    || (dp->dp_ecyl == 255 && dp->dp_ehd == 255
+	    || (dp->dp_ecyl == 255 && dp->dp_ehd | 1 == 255
 		&& dp->dp_esect == 255)) {
 		TRACE(("%s: C/H/S end %d/%d/%d, end %lu: allow\n",
 		       sname, chs_ecyl, dp->dp_ehd, chs_esect, esector1));


>Release-Note:
>Audit-Trail:

From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/16803: Newer Adaptec controllers make system hang with slices ending 1023/255/63
Date: Wed, 14 Jun 2000 12:13:21 +0200

 Adaptec has released a new version of their BIOS (2.57.2). With
 this BIOS, the error can't be reproduced anymore. So the suggestion
 in this PR is obsolete but people should note that they will
 get problems when using the geometry in question with an Adaptec
 BIOS 2.20.
 
 The new BIOS can be found at
 
 ftp://ftp.adaptec.digisle.net/eprom_bios/2940uw_bios_v2572.exe
 
 and
 
 ftp://ftp.adaptec.digisle.net/eprom_bios/2940u2w_bios_v2572.exe
 
 	-Andre
 
State-Changed-From-To: open->closed 
State-Changed-By: nectar 
State-Changed-When: Wed Jun 14 05:03:27 PDT 2000 
State-Changed-Why:  
Closed at request of originator. 

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