Re: umass, Verbatim STORE N GO drive, CAM status 0x50

2015-04-01 Thread Damian Weber


On Wed, 1 Apr 2015, Hans Petter Selasky wrote:

> Date: Wed, 1 Apr 2015 16:38:03
> From: Hans Petter Selasky 
> To: Damian Weber , Kurt Jaeger 
> Cc: freebsd-current@freebsd.org
> Subject: Re: umass, Verbatim STORE N GO drive, CAM status 0x50
> 
> On 04/01/15 16:27, Damian Weber wrote:
> > 
> > > Try adding some quirks:
> > > 
> > > usbconfig dump_quirk_names | grep MSC
> > > 
> > > --HPS
> > 
> > Dear Hans Petter and Kurt, thank you for your great advice,
> > I successfully attached my Verbatim USB drive
> > 
> > the magic lines are
> > 
> > in ./dev/usb/usbdevs :
> > 
> > +vendor VERBATIM0x18a5  Verbatim
> > +product VERBATIM STORENGO  0x0243  Verbatim Store N Go
> > 
> > in ./dev/usb/quirk/usb_quirk.c
> > 
> > /* copied from SANDISK, SDCZ2_128 */
> > 
> > +   USB_QUIRK(VERBATIM, STORENGO, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
> > +   UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE,
> > +   UQ_MSC_NO_SYNC_CACHE),
> > 
> > 
> > result:
> > a) can mount it (mount_msdosfs)
> > b) can read/write files (sha1-checksums verified)
> > 
> > two questions remain
> > 
> > 1) can the dmesg error messages be dealt with? ILLEGAL REQUEST asc:20,0
> > 
> > ugen2.2:  at usbus2
> > umass0:  on usbus2
> > umass0:  SCSI over Bulk-Only; quirks = 0x4080
> > umass0:4:0: Attached to scbus4
> > (probe0:umass-sim0:0:0:0): REPORT LUNS. CDB: a0 00 00 00 00 00 00 00 00 10
> > 00 00
> > (probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error
> > (probe0:umass-sim0:0:0:0): SCSI status: Check Condition
> > (probe0:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid
> > command operation code)
> > (probe0:umass-sim0:0:0:0): Error 22, Unretryable error
> > da0 at umass-sim0 bus 0 scbus4 target 0 lun 0
> > da0:  Removable Direct Access SPC-4 SCSI device
> > da0: 40.000MB/s transfers
> > da0: 14909MB (30535401 512 byte sectors: 255H 63S/T 1900C)
> > da0: quirks=0x2
> > 
> > 2) is it possible to modify usb_quirk.c without
> > going through the whole make-kernel dance?
> > 
> 
> Hi,
> 
> If usb_quirk is built like a module you only rebuild that and load.
> 
> Can you put this quirk and patch in a PR and assign to me and I'll get it in!
> 
> --HPS
> 

PR filed as Bug 199101 has been added to the database

Email sent to:
freebsd-...@freebsd.org 


___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: umass, Verbatim STORE N GO drive, CAM status 0x50

2015-04-01 Thread Hans Petter Selasky

On 04/01/15 16:27, Damian Weber wrote:



Try adding some quirks:

usbconfig dump_quirk_names | grep MSC

--HPS


Dear Hans Petter and Kurt, thank you for your great advice,
I successfully attached my Verbatim USB drive

the magic lines are

in ./dev/usb/usbdevs :

+vendor VERBATIM0x18a5  Verbatim
+product VERBATIM STORENGO  0x0243  Verbatim Store N Go

in ./dev/usb/quirk/usb_quirk.c

/* copied from SANDISK, SDCZ2_128 */

+   USB_QUIRK(VERBATIM, STORENGO, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
+   UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE,
+   UQ_MSC_NO_SYNC_CACHE),


result:
a) can mount it (mount_msdosfs)
b) can read/write files (sha1-checksums verified)

two questions remain

1) can the dmesg error messages be dealt with? ILLEGAL REQUEST asc:20,0

ugen2.2:  at usbus2
umass0:  on usbus2
umass0:  SCSI over Bulk-Only; quirks = 0x4080
umass0:4:0: Attached to scbus4
(probe0:umass-sim0:0:0:0): REPORT LUNS. CDB: a0 00 00 00 00 00 00 00 00 10 00 00
(probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(probe0:umass-sim0:0:0:0): SCSI status: Check Condition
(probe0:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid 
command operation code)
(probe0:umass-sim0:0:0:0): Error 22, Unretryable error
da0 at umass-sim0 bus 0 scbus4 target 0 lun 0
da0:  Removable Direct Access SPC-4 SCSI device
da0: 40.000MB/s transfers
da0: 14909MB (30535401 512 byte sectors: 255H 63S/T 1900C)
da0: quirks=0x2

2) is it possible to modify usb_quirk.c without
going through the whole make-kernel dance?



Hi,

If usb_quirk is built like a module you only rebuild that and load.

Can you put this quirk and patch in a PR and assign to me and I'll get 
it in!


--HPS

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: umass, Verbatim STORE N GO drive, CAM status 0x50

2015-04-01 Thread Damian Weber

> Try adding some quirks:
> 
> usbconfig dump_quirk_names | grep MSC
> 
> --HPS

Dear Hans Petter and Kurt, thank you for your great advice,
I successfully attached my Verbatim USB drive

the magic lines are

in ./dev/usb/usbdevs :

+vendor VERBATIM0x18a5  Verbatim
+product VERBATIM STORENGO  0x0243  Verbatim Store N Go

in ./dev/usb/quirk/usb_quirk.c

/* copied from SANDISK, SDCZ2_128 */

+   USB_QUIRK(VERBATIM, STORENGO, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
+   UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE,
+   UQ_MSC_NO_SYNC_CACHE),


result:
a) can mount it (mount_msdosfs)
b) can read/write files (sha1-checksums verified)

two questions remain

1) can the dmesg error messages be dealt with? ILLEGAL REQUEST asc:20,0

ugen2.2:  at usbus2
umass0:  on usbus2
umass0:  SCSI over Bulk-Only; quirks = 0x4080
umass0:4:0: Attached to scbus4
(probe0:umass-sim0:0:0:0): REPORT LUNS. CDB: a0 00 00 00 00 00 00 00 00 10 00 
00 
(probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(probe0:umass-sim0:0:0:0): SCSI status: Check Condition
(probe0:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid 
command operation code)
(probe0:umass-sim0:0:0:0): Error 22, Unretryable error
da0 at umass-sim0 bus 0 scbus4 target 0 lun 0
da0:  Removable Direct Access SPC-4 SCSI device
da0: 40.000MB/s transfers
da0: 14909MB (30535401 512 byte sectors: 255H 63S/T 1900C)
da0: quirks=0x2

2) is it possible to modify usb_quirk.c without 
   going through the whole make-kernel dance?


Best wishes

   Damian

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: umass, Verbatim STORE N GO drive, CAM status 0x50

2015-03-29 Thread Damian Weber
> 
> > I did not find where the product ID goes ...
> > is that everything I have to consider?
> 
> At the end of sys/dev/usb/usbdevs you'll find the product IDs.

I tried and failed to get Verbatim Store N Go working.

This included the following attempts 

1) include the quirk UQ_MSC_NO_SYNC_CACHE
2) include the quirk UQ_MSC_NO_SYNC_CACHE and UQ_MSC_NO_TEST_UNIT_READY
3) I found 
   http://randominfo.pyret.net/index.php?controller=post&action=view&id_post=10
   where some Verbatim Store N Go worked with "quirks=0x2"
   but there is no NO_6_BYTE quirk in dev/usb/quirk/usb_quirk.c

   instead I found a  quirk in cam/scsi/scsi_da.c so I changed
   scsi_da.c, as follows

--- ./cam/scsi/scsi_da.c.orig   2015-03-28 21:33:12.001813000 +0100
+++ ./cam/scsi/scsi_da.c2015-03-28 21:37:24.196604000 +0100
@@ -413,6 +413,14 @@
},
{
/*
+* Verbatim Verbatim STORE N GO
+* dwe...@htwsaar.de
+*/
+   {T_DIRECT, SIP_MEDIA_REMOVABLE, "Verbatim", "*",
+   "*"}, /*quirks*/ DA_Q_NO_6_BYTE
+   },
+   {
+   /*
 * Sigmatel USB Flash MP3 Player
 * PR: kern/57046
 */

 so in that case, the scsi_da.c quirk and the usb_quirk.c-quirks
 were in place, resulting in "failed to attach to device"

4) I removed the usb_quirks from the picture, leaving only the 
   scsi_da.c quirk (NO_6_BYTE) in place, the result being the 
   output below


