From nobody  Tue May 27 02:15:03 1997
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.5/8.8.5) id CAA04686;
          Tue, 27 May 1997 02:15:03 -0700 (PDT)
Message-Id: <199705270915.CAA04686@hub.freebsd.org>
Date: Tue, 27 May 1997 02:15:03 -0700 (PDT)
From: Joel.Faedi@esial.u-nancy.fr
To: freebsd-gnats-submit@freebsd.org
Subject: kernel panic during wd hard disk probe if CMD640 is enabled
X-Send-Pr-Version: www-1.0

>Number:         3696
>Category:       kern
>Synopsis:       kernel panic during wd hard disk probe if CMD640 is enabled
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 27 02:20:00 PDT 1997
>Closed-Date:    Tue Dec 30 15:02:31 PST 1997
>Last-Modified:  Tue Dec 30 15:15:03 PST 1997
>Originator:     ESIAL - Nancy (France)
>Release:        2.2.1 and 2.2.2 and above
>Organization:
>Environment:
FreeBSD meduse.scinfo.u-nancy.fr 2.2.1-RELEASE FreeBSD 2.2.1-RELEASE #0: Sun May 25 10:08:52 CEST 1997     faedi@meduse.scinfo.u-nancy.fr:/usr/src/sys/compile/MEDUSE  i386
>Description:
kernel panics while testing wd hard drive if "options CMD640" is activated and if you don't have wd1 connected (even if the controleris a CMD640 or not).
>How-To-Repeat:
compile a kernel with "options CMD640", put a single hard disk onyour first IDE controler, system panic while testing hard disks.
>Fix:
in file /usr/src/sys/i386/isa/wd.c, in function "wdattach", change the lines:-------------------------------------------------#ifdef CMD640
     wdtab[du->dk_ctrlr_cmd640].b_active = 2;
#else
      wdtab[dvp->id_unit].b_active = 2;
#endif-------------------------------------------------
by the lines:-------------------------------------------------
#ifdef CMD640
      if (eide_quirks & Q_CMD640B) {
        wdtab[PRIMARY].b_active = 2;
      } else {
        wdtab[dvp->id_unit].b_active = 2;
      }
#else
      wdtab[dvp->id_unit].b_active = 2;
#endif
-------------------------------------------------

>Release-Note:
>Audit-Trail:

From: Stefan Esser <se@FreeBSD.ORG>
To: Joel.Faedi@esial.u-nancy.fr
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: kern/3696: kernel panic during wd hard disk probe if CMD640 is enabled
Date: Tue, 27 May 1997 14:05:46 +0200

 On May 27, Joel.Faedi@esial.u-nancy.fr wrote:
 > >Description:
 > kernel panics while testing wd hard drive if "options CMD640" is activated and if you don't have wd1 connected (even if the controleris a CMD640 or not).
 > >How-To-Repeat:
 > compile a kernel with "options CMD640", put a single hard disk onyour first IDE controler, system panic while testing hard disks.
 
 > >Fix:
 > in file /usr/src/sys/i386/isa/wd.c, in function "wdattach", change the lines:-------------------------------------------------
 > #ifdef CMD640
 >      wdtab[du->dk_ctrlr_cmd640].b_active = 2;
 > #else
 >       wdtab[dvp->id_unit].b_active = 2;
 > #endif-------------------------------------------------
 
 > by the lines:-------------------------------------------------
 > #ifdef CMD640
 >       if (eide_quirks & Q_CMD640B) {
 >         wdtab[PRIMARY].b_active = 2;
 >       } else {
 >         wdtab[dvp->id_unit].b_active = 2;
 >       }
 > #else
 >       wdtab[dvp->id_unit].b_active = 2;
 > #endif
 
 Sorry, but I don't see what this patch changes.
 
 du->dk_ctrlr_cmd640 is set to either PRIMARY or du->dk_ctrlr
 (which is identical to dvp->id_unit) early in wdattach, and
 the value choosen is made dependent on the same condition as
 you suggest above.
 
 Are you sure the patch makes a difference ?
 I can't see how it could ...
 
 Regards, STefan
State-Changed-From-To: open->closed 
State-Changed-By: helbig 
State-Changed-When: Tue Dec 30 15:02:31 PST 1997 
State-Changed-Why:  
The patch was applied on 1997/05/27 (r 1.130 of wd.c) 
and fixed the problem. 
>Unformatted:
