Bug 185747 - [cam] [patch] fix support for USB key "Kingston DT 101 G2"
Summary: [cam] [patch] fix support for USB key "Kingston DT 101 G2"
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-usb (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-13 15:10 UTC by olivier
Modified: 2018-08-05 05:35 UTC (History)
3 users (show)

See Also:


Attachments
file.diff (502 bytes, patch)
2014-01-13 15:10 UTC, olivier
no flags Details | Diff
output from USB that works with FreeBSD9.3 (1.57 KB, text/plain)
2015-01-07 15:25 UTC, joshruehlig
no flags Details
output from USB that doesn't work with FreeBSD9.3 (1.58 KB, text/plain)
2015-01-07 15:27 UTC, joshruehlig
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description olivier 2014-01-13 15:10:00 UTC
FreeBSD 10.0 didn't support anymore Kingston DT 101 G2 (I belevied that 9.1 supported it, but didn't have 9.1 for checking).

Fix: Apply the patch attached.
Note: I've try with "DA_Q_NO_SYNC_CACHE" only first but it didn't work,
then I've try with "DA_Q_NO_PREVENT" in place, but it still didn't work.
At last I've used both "DA_Q_NO_SYNC_CACHE|DA_Q_NO_PREVENT" (without
idea of what I'm doing, I've just read the other quirks) and it's
worked :-)

Patch attached with submission follows:
How-To-Repeat: Error message when USB key inserted:

ugen2.5: <Kingston> at usbus2
umass0: <Kingston DT 101 G2, class 0/0, rev 2.00/1.00, addr 5> on usbus2
umass0:  SCSI over Bulk-Only; quirks = 0x0100
umass0:6:0:-1: Attached to scbus6
da0 at umass-sim0 bus 0 scbus6 target 0 lun 0
da0: <Kingston DT 101 G2 1.00> Removable Direct Access SCSI-2 device 
da0: Serial Number 0013729B6F4BC0B0B562C5A3
da0: 40.000MB/s transfers
da0: 1910MB (3913664 512 byte sectors: 255H 63S/T 243C)
da0: quirks=0x2<NO_6_BYTE>
(da0:umass-sim0:0:0:0): got CAM status 0x50
(da0:umass-sim0:0:0:0): fatal error, failed to attach to device
da0 at umass-sim0 bus 0 scbus6 target 0 lun 0
da0: <Kingston DT 101 G2 1.00> s/n 0013729B6F4BC0B0B562C5A3 detached
(da0:umass-sim0:0:0:0): Periph destroyed
Comment 1 patfbsd 2014-01-15 09:04:01 UTC
Hello,

Olivier, are you sure about DA_Q_NO_SYNC_CACHE ? On 9.2 only
DA_Q_NO_PREVENT is needed.

See also PR usb/180837

I confirm that this usb key worked fine with 9.1.

Regards,
Comment 2 olivier 2014-01-15 09:10:13 UTC
Yes I have to use both for a working USB key.
Comment 3 David Naylor freebsd_committer freebsd_triage 2014-01-28 18:17:57 UTC
Hi,

While running on:

# uname -a
FreeBSD dragon.dg 9.2-STABLE FreeBSD 9.2-STABLE #0 f31ec93: Sun Oct 27 
21:33:06 SAST 2013     root@dragon.dg:/tmp/home/freebsd/9/src/sys/MODULAR  
amd64

I was having trouble with a Kingston G2 data dongle:

# usbconfig -u 0 -a 5 dump_device_desc                                                                       
ugen0.5: <DataTraveler G2 Kingston> at usbus0, cfg=0 md=HOST spd=HIGH 
(480Mbps) pwr=ON (100mA)                                     
                                                                                                                                   
  bLength = 0x0012                                                                                                                 
  bDescriptorType = 0x0001                                                                                                         
  bcdUSB = 0x0200                                                                                                                  
  bDeviceClass = 0x0000                                                                                                            
  bDeviceSubClass = 0x0000 
  bDeviceProtocol = 0x0000 
  bMaxPacketSize0 = 0x0040 
  idVendor = 0x0951 
  idProduct = 0x1624 
  bcdDevice = 0x0100 
  iManufacturer = 0x0001  <Kingston>
  iProduct = 0x0002  <DataTraveler G2>
  iSerialNumber = 0x0003  <001CC0EC346EF010F69D0DE9>
  bNumConfigurations = 0x0001 

Using 

# usbconfig -u 0 -a 5 add_quirk UQ_MSC_NO_PREVENT_ALLOW

Fixed the problem for me.  So +1 for NO_PREVENT only.  

Regard
Comment 4 Richard Narron 2014-08-15 23:14:26 UTC
I concur that using the "usbconfig ... UQ_MSC_NO_PREVENT_ALLOW" 
command fixes the problem temporarily

I run FreeBSD 10.0-RELEASE-p7

To fix the problem temporarily:
1) plug in the dongle

2) Run usbconfig to find the unit (5) and address (2) of the usb

  ugen5.2: <DataTraveler 112 Kingston> at usbus5, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA)

3) Run usbconfig again to set the flag:

  usbconfig -u 5 -a 2 add_quirk UQ_MSC_NO_PREVENT_ALLOW

