Subject: MSCP floppy diskette driver panic (#0002) Index: sys/dev/mscp/mscp_disk.c NetBSD 1.6.1 $Id: 0002.txt,v 1.2 2006/06/10 14:18:52 kirk Exp kirk $ Description: Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. The kernel panics when you try to use a the MSCP floppy diskette driver. Repeat-By: Setup the simh VAX emulator to boot NetBSD 1.6.1 with an emulated MSCP floppy diskette and hard disk. Try to use the floppy diskette device: simhvax# cksum /dev/rx0a ra0: dk_busy < 0 panic: disk_unbusy Stopped at disk_unbusy+0x37: mfpr $18, r2 References: http://simh.trailing-edge.com/ http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=26138 http://mail-index.netbsd.org/netbsd-bugs/2004/07/02/0000.html http://mail-index.netbsd.org/port-vax/2005/01/03/0000.html http://mail-index.netbsd.org/port-vax/2005/01/03/0001.html http://mail-index.netbsd.org/port-vax/2005/01/03/0002.html http://mail-index.netbsd.org/port-vax/2005/01/03/0003.html http://mail-index.netbsd.org/port-vax/2005/01/04/0000.html Unit-Test: Used RX50 floppy drives on a microvax and simh. Fix: modified: /usr/src/sys/dev/mscp/mscp_disk.c It appears that rriodone() is shared by the ra and rx devices. But rriodone() only calls disk_unbusy() with the ra context but never the rx context. But the rrfillin() routine has has code to distinguish between the ra and rx devices. When the rriodone() is modified to chech the rx/ra contect, the kernel doesn't panic. To apply this update: - cut where indicated and save to a file (tmp/0002) - run "patch -p0 < /tmp/0002" - recompile and install your kernel This and previous updates to NetBSD 1.6.1 are available via http://www.ba23.org/vax911/ ------------------------cut here--------------------- *** /usr/src/sys/dev/mscp/mscp_disk.c.old Fri May 26 17:18:38 2006 --- /usr/src/sys/dev/mscp/mscp_disk.c Fri May 26 17:19:41 2006 *************** *** 856,862 **** /* We assume that this is a reasonable drive. ra_strategy should already have verified it. Thus, no checks here... /bqt */ unit = DISKUNIT(bp->b_dev); ! ra = ra_cd.cd_devs[unit]; disk_unbusy(&ra->ra_disk, bp->b_bcount); biodone(bp); --- 856,871 ---- /* We assume that this is a reasonable drive. ra_strategy should already have verified it. Thus, no checks here... /bqt */ unit = DISKUNIT(bp->b_dev); ! #if NRA ! if (major(bp->b_dev) == RAMAJOR) { ! ra = ra_cd.cd_devs[unit]; ! } ! #endif ! #if NRX ! if (major(bp->b_dev) != RAMAJOR) { ! ra = rx_cd.cd_devs[unit]; ! } ! #endif disk_unbusy(&ra->ra_disk, bp->b_bcount); biodone(bp); *** /usr/src/VERSION.old Sun May 21 09:57:05 2006 --- /usr/src/VERSION Sun May 21 10:40:16 2006 *************** *** 1,2 **** ! Current Patch Level: 0001 Date: May 21, 2006 --- 1,2 ---- ! Current Patch Level: 0002 Date: May 21, 2006