Subject: Re: usb umass quirks vs. SCSI quirks
To: Lennart Augustsson <lennart@augustsson.net>
From: Rhialto <rhialto@azenomei.knuffel.net>
List: current-users
Date: 12/31/2002 18:56:48
On Tue 31 Dec 2002 at 01:47:15 +0100, Lennart Augustsson wrote:
> Rhialto wrote:
>
> >The camera has some quirk entries in usb/umass_quirks.c, for instance
> >UMASS_QUIRK_NO_START_STOP, but the function that sends START UNIT commands,
> >scsipi_base.c:scsipi_start() looks only at (periph->periph_quirks &
> >PQUIRK_NOSTARTUNIT). This seems to be another universe of quirks yet
> >they seem to intend the same thing.
> >
> Yes, it seems to be a mistake that there is a UMASS_QUIRK_NO_START_STOP
> since that already exists as a SCSI quirk.
>
> The umass_quirks.c table contains both SCSI and USB quirks, so you could try
> adding PQUIRK_NOSTARTUNIT to the FinePix entry.
Yes, I did this. Later I discovered that the camera *also* has a quirks
entry in the scsipi drivers, in sys/dev/scsipi/atapiconf.c:
{{T_DIRECT, T_REMOV,
"FUJIFILM", "USB-DRIVEUNIT", "1.00"}, PQUIRK_NO_FLEX_PAGE |
PQUIRK_NOSENSE },
I suppose this entry could be removed and the quirks added to the
umass_quirks.c table.
Anyway, trying this with full logging for atapi, usb and umass gives me
this (edited a bit for width):
17:29:08 usb_needs_explore
17:29:08 usb_event_thread: woke up
17:29:08 usb_discover
17:29:09 usb_needs_explore
17:29:09 usb_schedsoftintr: polling=0
17:29:09 age repeated 10 times
17:29:09 umass0 at uhub0 port 1 configuration 1 interface 0
17:29:09 usb_schedsoftintr: polling=0
17:29:09 usb_schedsoftintr: polling=0
17:29:09
17:29:09 umass0: Fuji Photo Film USB Mass Storage, rev 1.10/1.00, addr 2
17:29:09 umass0: using ATAPI over CBI
17:29:09 usb_schedsoftintr: polling=0
17:29:09 usb_schedsoftintr: polling=0
17:29:09 umass0: umass_attach_bus: ATAPI
17:29:09 atapibus1 at umass0 channel 0: 2 targets
17:29:09 umass_atapi_probe_device: atapi=0xc0e36b80 target=0
17:29:09 umass_atapi_probe_device: doing inquiry
17:29:09 probe(umass0:0:0): atapi_cmd
17:29:09 probe(umass0:0:0): scsipi_get_xs
17:29:09 probe(umass0:0:0): calling pool_get
17:29:09 probe(umass0:0:0): returning
17:29:09 scsipi_execute_xs: xs(0xc0d17000): xs_control(0x00401004)xs_status(0x00000000)periph(0xc0e0c800)retr(0x4)timo(0x2710)cmd(0xc0d17088)len(0xc)data(0xe2b04354)len(0x4a)res(0x4a)err(0x0)bp(0x0)probe(umass0:0:0): command: 0x12,0x0,0x0,0x0,0x4a,0x0,0x0,0x0,0x0,0x0,0x0,0x0-[74 bytes]
17:29:09 ------------------------------
17:29:09 000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
17:29:09 016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
17:29:09 032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
17:29:09 048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
17:29:09 ------------------------------
17:29:09
17:29:09 umass0: umass_scsi_cmd: at 1041355749.521656: 0:0 xs=0xc0d17000 cmd=0x12 datalen=74 (quirks=0x20d080, poll=0)
17:29:09 xs(0xc0d17000): xs_control(0x00401004)xs_status(0x00000000)periph(0xc0e0c800)retr(0x4)timo(0x2710)cmd(0xc0d17088)len(0xc)data(0xe2b04354)len(0x4a)res(0x4a)err(0x0)bp(0x0)probe(umass0:0:0): command: 0x12,0x0,0x0,0x0,0x4a,0x0,0x0,0x0,0x0,0x0,0x0,0x0-[74 bytes]
17:29:09 ------------------------------
17:29:09 000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
17:29:09 016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
17:29:09 032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
17:29:09 048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
17:29:09 ------------------------------
17:29:09 umass_scsi_cmd: async dir=1, cmdlen=12 datalen=74
17:29:09 umass0: umass_cbi_transfer cmd=0x12, len=74
17:29:09 usb_schedsoftintr: polling=0
17:29:09 umass0: Handling CBI state 10 (CBI Command), xfer=0xc0cf0800, NORMAL_COMPLETION
17:29:09 umass0: start xfer buffer=0xe2b04354 buflen=74 flags=0x5 timeout=15000
17:29:09 usb_schedsoftintr: polling=0
17:29:09 umass0: Handling CBI state 11 (CBI Data), xfer=0xc0cf0000, NORMAL_COMPLETION
17:29:09 umass0: CBI_DATA actlen=36
17:29:09 umass0: 0x 008000011f00000046554a4946494c4d buffer=0xe2b04354, buflen=36
17:29:09 umass0: 0x 5553422d4452495645554e4954202020
17:29:09 umass0: 0x 312e3030
17:29:09 umass_scsipi_cb: at 1041355749.526108, delta=4452: xs=0xc0d17000 residue=38 status=1
17:29:09 umass_scsipi_cb: at 1041355749.526108: return xs->error=0, xs->xs_status=0x0 xs->resid=38
17:29:09 probe(umass0:0:0): scsipi_done
17:29:09 probe(umass0:0:0): command: 0x12,0x0,0x0,0x0,0x4a,0x0,0x0,0x0,0x0,0x0,0x0,0x0-[74 bytes]
17:29:09 ------------------------------
17:29:09 000: 00 80 00 01 1f 00 00 00 46 55 4a 49 46 49 4c 4d
17:29:09 016: 55 53 42 2d 44 52 49 56 45 55 4e 49 54 20 20 20
17:29:09 032: 31 2e 30 30 00 00 00 00 00 00 00 00 00 00 00 00
17:29:09 048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
17:29:09 ------------------------------
17:29:09 probe(umass0:0:0): scsipi_free_xs
17:29:09 umass_atapi_probedev: doing atapi_probedev on 'FUJIFILM' 'USB-DRIVEUNIT' '1.00'
17:29:09 scsipi_inqmatch: 27/0/1 <FUJIFILM, USB-DRIVEUNIT, 1.00>
17:29:09 scsipi_inqmatch: 2/0/1 <, , >
17:29:09 sd0 at atapibus1 drive 0: <FUJIFILM, USB-DRIVEUNIT, 1.00> type 0 direct removableprobe(umass0:0:0): sd_atapi_attach: probe(umass0:0:0): sdattach:
17:29:09 sd0(umass0:0:0): atapi_cmd
17:29:09 sd0(umass0:0:0): scsipi_get_xs
17:29:09 sd0(umass0:0:0): calling pool_get
17:29:09 sd0(umass0:0:0): returning
17:29:09 scsipi_execute_xs: xs(0xc0d17000): xs_control(0x00401004)xs_status(0x00000000)periph(0xc0e0c800)retr(0x4)timo(0x4e20)cmd(0xc0d17088)len(0xc)data(0xe2b041ac)len(0xc)res(0xc)err(0x0)bp(0x0)sd0(umass0:0:0): command: 0x23,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0x0,0x0-[12 bytes]
17:29:09 ------------------------------
17:29:09 000: 00 00 00 00 00 00 00 00 e8 41 b0 e2
17:29:09 ------------------------------
17:29:09
17:29:09 umass0: umass_scsi_cmd: at 1041355749.526500: 0:0 xs=0xc0d17000 cmd=0x23 datalen=12 (quirks=0x22d080, poll=0)
17:29:09 xs(0xc0d17000): xs_control(0x00401004)xs_status(0x00000000)periph(0xc0e0c800)retr(0x4)timo(0x4e20)cmd(0xc0d17088)len(0xc)data(0xe2b041ac)len(0xc)res(0xc)err(0x0)bp(0x0)sd0(umass0:0:0): command: 0x23,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0x0,0x0-[12 bytes]
17:29:09 ------------------------------
17:29:09 000: 00 00 00 00 00 00 00 00 e8 41 b0 e2
17:29:09 ------------------------------
17:29:09 umass_scsi_cmd: async dir=1, cmdlen=12 datalen=12
17:29:09 umass0: umass_cbi_transfer cmd=0x23, len=12
17:29:09 usb_schedsoftintr: polling=0
17:29:09 usb_schedsoftintr: polling=0
17:29:09 umass0: Handling CBI state 10 (CBI Command), xfer=0xc0cf0800, STALLED
17:29:09 umass0: Command Transport failed
17:29:09 umass_scsipi_cb: at 1041355749.529067, delta=2567: xs=0xc0d17000 residue=12 status=2
17:29:09 umass0: umass_cbi_transfer cmd=0x03, len=32
17:29:09 usb_schedsoftintr: polling=0
17:29:09 usb_schedsoftintr: polling=0
17:29:09 umass0: Handling CBI state 10 (CBI Command), xfer=0xc0cf0800, STALLED
17:29:09 umass0: Command Transport failed
17:29:09 umass_scsipi_sense_cb: xs=0xc0d17000 residue=32 status=2
17:29:09 umass0: Autosense failed, status 2
17:29:09 umass_scsipi_sense_cb: return xs->error=3, xs->xs_status=0x1 xs->resid=12
17:29:09 sd0(umass0:0:0): scsipi_done
17:29:09 sd0(umass0:0:0): command: 0x23,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0x0,0x0-[12 bytes]
17:29:09 ------------------------------
17:29:09 000: 00 00 00 00 00 00 00 00 e8 41 b0 e2
17:29:09 ------------------------------
17:29:09 sd0(umass0:0:0): generic HBA error
17:29:09 sd0(umass0:0:0): scsipi_free_xs
17:29:09 sd0(umass0:0:0): calling private start()
17:29:09 sd0(umass0:0:0): sdstart sd0(umass0:0:0): sd_atapibus_get_parms: read format capacities error=5
17:29:09 sd0: drive offline
17:29:09 umass_atapi_probe_device: atapi=0xc0e36b80 target=1
17:29:09 umass0: Attach finished
17:29:09 usb_schedsoftintr: polling=0
17:29:36 usb_event_thread: woke up
17:29:36 usb_discover
17:30:09 usb_event_thread: woke up
17:30:09 usb_discover
17:30:36 usb_event_thread: woke up
17:30:36 usb_discover
and then I turned it off again:
17:30:43 usb_needs_explore
17:30:43 usb_event_thread: woke up
17:30:43 usb_discover
17:30:43 umass0: at uhub0 port 1 (addr 2) disconnected
17:30:43 umass0: umass_activate: 1
17:30:43 umass0: umass_activate: child returned 0
17:30:43 umass0: detached
17:30:43 sd0 detached
17:30:43 atapibus1 detached
17:30:43 umass_disco
17:30:43 umass0 detached
Maybe this rings a bell somewhere.
> -- Lennart
-Olaf.
--
___ Olaf 'Rhialto' Seibert -- The evil eye is caused by the black
\X/ rhialto/at/xs4all.nl -- tongue - Tom Poes, "Het boze oog", 4456.