Subject: Re: cannot access cdrom drive
To: Brett Lymn <blymn@baesystems.com.au>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: current-users
Date: 01/16/2001 21:50:03
On Mon, Jan 15, 2001 at 04:06:21PM +1030, Brett Lymn wrote:
> 
> Folks,
>         I have a laptop (a digital HiNote Ultra II) running NetBSD
> 1.5_ALPHA2 that has a cdrom drive that connects via a weird pcmcia
> arrangement.  I can see the cd get probed and identified ok on boot,
> viz:
> 
> Jan 14 11:11:05 rover /netbsd: wdc2 at pcmcia2 function 0 port 0x170-0x177 port 0x376-0x378: Digital Mobile Media CD-ROM
> Jan 14 11:11:05 rover /netbsd: atapibus0 at wdc2 channel 0
> Jan 14 11:11:05 rover /netbsd: cd0 at atapibus0 drive 0: <TOSHIBA CD-ROM XM-1202B, 0600155424, 2475> type 5 cdrom removable
> Jan 14 11:11:05 rover /netbsd: cd0: drive supports PIO mode 3
> 
> But when I try and access a CD in the drive I just get a "read error"
> almost immediately, the drive gets accessed because the access light
> flashes momentarily but the drive does not spin up.  The drive does
> spin up on boot so I _think_ the thing is working ok.  I tried
> twiddling the debug mask for the wdc driver and got the following out:
> 
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr wdc2:0:0
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr: c_bcount 0 len 12 st 0x58 err 0x0 ire 0x1 :PHASE_CMDOUT
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr wdc2:0:0
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr: c_bcount 0 len 12 st 0x51 err 0x60 ire 0x3 :PHASE_COMPLETED
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr wdc2:0:0
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr: c_bcount 32 len 12 st 0x58 err 0x0 ire 0x1 :PHASE_CMDOUT
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr wdc2:0:0
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr: c_bcount 32 len 18 st 0x58 err 0x0 ire 0x2 :PHASE_DATAIN
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr wdc2:0:0
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr: c_bcount 14 len 18 st 0x50 err 0x0 ire 0x3 :PHASE_COMPLETED
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr: wdc_atapi_done() (end), error 0x1 sense 0x60070

Looks like a SKEY_UNIT_ATTENTION sense

> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr wdc2:0:0
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr: c_bcount 0 len 12 st 0x58 err 0x0 ire 0x1 :PHASE_CMDOUT
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr wdc2:0:0
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr: c_bcount 0 len 12 st 0x51 err 0x20 ire 0x3 :PHASE_COMPLETED
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr wdc2:0:0
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr: c_bcount 32 len 12 st 0x58 err 0x0 ire 0x1 :PHASE_CMDOUT
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr wdc2:0:0
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr: c_bcount 32 len 18 st 0x58 err 0x0 ire 0x2 :PHASE_DATAIN
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr wdc2:0:0
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr: c_bcount 14 len 18 st 0x50 err 0x0 ire 0x3 :PHASE_COMPLETED
> Jan 14 11:40:30 rover /netbsd: wdc_atapi_intr: wdc_atapi_done() (end), error 0x1 sense 0x20070

SKEY_NOT_READY sense.

It looks like low level ATAPI works properly (drive reacts properly to
commands) but returns unusual sense info.
Could you enable SCSI commands debugging instead, to see which commands
are failing:
#define DEBUGTYPE       BUS_ATAPI
#define DEBUGTARGET     0
#define DEBUGLUN        0
#define DEBUGLEVEL      (SDEV_DB1|SDEV_DB2|SDEV_DB3)

in scsipi_debug.h - I suspect SDEV_DB1 would be enouth.


--
Manuel Bouyer <bouyer@antioche.eu.org>
--