From owner-freebsd-bugs Fri Feb 18 4: 0: 6 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id E5BCB37B8BC for ; Fri, 18 Feb 2000 04:00:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id EAA20278; Fri, 18 Feb 2000 04:00:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from david.siemens.de (david.siemens.de [192.35.17.14]) by hub.freebsd.org (Postfix) with ESMTP id 5639B37B8AE for ; 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 ; 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 ; 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 ; 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 To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/16803: Newer Adaptec controllers make system hang with slices ending 1023/255/63 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Feb 18 04:00:01 PST 2000 >Closed-Date: >Last-Modified: >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: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message