4) unplug and replug the dongle.
Comment 5 Hans Petter Selasky freebsd_committer freebsd_triage 2014-08-16 07:04:56 UTC
Can you verify that you need the same quirk with a 10-stable kernel?

--HPS
Comment 6 joshruehlig 2015-01-07 05:35:40 UTC
I can confirm that "usbconfig -u X -a Y add_quirk UQ_MSC_NO_PREVENT_ALLOW" allows me to access one of my 8GB Kingston DT 101 G2's that wasn't working on FreeBSD 10.1 or 9.3

What's strange is I have another 8GB Kingston DT 101 G2 and it works with needing any intervention.
Comment 7 Hans Petter Selasky freebsd_committer freebsd_triage 2015-01-07 07:47:07 UTC
Hi,

Can you dump the USB descriptors from these two devices?

usbconfig -d X.Y dump_device_desc dump_curr_config_desc

Maybe one of them is another revision, or is not genuine.

--HPS
Comment 8 joshruehlig 2015-01-07 15:25:58 UTC
Created attachment 151462 [details]
output from USB that works with FreeBSD9.3
Comment 9 joshruehlig 2015-01-07 15:27:39 UTC
Created attachment 151464 [details]
output from USB that doesn't work with FreeBSD9.3

I bought them both from Staples retail stores, at different times.
Comment 10 commit-hook freebsd_committer freebsd_triage 2015-01-19 07:04:22 UTC
A commit references this bug:

Author: hselasky
Date: Mon Jan 19 07:03:41 UTC 2015
New revision: 277363
URL: https://svnweb.freebsd.org/changeset/base/277363

Log:
  MFC r277044:
  Increase the maximum number of dynamic USB quirks. USB memory stick
  devices which don't support the synchronize cache SCSI command are
  likely to also not support the prevent-allow medium removal SCSI
  command.

  PR:		185747

Changes:
_U  stable/9/sys/
_U  stable/9/sys/dev/
  stable/9/sys/dev/usb/usb_freebsd.h
  stable/9/sys/dev/usb/usb_msctest.c
Comment 11 commit-hook freebsd_committer freebsd_triage 2015-01-19 07:06:24 UTC
A commit references this bug:

Author: hselasky
Date: Mon Jan 19 07:06:16 UTC 2015
New revision: 277364
URL: https://svnweb.freebsd.org/changeset/base/277364

Log:
  MFC r277044:
  Increase the maximum number of dynamic USB quirks. USB memory stick
  devices which don't support the synchronize cache SCSI command are
  likely to also not support the prevent-allow medium removal SCSI
  command.

  PR:		185747

Changes:
_U  stable/10/
  stable/10/sys/dev/usb/usb_freebsd.h
  stable/10/sys/dev/usb/usb_freebsd_loader.h
  stable/10/sys/dev/usb/usb_msctest.c
Comment 12 commit-hook freebsd_committer freebsd_triage 2015-02-02 18:21:10 UTC
A commit references this bug:

Author: hselasky
Date: Mon Feb  2 18:20:11 UTC 2015
New revision: 278105
URL: https://svnweb.freebsd.org/changeset/base/278105

Log:
  Separate out detection of prevent and allow medium removal quirk.

  PR:		185747
  MFC after:	1 week

Changes:
  head/sys/dev/usb/usb_msctest.c
Comment 13 commit-hook freebsd_committer freebsd_triage 2015-02-10 13:46:50 UTC
A commit references this bug:

Author: hselasky
Date: Tue Feb 10 13:45:56 UTC 2015
New revision: 278515
URL: https://svnweb.freebsd.org/changeset/base/278515

Log:
  MFC r278105:
  Separate out detection of prevent and allow medium removal quirk.

  PR:		185747

Changes:
_U  stable/10/
  stable/10/sys/dev/usb/usb_msctest.c
Comment 14 commit-hook freebsd_committer freebsd_triage 2015-02-10 13:47:53 UTC
A commit references this bug:

Author: hselasky
Date: Tue Feb 10 13:47:30 UTC 2015
New revision: 278516
URL: https://svnweb.freebsd.org/changeset/base/278516

Log:
  MFC r278105:
  Separate out detection of prevent and allow medium removal quirk.

  PR:		185747

Changes:
_U  stable/9/sys/
_U  stable/9/sys/dev/
  stable/9/sys/dev/usb/usb_msctest.c
Comment 15 commit-hook freebsd_committer freebsd_triage 2015-02-10 13:48:54 UTC
A commit references this bug:

Author: hselasky
Date: Tue Feb 10 13:48:49 UTC 2015
New revision: 278517
URL: https://svnweb.freebsd.org/changeset/base/278517

Log:
  MFC r278105:
  Separate out detection of prevent and allow medium removal quirk.

  PR:		185747

Changes:
_U  stable/8/sys/
_U  stable/8/sys/dev/
_U  stable/8/sys/dev/usb/
  stable/8/sys/dev/usb/usb_msctest.c
Comment 16 Glen Barber freebsd_committer freebsd_triage 2015-07-08 18:32:06 UTC
To originators/assignees of this PR:

A commit to the tree references this PR, however the PR is still in a non-closed state.

Please review this PR and close as appropriate, or if closing the PR requires a merge to stable/10, please let re@ know as soon as possible.

Thank you.

Glen
Comment 17 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:44:01 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.