ugen2.2:  at usbus2
umass0:  on usbus2
umass0:  SCSI over Bulk-Only; quirks = 0x8100
umass0:4:0: Attached to scbus4
Trying to mount root from ufs:/dev/ada0p2 [rw]...
(probe0:umass-sim0:0:0:0): REPORT LUNS. CDB: a0 00 00 00 00 00 00 00 00 10 00 00

(probe0:umass-sim0:0:0:0): CAM status: Auto-Sense Retrieval Failed
(probe0:umass-sim0:0:0:0): Error 5, Unretryable error
(da0:umass-sim0:0:0:0): got CAM status 0x50
(da0:umass-sim0:0:0:0): fatal error, failed to attach to device

= = == 

anything I should try next?

Below the patches I tried, the version 4) being active,
version 3) commented out with a "#if 0 ... #endif"

Best wishes

Damian

= = ==

kernel patches of system FreeBSD 11.0-CURRENT #4 r280370M as of Sun Mar 29 
12:06:02 CEST 2015
--- ./cam/scsi/scsi_da.c.orig   2015-03-28 21:33:12.001813000 +0100
+++ ./cam/scsi/scsi_da.c2015-03-28 21:37:24.196604000 +0100
@@ -413,6 +413,14 @@
},
{
/*
+* Verbatim Verbatim STORE N GO
+* dwe...@htwsaar.de
+*/
+   {T_DIRECT, SIP_MEDIA_REMOVABLE, "Verbatim", "*",
+   "*"}, /*quirks*/ DA_Q_NO_6_BYTE
+   },
+   {
+   /*
 * Sigmatel USB Flash MP3 Player
 * PR: kern/57046
 */

--- ./dev/usb/quirk/usb_quirk.c.orig2015-03-28 16:15:07.980503000 +0100
+++ ./dev/usb/quirk/usb_quirk.c 2015-03-29 10:42:14.931664000 +0200
@@ -523,6 +523,9 @@
USB_QUIRK(FEIYA, DUMMY, 0x, 0x, UQ_MSC_NO_SYNC_CACHE, 
UQ_MATCH_VENDOR_ONLY),
USB_QUIRK(REALTEK, DUMMY, 0x, 0x, UQ_MSC_NO_SYNC_CACHE, 
UQ_MATCH_VENDOR_ONLY),
USB_QUIRK(INITIO, DUMMY, 0x, 0x, UQ_MSC_NO_SYNC_CACHE, 
UQ_MATCH_VENDOR_ONLY),
+#if 0 /* didn't work, we try patching ./cam/scsi/scsi_da.c */
+   USB_QUIRK(VERBATIM, STORENGO, 0x, 0x, UQ_MSC_NO_SYNC_CACHE, 
UQ_MSC_NO_TEST_UNIT_READY, UQ_MATCH_VENDOR_ONLY),
+#endif
 };
 #undef USB_QUIRK_VP
 #undef USB_QUIRK

--- ./dev/usb/usbdevs.orig  2015-03-28 15:55:34.870376000 +0100
+++ ./dev/usb/usbdevs   2015-03-28 16:27:37.709561000 +0100
@@ -689,6 +689,7 @@
 vendor DISPLAYLINK 0x17e9  DisplayLink
 vendor LENOVO  0x17ef  Lenovo
 vendor WAVESENSE   0x17f4  WaveSense
+vendor VERBATIM0x18a5  Verbatim
 vendor VAISALA 0x1843  Vaisala
 vendor AMIT0x18c5  AMIT
 vendor GOOGLE  0x18d1  Google
@@ -4467,6 +4468,9 @@
 /* Vaisala products */
 product VAISALA CABLE  0x0200  USB Interface cable
 
+/* Verbatim products */
+product VERBATIM STORENGO  0x0243  Verbatim Store N Go
+
 /* Vertex products */
 product VERTEX VW110L  0x0100  Vertex VW110L modem
 


___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: umass, Verbatim STORE N GO drive, CAM status 0x50

2015-03-28 Thread Kurt Jaeger
Hi!

> I did not find where the product ID goes ...
> is that everything I have to consider?

At the end of sys/dev/usb/usbdevs you'll find the product IDs.

-- 
p...@opsec.eu+49 171 3101372 5 years to go !
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: umass, Verbatim STORE N GO drive, CAM status 0x50

2015-03-28 Thread Damian Weber


> Date: Sat, 28 Mar 2015 15:36:01
> From: Hans Petter Selasky 
> To: Damian Weber , freebsd-current@freebsd.org
> Subject: Re: umass, Verbatim STORE N GO drive, CAM status 0x50
> 
> On 03/28/15 15:06, Damian Weber wrote:
> > what do you recommend?
> 
> Try adding some quirks:
> 
> usbconfig dump_quirk_names | grep MSC
> 
> --HPS
> 
> 


thanks for the hint, dumping device description gives

 # usbconfig -u 2 -a 2 dump_device_desc
ugen2.2:  at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) 
pwr=ON (2mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0210 
  bDeviceClass = 0x  
  bDeviceSubClass = 0x
  bDeviceProtocol = 0x   
  bMaxPacketSize0 = 0x0040 
  idVendor = 0x18a5 
  idProduct = 0x0243  
  bcdDevice = 0x0100 
  iManufacturer = 0x0001  
  iProduct = 0x0002  
  iSerialNumber = 0x0003  <1258013C>
  bNumConfigurations = 0x0001 


in order to ensure I understood it correctly 

[ 0) no umass kernel module here  ]

1) new entry for Vendor VERBATIM in
sys/dev/usb/usbdevs
with vendor id 0x18a5

2) new entry in the sys/dev/usb/quirk/usb_quirk.c below 

/* Quirks for manufacturers which USB devices does not respond */

  USB_QUIRK(VERBATIM, DUMMY, 0x, 0x, UQ_MSC_NO_SYNC_CACHE, UQ_MATC
H_VENDOR_ONLY),

(the "," after the last entry is a bit irritating)

most of these entries have UQ_MSC_NO_SYNC_CACHE - if that
doesn't work, I'll try UQ_MSC_NO_TEST_UNIT_READY which is
the only other option within that "does not respond"-section

3) make kernel

4) reboot

I did not find where the product ID goes ...
is that everything I have to consider?

Thanks a lot

   Damian


___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: umass, Verbatim STORE N GO drive, CAM status 0x50

2015-03-28 Thread Hans Petter Selasky

On 03/28/15 15:06, Damian Weber wrote:

what do you recommend?


Try adding some quirks:

usbconfig dump_quirk_names | grep MSC

--HPS
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


umass, Verbatim STORE N GO drive, CAM status 0x50

2015-03-28 Thread Damian Weber



Dear all,

on a 11-current system I tried a VERBATIM usb drive which does
not produce a /dev/da... entry. My question is whether this can
be fixed by adding an entry in some array within the kernel source
(header files?) or is this bad hardware for which a workaround 
implementation is needed.

system is 
FreeBSD 11.0-CURRENT (VENUS) #0 r280370: Mon Mar 23 22:14:14 CET 2015

relevant dmesg entries when inserting the drive:

umass0:  on usbus2
umass0:  SCSI over Bulk-Only; quirks = 0x8100
umass0:4:0: Attached to scbus4
(probe0:umass-sim0:0:0:0): REPORT LUNS. CDB: a0 00 00 00 00 00 00 00 00 10 00 
00 
(probe0:umass-sim0:0:0:0): CAM status: Auto-Sense Retrieval Failed
(probe0:umass-sim0:0:0:0): Error 5, Unretryable error
(da0:umass-sim0:0:0:0): got CAM status 0x50
(da0:umass-sim0:0:0:0): fatal error, failed to attach to device

the device gets recognized as ugen2.2 as seen by the timestamp below
# ls -ld ug*

lrwxr-xr-x  1 root  wheel  9 Mar 28 13:41 ugen0.1@ -> usb/0.1.0
lrwxr-xr-x  1 root  wheel  9 Mar 28 13:41 ugen1.1@ -> usb/1.1.0
lrwxr-xr-x  1 root  wheel  9 Mar 28 13:41 ugen2.1@ -> usb/2.1.0
lrwxr-xr-x  1 root  wheel  9 Mar 28 13:44 ugen2.2@ -> usb/2.2.0
...

and of course usbconfig writes the ugen2.2 configuration
ugen2.2:  at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) 
pwr=ON (2mA)

what follows is the full dmesg output, and the complete usbconfig output

what do you recommend?

Best wishes

   Damian

--

Copyright (c) 1992-2015 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.0-CURRENT #0 r280370: Mon Mar 23 22:14:14 CET 2015
root@venus.local:/usr/obj/usr/src/sys/VENUS amd64
FreeBSD clang version 3.6.0 (tags/RELEASE_360/final 230434) 20150225
WARNING: WITNESS option enabled, expect reduced performance.
CPU: Intel(R) Core(TM)2 CPU  6300  @ 1.86GHz (1862.06-MHz K8-class CPU)
  Origin="GenuineIntel"  Id=0x6f2  Family=0x6  Model=0xf  Stepping=2
  
Features=0xbfebfbff
  Features2=0xe3bd
  AMD Features=0x20100800
  AMD Features2=0x1
  VT-x: HLT,PAUSE
  TSC: P-state invariant, performance statistics
real memory  = 2147483648 (2048 MB)
avail memory = 2038140928 (1943 MB)
Event timer "LAPIC" quality 400
ACPI APIC Table: 
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
FreeBSD/SMP: 1 package(s) x 2 core(s)
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
ioapic0  irqs 0-23 on motherboard
random: entropy device infrastructure driver
random: selecting highest priority adaptor 
kbd1 at kbdmux0
netmap: loaded module
random: SOFT: yarrow init()
random: selecting highest priority adaptor 
acpi0:  on motherboard
acpi0: Power Button (fixed)
cpu0:  on acpi0
cpu1:  on acpi0
atrtc0:  port 0x70-0x71 irq 8 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
attimer0:  port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
hpet0:  iomem 0xfed0-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 950
Event timer "HPET" frequency 14318180 Hz quality 450
Event timer "HPET1" frequency 14318180 Hz quality 440
Event timer "HPET2" frequency 14318180 Hz quality 440
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0
acpi_button0:  on acpi0
pcib0:  port 0xcf8-0xcff on acpi0
pci0:  on pcib0
pcib1:  irq 16 at device 1.0 on pci0
pci1:  on pcib1
vgapci0:  mem 
0xd100-0xd1ff,0xc000-0xcfff,0xd000-0xd0ff irq 16 at 
device 0.0 on pci1
vgapci0: Boot video device
uhci0:  port 0x1820-0x183f irq 20 at 
device 26.0 on pci0
usbus0 on uhci0
uhci1:  port 0x1840-0x185f irq 18 at 
device 26.1 on pci0
usbus1 on uhci1
ehci0:  mem 
0xd2305000-0xd23053ff irq 18 at device 26.7 on pci0
usbus2: EHCI version 1.0
usbus2 on ehci0
hdac0:  mem 0xd230-0xd2303fff irq 20 at device 
27.0 on pci0
pcib2:  irq 23 at device 28.0 on pci0
pcib2: failed to allocate initial I/O port window: 0-0xfff
pcib2: failed to allocate initial memory window: 0-0xf
pcib2: failed to allocate initial prefetch window: 0-0xf
pci3:  on pcib2
pcib3:  irq 21 at device 28.5 on pci0
pci9:  on pcib3
bge0:  mem 
0xd200-0xd200 irq 17 at device 0.0 on pci9
bge0: CHIP ID 0xa002; ASIC REV 0x0a; CHIP REV 0xa0; PCI-E
miibus0:  on bge0
brgphy0:  PHY 1 on miibus0
brgphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 
1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow
bge0: Using defaults for TSO: 65518/35/2048
bge0: Ethernet address: 00:30:05:c2:d9:9e
uhci2:  port 0x1860-0x187f irq 23 at 
device 29.0 on pci0
usbus3 on uhci2
uhci3:  port 0x1880-0x189f irq 22 at 
device 29.1 on pci0
usbus4 on uhci3
uhci4:  port 0x18a0-0x18bf irq 21 at 
device 29.2 on pci0
usbus5 on uhci4
ehci1:  mem 
0xd2305400-0xd