Subject: port-vax/11124: DMA on SCSI drive for M3100/M10 is broken and possible fix
To: None <gnats-bugs@gnats.netbsd.org>
From: None <John.C.Hayward@wheaton.edu>
List: netbsd-bugs
Date: 10/03/2000 09:59:24
>Number:         11124
>Category:       port-vax
>Synopsis:       DMA to SCSI drives on M3100/M10 is broken and fix
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-vax-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 03 10:05:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     John Hayward
>Release:        NetBSD-ALPHA2
>Organization:
Wheaton College
>Environment:
	
System: NetBSD csserver4.wheaton.edu 1.5_ALPHA2 NetBSD 1.5_ALPHA2 (GENERIC) #1:
Sat Sep 30 21:42:40 CDT 2000
johnh@csserver4.wheaton.edu:/usr/cvssrc/sys/arch/vax/compile/GENERIC vax

>Description:
	DMA for SCSI drives on the second (B) chain on MicroVAX 3100/M10 is
	broken.  The sympoms are noticed when you attempt to do a disk label
	followed by a new file system.  The disklabel appears to work.  
	When you run newfs it appears to work writing out the backup blocks,
	however it fails at the end reporting bogus error messages such as
	readonly disk.  Following that when you attempt to read the disk label
	it complains that there is no disk label.  Basicly using local drives
	is not possible with the bug in place.  Fix resolves the problem for
        M3100/M10 - not sure if there is impact on using the SCSIA chain where
        the TKxx tape is hung on.

>How-To-Repeat:
        disklabel -r -w sd0 rz56  (* where rz56 is a reasonable disktab *)
	disklabel -r 	          (* can read the label *)
	newfs /dev/sd0a		  (* make a new file system - note errors
				     at end *)
	disklabel -r 		  (* disk label gone *)
>Fix:
	Jun 25th code was introduced into sys/arch/vax/vsa/nrc.c which sets
	a DMA offset for certain vax machines of which MicroVAX 3100 is one
	of them.  Aparently this does not work on the MicroVAX 3100.  Removing
	this line of code, building a new kernel resolves the problem.

	Below is a diff of ncr.c which resolves the problem.  The line
sc->ncr_off = DMASIZE
        is ifdefed out.

scilab30# diff -C 7 ncr.c*
*** ncr.c       Sat Sep 30 21:39:34 2000
--- ncr.c.alpha2        Mon Jul 10 15:01:01 2000
***************
*** 152,168 ****
        /*
         * DMA area mapin.
         * On VS3100, split the 128K block between the two devices.
         * On VS2000, don't care for now.
         */
  #define DMASIZE (64*1024)
        if (va->va_paddr & 0x100) { /* Secondary SCSI controller */
- #ifdef JCHDEBUG
                sc->ncr_off = DMASIZE;
- #endif
                sc->onlyscsi = 1;
        }
        sc->ncr_addr = (caddr_t)va->va_dmaaddr;
        ncr_dmasize = min(va->va_dmasize, MAXPHYS);
  
        /*
         * MD function pointers used by the MI code.
--- 152,166 ----

johnh...
>Release-Note:
>Audit-Trail:
>Unformatted: