Subject: CDROM problems
To: None <port-i386@netbsd.org>
From: Roger Brooks <R.S.Brooks@liverpool.ac.uk>
List: port-i386
Date: 06/15/1999 23:06:39
Having finally got round to upgrading my home machine to 1.4, I was a
little disappointed to find that a problem with the CD-ROM drive which
I'd encountered under 1.3.2 was still there.  I hadn't persued the problem
before because I had applied the pciide code (and subsequent patches) to
my 1.3.2 system, and thought it might be due to an incomplete or missing
patch.

The symptom was that I could mount a CDROM and access the contents, but after
a few reads the system would freeze.  Once frozen, I could switch screens
in PCVT for a few seconds, and get into DDB (which didn't seem to show anything
useful).  After a few seconds (or possibly after a few keypresses), the system
would *really* freeze (couldn't switch screens or get into DDB).

This CDROM (Acer CD 632A) drive had always seemed to be a bit problematic
under NetBSD.  When I first installed 1.3.2 (before applying the pciide
code), it would usually find cd0 maybe once in every 4-6 boots, but this
seemed to improve after installing the pciide code.  I'm not sure exactly
at what stage the CDROM-related hangs started appearing.

While my home machine was still on 1.3.2 I wanted to install 1.4 on my
recently- acquired laptop (Dell Latitude XPi P133ST) by nfs exporting the
install CD. Again, I got system hangs.  In desperation, I tried building a
kernel with pciide removed (forcing the controller to attach as wdc), but
this made the CDROM metamorphose into a 68 MB ST506!  When I tried to pin
it down by replacing wildcarded wd* and cd* entries in the config file
with hardcoded addresses it woudn't attach at all.  The drive worked OK
from MS-DOS, so in the end I copied the tar savesets to a DOS partition,
mounted it under NetBSD and installed on the laptop from there.

The same problem with the CDROM hanging the system appeared when I started
installing 1.4 on the desktop machine (this was using a 1.4_BETA 2-disk
boot floppy set), so again I installed from the MS-DOS partition.  After
building a 1.4 kernel, the problem was still there, so I decided to start
playing with the I/O mode flags for the cd device.  Setting the flags to
0x0ff0 made the drive attach thus:

Jun 12 23:47:10 tallis /netbsd: cd0(pciide0:0:1): using PIO mode 4

but any attempt to access it resulted in errors:

Jun 13 00:15:01 tallis /netbsd: pciide0:0:1: lost interrupt
Jun 13 00:15:01 tallis /netbsd: 	type: atapi
Jun 13 00:15:01 tallis /netbsd: 	c_bcount: 32
Jun 13 00:15:01 tallis /netbsd: 	c_skip: 0
Jun 13 00:15:01 tallis /netbsd: wdc_atapi_intr: unknown phase 0x2

(although this didn't hang the system).  Setting the cd I/O mode flags to
0x0f00 seems to have cured the problem.  So have I got a rogue CDROM and/or
motherboard?  Apart from this problem the system is extrememly stable.
Does anyone else have the same hardware (Epox EP-51 MVP3E motherboard, AMD
K6-300), and if so have you seen similar problems?  Finally, would it perhaps
be a good idea for the kernel on the install floppy to have UDMA disabled?
If I hadn't been able to copy the install sets onto a DOS partition I'd have
been completely stuffed.

Below is the messages file from my final configuration:

Jun 14 19:33:36 tallis /netbsd: NetBSD 1.4 (TALLIS) #2: Sun Jun 13 01:07:11 BST 1999
Jun 14 19:33:36 tallis /netbsd:     root@tallis:/usr2/src/sys/arch/i386/compile/TALLIS
Jun 14 19:33:36 tallis /netbsd: cpu0: family 5 model 7 step 0
Jun 14 19:33:36 tallis /netbsd: cpu0: AMD K6 (586-class)
Jun 14 19:33:36 tallis /netbsd: real mem  = 66707456
Jun 14 19:33:36 tallis /netbsd: avail mem = 58310656
Jun 14 19:33:36 tallis /netbsd: using 839 buffers containing 3436544 bytes of memory
Jun 14 19:33:36 tallis /netbsd: mainbus0 (root)
Jun 14 19:33:36 tallis /netbsd: pci0 at mainbus0 bus 0: configuration mode 1
Jun 14 19:33:36 tallis /netbsd: pci0: i/o enabled, memory enabled
Jun 14 19:33:36 tallis /netbsd: pchb0 at pci0 dev 0 function 0
Jun 14 19:33:36 tallis /netbsd: pchb0: VIA Technologies VT82C598 (Apollo MVP3) Host-PCI (rev. 0x03)
Jun 14 19:33:37 tallis /netbsd: ppb0 at pci0 dev 1 function 0: VIA Technologies VT82C598 (Apollo MVP3) PCI-AGP (rev. 0x00)
Jun 14 19:33:37 tallis /netbsd: pci1 at ppb0 bus 1
Jun 14 19:33:37 tallis /netbsd: pci1: i/o enabled, memory enabled
Jun 14 19:33:37 tallis /netbsd: Matrox MGA Millennium II 2164WA-B AG (VGA display) at pci1 dev 0 function 0 not configured
Jun 14 19:33:37 tallis /netbsd: pcib0 at pci0 dev 7 function 0
Jun 14 19:33:37 tallis /netbsd: pcib0: VIA Technologies VT82C586 (Apollo VP) PCI-ISA Bridge (rev. 0x41)
Jun 14 19:33:37 tallis /netbsd: pciide0 at pci0 dev 7 function 1: VIA Technologies VT82C586A IDE Controller
Jun 14 19:33:37 tallis /netbsd: pciide0: bus-master DMA support present
Jun 14 19:33:37 tallis /netbsd: pciide0: primary channel configured to compatibility mode
Jun 14 19:33:37 tallis /netbsd: atapibus0 at pciide0 channel 0
Jun 14 19:33:37 tallis /netbsd: atapibus0 drive 1: cmdsz 0x0 drqtype 0x0
Jun 14 19:33:37 tallis /netbsd: cd0 at atapibus0 drive 1: <ATAPI CD-ROM DRIVE 32X MAXIMUM, , 322P> type 5 cdrom removable
Jun 14 19:33:37 tallis /netbsd: cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2
Jun 14 19:33:37 tallis /netbsd: wd0 at pciide0 channel 0 drive 0: <FUJITSU MPB3043ATU E>
Jun 14 19:33:37 tallis /netbsd: wd0: drive supports 16-sector pio transfers, lba addressing
Jun 14 19:33:37 tallis /netbsd: wd0: 4125MB, 8940 cyl, 15 head, 63 sec, 512 bytes/sect x 8448300 sectors
Jun 14 19:33:37 tallis /netbsd: wd0: 32-bits data port
Jun 14 19:33:37 tallis /netbsd: wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2
Jun 14 19:33:37 tallis /netbsd: pciide0: primary channel interrupting at irq 14
Jun 14 19:33:37 tallis /netbsd: pciide0: secondary channel configured to compatibility mode
Jun 14 19:33:37 tallis /netbsd: wd1 at pciide0 channel 1 drive 0: <Maxtor 90845D4>
Jun 14 19:33:37 tallis /netbsd: wd1: drive supports 16-sector pio transfers, lba addressing
Jun 14 19:33:37 tallis /netbsd: wd1: 8063MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 16514064 sectors
Jun 14 19:33:37 tallis /netbsd: wd1: 32-bits data port
Jun 14 19:33:37 tallis /netbsd: wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2
Jun 14 19:33:37 tallis /netbsd: pciide0: secondary channel interrupting at irq 15
Jun 14 19:33:37 tallis /netbsd: wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (using DMA data transfers)
Jun 14 19:33:37 tallis /netbsd: cd0(pciide0:0:1): using PIO mode 4, DMA mode 2 (using DMA data transfers)
Jun 14 19:33:37 tallis /netbsd: wd1(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2 (using DMA data transfers)



Roger

------------------------------------------------------------------------------
Roger Brooks (Systems Programmer),          |  Email: R.S.Brooks@liv.ac.uk
Computing Services Dept,                    |  Tel:   +44 151 794 4441
The University of Liverpool,                |  Fax:   +44 151 794 4442
PO Box 147, Liverpool L69 3BX, UK           | 
------------------------------------------------------------------------------