Subject: Check Condition on CDB
To: None <netbsd-help@netbsd.org>
From: James K. Lowden <jklowden@schemamania.org>
List: netbsd-help
Date: 12/13/2001 16:30:20
Hello, 

In trying to create a CD with cdrecord, I seem to have run into some
disagreement on the scsi bus.  

Devices in question, from dmesg:

adv1 at pci0 dev 15 function 0: AdvanSys ABP-9xxUA SCSI adapter
adv1: interrupting at irq 9
scsibus0 at adv1: 8 targets, 8 luns per target
cd0 at scsibus0 target 1 lun 0: <NAKAMICH, MJ-5.16S, 1.02> SCSI2 5/cdrom removable
	[cd0..cd4 are luns on the Nakamichi drive.]
cd5 at scsibus0 target 4 lun 0: <RICOH, MP6201S, 2.20> SCSI2 5/cdrom removable
sd0 at scsibus0 target 6 lun 0: <QUANTUM, FIREBALL SE4.3S, PJ0A> SCSI2 0/direct fixed

FWIW, the adv man page says the driver supports the ABP930UA and the
ABP940U, but I apparently have the ABP940UA (not mentioned).  

Behavior:

The MP6201S (cd5) has green and amber lights.  Green is read-only,
amber indicates writeable media.  When I insert a blank cd-r disk in
cd5, the light should glow amber.  Instead, it flashes green/amber
rapidly.  At that point, I can neither eject(1) the drive nor reset
it with scsictl(8).  

The drive behaves normally with cd-rom disks. For that reason and
because sd0 and cd0-4 never complain, I assume the scsi bus is set up
correctly.  

/var/log/messages reports:

 /netbsd: cd5(adv1:4:0):  Check Condition on CDB: 0x00 00 00 00 00 00
 /netbsd:	  SENSE KEY:  Hardware Error
 /netbsd:	   ASC/ASCQ:  Random Positioning Error
 /netbsd: 
 /netbsd: cd5(adv1:4:0):  Check Condition on CDB: 0x00 00 00 00 00 00
 /netbsd:	  SENSE KEY:  Media Error
 /netbsd:	   ASC/ASCQ:  Logical Unit Communication Failure
 
I'd be happy of course to provide more information.  

I'm guessing NetBSD can't write to this particular drive for
quasi-proprietary reasons, that the drive behaves in some quirky way
that cd(4) doesn't expect.  That's fine; this looks to me like a
learning opportunity.  I'm hoping someone will tell me:

1.  How to determine what module encountered the error.  
2.	Whether there's an analog to tcpdump for the scsi bus, so we can
see what's really going on, commandwise.  

(Problems with the MP6201S was one of the primary reasons I switched
to NetBSD, as it happens. It kinda sorta worked under NT; I've
written maybe 50 CDs with it.  The success rate was about 90%, but
the failures were of the lock-up-the-box variety, Big Red Switch
time. Calls for "support" were answered with blank stares and
shrugs.  So here I am.  I built my first-ever kernel last night (but
I'm still running GENERIC), and I'm starting to think access to the
source code and smart people will solve this once and for all.)

Any help and advice very much appreciated.  

Regards, 

--jkl