I have recently setup FreeBSD 12.0-RELEASE on my HP Pavilion 15-p051us. Most of the hardware works correctly, however one major exception is USB, most specifically with mass storage devices. When I connect a mass storage device to my laptop (on either one of the two USB 3.0 ports or on the USB 2.0 port) it will take about 1 minute before the device id detected by camcontrol and listed as a da device in /dev. Occasionally, the device is just never detected. I have tried this with various USB drives (Lexars, SanDisks, PNYs, generic unbranded) and they all have the same problem. All of these devices work without issue on other PCs and when running other OSes on the same laptop (Linux, OpenBSD). I also tested many of the same devices in a FreeBSD VM (Virtualbox) and they all worked with no issue (2-3 seconds to be detected by camcontrol).
Upon connecting the device I see something like the following in dmesg
Later I see messages such as the following after the device is enumerated. If this occurs five times (happens fairly often) the device is never detected (never assigned a /dev/da device).
Two to three of the above messages usually show up across about 60 seconds before the device is detected.
Full dmesg related to connecting SanDisk Curzer
The problem appears to be with the inquiry sent to the USB device. The usb_quirks module has a way to disable this for individual devices.
Running the following command and then disconnecting and re-connecting the usb device results in the device being detected much quicker (5-10 seconds).
This is not an ideal "fix" and I also do not know of a way to automatically apply this quirk to all connected USB mass storage devices. I would like to figure out what the root cause of this problem is, however I don't really know where to start.
If anyone has any ideas the help would be greatly appreciated.
Upon connecting the device I see something like the following in dmesg
Code:
ugen0.2: <SanDisk Cruzer Facet> at usbus0
umass0 on uhub4
umass0: <SanDisk Cruzer Facet, class 0/0, rev 2.00/1.26, addr 1> on usbus0
umass0: SCSI over Bulk-Only; quirks = 0x8100
umass0:4:0: Attached to scbus4
Later I see messages such as the following after the device is enumerated. If this occurs five times (happens fairly often) the device is never detected (never assigned a /dev/da device).
Code:
(probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00
(probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
(probe0:umass-sim0:0:0:0): Retrying command, 3 more tries remain
Two to three of the above messages usually show up across about 60 seconds before the device is detected.
Full dmesg related to connecting SanDisk Curzer
Code:
ugen0.2: <SanDisk Cruzer Facet> at usbus0
umass0 on uhub4
umass0: <SanDisk Cruzer Facet, class 0/0, rev 2.00/1.26, addr 1> on usbus0
umass0: SCSI over Bulk-Only; quirks = 0x8100
umass0:4:0: Attached to scbus4
(probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00
(probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
(probe0:umass-sim0:0:0:0): Retrying command, 3 more tries remain
da0 at umass-sim0 bus 0 scbus4 target 0 lun 0
da0: <SanDisk Cruzer Facet 1.26> Fixed Direct Access SPC-4 SCSI device
da0: Serial Number 4C532000000728112564
da0: 40.000MB/s transfers
da0: 15267MB (31266816 512 byte sectors)
da0: quirks=0x2<NO_6_BYTE>
The problem appears to be with the inquiry sent to the USB device. The usb_quirks module has a way to disable this for individual devices.
Running the following command and then disconnecting and re-connecting the usb device results in the device being detected much quicker (5-10 seconds).
sudo usbconfig ugen0.2 add_quirk UQ_MSC_NO_INQUIRY
This is not an ideal "fix" and I also do not know of a way to automatically apply this quirk to all connected USB mass storage devices. I would like to figure out what the root cause of this problem is, however I don't really know where to start.
If anyone has any ideas the help would be greatly appreciated.