Subject: kern/5306: ncr driver prints "phase change" error for MTIOC[SH]LOCATE
To: None <gnats-bugs@gnats.netbsd.org>
From: Dave Huang <khym@bga.com>
List: netbsd-bugs
Date: 04/17/1998 05:46:44
>Number:         5306
>Category:       kern
>Synopsis:       ncr driver prints "phase change" error for MTIOC[SH]LOCATE
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 17 03:50:00 1998
>Last-Modified:
>Originator:     Dave Huang
>Organization:
Name: Dave Huang     |   Mammal, mammal / their names are called /
INet: khym@bga.com   |   they raise a paw / the bat, the cat /
FurryMUCK: Dahan     |   dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 22 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
>Release:        NetBSD-current as of April 16, 1998
>Environment:
	
System: NetBSD dahan.metonymy.com 1.3E NetBSD 1.3E (SPIFF) #210: Fri Apr 17 03:38:19 CDT 1998 khym@dahan.metonymy.com:/usr/src.local/sys/arch/i386/compile/SPIFF i386

SCSI controller and tape drive:
ncr1 at pci0 dev 11 function 0: ncr 53c810 fast10 scsi
ncr1: interrupting at irq 10
ncr1: minsync=25, maxsync=206, maxoffs=8, 16 dwords burst, normal dma fifo
ncr1: single-ended, open drain IRQ driver
ncr1: restart (scsi reset).
scsibus1 at ncr1: 8 targets
st0 at scsibus1 targ 6 lun 0: <ARCHIVE, Python 28849-XXX, 4.CM> SCSI2 1/sequential removable
st0: st0(ncr1:6:0): 5.0 MB/s (200 ns, offset 8)
drive empty
ch0 at scsibus1 targ 6 lun 1: <ARCHIVE, Python 28849-XXX, 4.CM> SCSI2 8/changer removable
ch0: 4 slots, 1 drive, 1 picker, 0 portals

>Description:
	When executing the MTIOCSLOCATE or MTIOCHLOCATE ioctls, the
ncr driver prints a message like:

st0(ncr1:6:0): phase change 2-7 16@01546b5c resid=6.

The locate does succeed though, and nothing bad seems to happen (the
SCSI bus doesn't lock up, at least...)

>How-To-Repeat:
	On a machine with a tape drive hooked up to an ncr controller,
do "mt setspos 0".

>Fix:
	Apparently, the ncr driver is unhappy that st_setpos() is
claiming that the LOCATE command is 16 bytes long, when it's really
only 10. Would this be considered icky? :)

--- /usr/src/sys/dev/scsipi/st.c	Fri Feb 13 06:30:18 1998
+++ st.c	Fri Apr 17 05:40:43 1998
@@ -1967,7 +1967,7 @@
 	if (hard)
 		cmd.bytes[0] = 1 << 2;
 	_lto4b(*blkptr, &cmd.bytes[2]);
-	error = scsipi_command(st->sc_link, &cmd, sizeof(cmd),
+	error = scsipi_command(st->sc_link, &cmd, 10,
 	    NULL, 0, ST_RETRIES, 1800000, NULL, 0);
 	/*
 	 * XXX: Note file && block number position now unknown (if

>Audit-Trail:
>Unformatted: