issue with umass plugged-in during boot up

Andriy Gapon avg at icyb.net.ua
Tue Apr 22 21:16:16 UTC 2008


on 22/04/2008 23:16 Andriy Gapon said the following:
> BTW, I use RELENG_7, i386, UP.
> 
> Anyway, I see a different issue with booting while a umass device is
> connected. First issue was that k3b hasn't found my two cd/atapicam
> devices. Then I executed camcontrol rescan all, it failed with EINVAL.
> camcontrol reset all - the same error. ktrace showed that the error came
> from ioctl on xpt device.
> I rebooted without the umass device and everything went back to normal.
> I'll try to do more debugging later.

Here is a complete and correct scenario with more details.
Original boot:
uhci1: <VIA 83C572 USB controller> port 0xbc00-0xbc1f irq 7 at device
12.0 on pci0
uhci1: [GIANT-LOCKED]
uhci1: [ITHREAD]
usb1: <VIA 83C572 USB controller> on uhci1
usb1: USB revision 1.0
uhub1: <VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb1
uhub1: 2 ports with 2 removable, self powered
uhci2: <VIA 83C572 USB controller> port 0xc000-0xc01f irq 10 at device
12.1 on pci0
uhci2: [GIANT-LOCKED]
uhci2: [ITHREAD]
usb2: <VIA 83C572 USB controller> on uhci2
usb2: USB revision 1.0
uhub2: <VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb2
uhub2: 2 ports with 2 removable, self powered
ehci0: <VIA VT6202 USB 2.0 controller> mem 0xe7005000-0xe70050ff irq 11
at device 12.2 on pci0
ehci0: [GIANT-LOCKED]
ehci0: [ITHREAD]
usb3: EHCI version 1.0
usb3: companion controllers, 2 ports each: usb1 usb2
usb3: <VIA VT6202 USB 2.0 controller> on ehci0
usb3: USB revision 2.0
uhub3: <VIA EHCI root hub, class 9/0, rev 2.00/1.00, addr 1> on usb3
uhub3: 4 ports with 4 removable, self powered
umass0: <Prolific Technology Inc. Mass Storage Device, class 0/0, rev
2.00/1.00, addr 2> on uhub3
...
unknown: FAILURE - INQUIRY ILLEGAL REQUEST asc=0x24 ascq=0x00 sks=0x40
0x00 0x01
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <WDC WD40 00AAKS-00YGA0 12.0> Fixed Direct Access SCSI-0 device
da0: 40.000MB/s transfers
da0: 381554MB (781422768 512 byte sectors: 255H 63S/T 48641C)
cam_periph_alloc: attempt to re-allocate valid device pass2 rejected
passasync: Unable to attach new device due to status 0x6: CCB request
was invalid
cam_periph_alloc: attempt to re-allocate valid device cd2 rejected
cdasync: Unable to attach new device due to status 0x6
cd2 at ata1 bus 0 target 0 lun 0
cd2: <HL-DT-ST DVDRAM GSA-4163B A105> Removable CD-ROM SCSI-0 device
cd2: 3.300MB/s transfers
cd2: cd present [2236704 x 2048 byte records]
unknown: FAILURE - INQUIRY ILLEGAL REQUEST asc=0x24 ascq=0x00
cam_periph_alloc: attempt to re-allocate valid device pass1 rejected
passasync: Unable to attach new device due to status 0x6: CCB request
was invalid
cd1 at ata0 bus 0 target 0 lun 0
cd1: <LITE-ON LTR-40125W WS03> Removable CD-ROM SCSI-0 device
cd1: 3.300MB/s transfers
cd1: Attempt to query device size failed: NOT READY, Medium not present


After boot I cane execute all camcontrol commands without any problems.
Here is output of camcontrol devlist -v:
scbus0 on umass-sim0 bus 0:
<WDC WD40 00AAKS-00YGA0 12.0>      at scbus0 target 0 lun 0 (da0,pass0)
scbus1 on ata0 bus 0:
<LITE-ON LTR-40125W WS03>          at scbus1 target 0 lun 0 (cd1,pass1)
<  >                               at scbus1 target -1 lun -1 ()
scbus2 on ata1 bus 0:
<HL-DT-ST DVDRAM GSA-4163B A105>   at scbus2 target 0 lun 0 (pass2,cd2)
<  >                               at scbus2 target -1 lun -1 ()
scbus3 on ata2 bus 0:
<  >                               at scbus3 target -1 lun -1 ()
scbus4 on ata3 bus 0:
<  >                               at scbus4 target -1 lun -1 ()
scbus-1 on xpt0 bus 0:
<  >                               at scbus-1 target -1 lun -1 (xpt0)


Then I detach the umass disk:
umass0: at uhub3 port 2 (addr 2) disconnected
(da0:umass-sim0:0:0:0): lost device
(da0:umass-sim0:0:0:0): removing device entry
GEOM_LABEL: Label ufs/extstuff removed.
GEOM_LABEL: Label ufs/extbackup removed.
umass0: detached

And here is new output of camcontrol devlist -v:
scbus1 on ata0 bus 0:
<LITE-ON LTR-40125W WS03>          at scbus1 target 0 lun 0 (cd1,pass1)
<  >                               at scbus1 target -1 lun -1 ()
scbus2 on ata1 bus 0:
<HL-DT-ST DVDRAM GSA-4163B A105>   at scbus2 target 0 lun 0 (pass2,cd2)
<  >                               at scbus2 target -1 lun -1 ()
scbus3 on ata2 bus 0:
<  >                               at scbus3 target -1 lun -1 ()
scbus4 on ata3 bus 0:
<  >                               at scbus4 target -1 lun -1 ()
scbus-1 on xpt0 bus 0:
<  >                               at scbus-1 target -1 lun -1 (xpt0)

After that camcontrol commands referring to "all" (rescan and reset)
fail with EINVAL.
ktrace shows that EINVAL comes from ioctl CAMIOCOMMAND on xpt0 device.
My clumsy ddb debugging shows that the error is produced somewhere in
xptioctl->xpt_find_bus.

It seems that xpt might be unhappy about scbus0/pass0 going away.
Maybe this is because in <all>/-1 case camcontrol sends ccb with path_id
(implicitly) set to zero and xptioctl performs xpt_find_bus for all
ioctl commands (including XPT_DEV_MATCH)?
I.e. see case of bus=-1 in rescan_or_reset_bus() in camcontrol.c

-- 
Andriy Gapon


More information about the freebsd-scsi mailing list