Subject: umass woe: sd0(umass0:0:0): readonly device & drive offline
To: None <tech-kern@NetBSD.org>
From: Hubert Feyrer <feyrer@cs.stevens.edu>
List: tech-kern
Date: 11/14/2005 07:54:57
I bought a new digital camera today, but NetBSD/i386 (tested: 2.1_STABLE & 
latest -current) doesn't like it:

 	umass0 at uhub0 port 1 configuration 1 interface 0
 	umass0: DSC DIGITAL CAMERA USB, rev 1.00/1.00, addr 2
 	umass0: using ATAPI over Bulk-Only
 	atapibus0 at umass0: 2 targets
 	sd0 at atapibus0 drive 0: <DIGITAL, CAMERA, 1.00> disk removable
 	sd0(umass0:0:0): readonly device
 	sd0: drive offline

The camera is a DXG-328, can't see a prominent manufacturer on the box. 
How to fix?

I tried setting up a kernel with debugging according to the comment at the 
start of umass_quirks.c but that didn't make me any smarted and even 
worked worse (see below). Where to from there?
Should I worry about the "umass0: Get Max Lun not supported", and what 
could I do against it?

Shouldn't it still attach sd0 even with debugging enabled?

I'm pretty clueless... :-(


  - Hubert


dmesg from debugging kernel:

...
umass0 at uhub0 port 1 configuration 1 interface 0
umass0: DSC DIGITAL CAMERA USB, rev 1.00/1.00, addr 2
umass0: using ATAPI over Bulk-Only
umass0: Get Max Lun
umass0: Get Max Lun not supported
umass0: opening iface 0xc0aa0f00 epaddr 2 for BULKOUT
umass0: opening iface 0xc0aa0f00 epaddr 130 for BULKIN
atapibus1 at umass0: 2 targets
umass0: umass_bbb_transfer cmd=0x12
umass0: CBW 43: cmdlen=12 (0x12000000240000000000...), data = 36 bytes, dir = in
umass0: Handling BBB state 1 (BBB CBW), xfer=0xc0a88600, NORMAL_COMPLETION
umass0: Handling BBB state 2 (BBB Data), xfer=0xc0a88900, TIMEOUT
umass0: BBB_DATA actlen=0
umass0: Data-in 36 failed, TIMEOUT
umass0: Bulk Reset
umass0: Handling BBB state 7 (BBB Reset), xfer=0xc0a88a00, NORMAL_COMPLETION
umass0: Clear endpoint 0x82 stall
umass0: Handling BBB state 8 (BBB bulk-in clear stall), xfer=0xc0a88d00, NORMAL_COMPLETION
umass0: Clear endpoint 0x02 stall
umass0: Handling BBB state 9 (BBB bulk-out clear stall), xfer=0xc0927a00, NORMAL_COMPLETION
umass0: Attach finished
[that's all]