From simokawa@sat.t.u-tokyo.ac.jp  Sat Oct 12 08:45:35 1996
Received: from uno.sat.t.u-tokyo.ac.jp (uno.sat.t.u-tokyo.ac.jp [133.11.70.160])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id IAA06176
          for <FreeBSD-gnats-submit@freebsd.org>; Sat, 12 Oct 1996 08:45:31 -0700 (PDT)
Received: by uno.sat.t.u-tokyo.ac.jp (8.7.3+2.6Wbeta5/8.7.3)
	id AAA05137; Sun, 13 Oct 1996 00:45:11 +0900 (JST)
Message-Id: <199610121545.AAA05137@uno.sat.t.u-tokyo.ac.jp>
Date: Sun, 13 Oct 1996 00:45:11 +0900 (JST)
From: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
Reply-To: simokawa@sat.t.u-tokyo.ac.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: recent ncr.c change doesn't work with ncr875
X-Send-Pr-Version: 3.2

>Number:         1779
>Category:       kern
>Synopsis:       recent ncr.c change doesn't work with ncr875
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 12 08:50:01 PDT 1996
>Closed-Date:    Sat Oct 12 10:36:55 PDT 1996
>Last-Modified:  Tue Nov 27 19:23:06 PST 2001
>Originator:     Hidetoshi Shimokawa
>Release:        FreeBSD 2.2-CURRENT i386
>Organization:
Univ. of Tokyo
>Environment:

With Tekram DC-390U

>Description:

kernel panics with trap 12 during probe of ncr875.
It is because ncr_getlock is called before np->reg hasn't been initialized.

>How-To-Repeat:

Build current kernel and reboot.

>Fix:
	
- Apply the following patch
or
- Define NCR_IOMAPPED (I have not checked yet)

*** ncr.c.orig  Sat Oct 12 18:49:13 1996
--- ncr.c       Sun Oct 13 00:30:31 1996
***************
*** 3286,3291 ****
--- 3286,3299 ----
        if (!pci_map_mem (config_id, 0x14, &np->vaddr, &np->paddr))
                return;
  
+       /*
+       **      Make the controller's registers available.
+       **      Now the INB INW INL OUTB OUTW OUTL macros
+       **      can be used safely.
+       */
+ 
+       np->reg = (struct ncr_reg*) np->vaddr;
+ 
  #ifdef NCR_IOMAPPED
        /*
        **      Try to map the controller chip into iospace.
***************
*** 3340,3353 ****
  
        np->jump_tcb.l_cmd      = SCR_JUMP;
        np->jump_tcb.l_paddr    = NCB_SCRIPT_PHYS (np, abort);
- 
-       /*
-       **      Make the controller's registers available.
-       **      Now the INB INW INL OUTB OUTW OUTL macros
-       **      can be used safely.
-       */
- 
-       np->reg = (struct ncr_reg*) np->vaddr;
  
        /*
        **  Get SCSI addr of host adapter (set by bios?).
--- 3348,3353 ----

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: se 
State-Changed-When: Sat Oct 12 10:36:55 PDT 1996 
State-Changed-Why:  
Fixed in revision 1.81 of ncr.c 
>Unformatted:
