Quantcast

umass regression

classic Classic list List threaded Threaded
27 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

umass regression

Bartosz Fabianowski
Hi list

I recently upgraded my amd64 box from 8-STABLE to 9-STABLE. I noticed
that after the upgrade, two of my umass devices fail to attach.

The first device is a 4th generation iPod running Rockbox. Under
8-STABLE, the iPod's 20GB had drive would show up as /dev/da1. Now, I
get the following dmesg output and no umass devices:

ugen1.7: <Rockbox.org> at usbus1
umass1: <Rockbox.org Rockbox media player, class 0/0, rev 2.00/1.00,
addr 7> on usbus1
umass1: could not setup required transfers, USB_ERR_NO_PIPE
device_attach: umass1 attach returned 6

The second device is a Garmin Dakota 20 running stock Garmin firmware.
Under 8-STABLE, the Garmin shows up as /dev/da1 and /dev/da2, the first
representing the device's internal memory, the second its microSD card.
Under 9-STABLE, I only get /dev/da1 and the following dmesg output:

ugen1.8: <vendor 0x091e> at usbus1
umass1: <vendor 0x091e product 0x23c0, class 0/0, rev 1.10/5.09, addr 8>
on usbus1
da1 at umass-sim1 bus 1 scbus4 target 0 lun 0
da1: <Garmin GARMIN Flash 1.00> Removable Direct Access SCSI-5 device
da1: 1.000MB/s transfers
da1: 934MB (1912832 512 byte sectors: 64H 32S/T 934C)

All my other umass devices work just fine, including a USB key that I
always have plugged in as /dev/da0 and many other USB keys and USB hard
drives.

The issue is annoying enough that I am willing to invest time and effort
into debugging it... but I would like to know where to look. Any ideas?
I still have my 8-STABLE install around, so I can do some comparisons
and regression testing.

- Bartosz
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Hans Petter Selasky
On Tuesday 27 December 2011 15:04:28 Bartosz Fabianowski wrote:

> Hi list
>
> I recently upgraded my amd64 box from 8-STABLE to 9-STABLE. I noticed
> that after the upgrade, two of my umass devices fail to attach.
>
> The first device is a 4th generation iPod running Rockbox. Under
> 8-STABLE, the iPod's 20GB had drive would show up as /dev/da1. Now, I
> get the following dmesg output and no umass devices:
>
> ugen1.7: <Rockbox.org> at usbus1
> umass1: <Rockbox.org Rockbox media player, class 0/0, rev 2.00/1.00,
> addr 7> on usbus1
> umass1: could not setup required transfers, USB_ERR_NO_PIPE
> device_attach: umass1 attach returned 6
>
> The second device is a Garmin Dakota 20 running stock Garmin firmware.
> Under 8-STABLE, the Garmin shows up as /dev/da1 and /dev/da2, the first
> representing the device's internal memory, the second its microSD card.
> Under 9-STABLE, I only get /dev/da1 and the following dmesg output:
>
> ugen1.8: <vendor 0x091e> at usbus1
> umass1: <vendor 0x091e product 0x23c0, class 0/0, rev 1.10/5.09, addr 8>
> on usbus1
> da1 at umass-sim1 bus 1 scbus4 target 0 lun 0
> da1: <Garmin GARMIN Flash 1.00> Removable Direct Access SCSI-5 device
> da1: 1.000MB/s transfers
> da1: 934MB (1912832 512 byte sectors: 64H 32S/T 934C)
>
> All my other umass devices work just fine, including a USB key that I
> always have plugged in as /dev/da0 and many other USB keys and USB hard
> drives.
>
> The issue is annoying enough that I am willing to invest time and effort
> into debugging it... but I would like to know where to look. Any ideas?
> I still have my 8-STABLE install around, so I can do some comparisons
> and regression testing.

Hi,

9-stable has not been MFC'ed yet.

Could you try to use a 10-current kernel with 9-stable?

USB code should be the same!

--HPS
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Bartosz Fabianowski
> Could you try to use a 10-current kernel with 9-stable?

I just csup'd to 10-CURRENT, built a brand new kernel and rebooted using
that kernel. The issues remain the same. The dmesg output I posted
previously is unchanged and my two umass devices do not show up. What
should I try next?

- Bartosz
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Hans Petter Selasky
In reply to this post by Bartosz Fabianowski
On Tuesday 27 December 2011 15:04:28 Bartosz Fabianowski wrote:
> ugen1.7: <Rockbox.org> at usbus1
> umass1: <Rockbox.org Rockbox media player, class 0/0, rev 2.00/1.00,
> addr 7> on usbus1
> umass1: could not setup required transfers, USB_ERR_NO_PIPE
> device_attach: umass1 attach returned 6

What does "usbconfig -d 1.7 dump_curr_config_desc" say?

--HPS
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Hans Petter Selasky
In reply to this post by Bartosz Fabianowski
On Tuesday 27 December 2011 15:04:28 Bartosz Fabianowski wrote:

> ugen1.8: <vendor 0x091e> at usbus1
> umass1: <vendor 0x091e product 0x23c0, class 0/0, rev 1.10/5.09, addr 8>
> on usbus1
> da1 at umass-sim1 bus 1 scbus4 target 0 lun 0
> da1: <Garmin GARMIN Flash 1.00> Removable Direct Access SCSI-5 device
> da1: 1.000MB/s transfers
> da1: 934MB (1912832 512 byte sectors: 64H 32S/T 934C)
>
> All my other umass devices work just fine, including a USB key that I
> always have plugged in as /dev/da0 and many other USB keys and USB hard
> drives.

If you compile the kernel with "options USB_DEBUG", umass will print active
quirks. There has been added some quirks to force single LUN in certain
scenarios. See the sys/dev/usb/usb_msctest.c

--HPS
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Bartosz Fabianowski
In reply to this post by Hans Petter Selasky
With my 9-STABLE kernel, this is what it says:

ugen1.7: <Rockbox media player Rockbox.org> at usbus1, cfg=0 md=HOST
spd=HIGH (480Mbps) pwr=ON


  Configuration index 0

     bLength = 0x0009
     bDescriptorType = 0x0002
     wTotalLength = 0x0020
     bNumInterfaces = 0x0000
     bConfigurationValue = 0x0001
     iConfiguration = 0x0000  <no string>
     bmAttributes = 0x00c0
     bMaxPower = 0x00fa

     Interface 0
       bLength = 0x0009
       bDescriptorType = 0x0004
       bInterfaceNumber = 0x0000
       bAlternateSetting = 0x0000
       bNumEndpoints = 0x0002
       bInterfaceClass = 0x0008
       bInterfaceSubClass = 0x0006
       bInterfaceProtocol = 0x0050
       iInterface = 0x0000  <no string>

      Endpoint 0
         bLength = 0x0007
         bDescriptorType = 0x0005
         bEndpointAddress = 0x0000  <OUT>
         bmAttributes = 0x0002  <BULK>
         wMaxPacketSize = 0x0200
         bInterval = 0x0000
         bRefresh = 0x0000
         bSynchAddress = 0x0000

      Endpoint 1
         bLength = 0x0007
         bDescriptorType = 0x0005
         bEndpointAddress = 0x0000  <OUT>
         bmAttributes = 0x0002  <BULK>
         wMaxPacketSize = 0x0200
         bInterval = 0x0000
         bRefresh = 0x0000
         bSynchAddress = 0x0000
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Hans Petter Selasky
On Tuesday 27 December 2011 19:46:57 Bartosz Fabianowski wrote:
> bEndpointAddress = 0x0000  <OUT>

I believe that there is a bug in Rock-box programming an endpoint address of
zero for the BULK endpoints!

Could you check this with the Rock-box developers first!

--HPS
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Bartosz Fabianowski
> I believe that there is a bug in Rock-box programming an endpoint address of
> zero for the BULK endpoints!

Yes, I spotted that too after I replied to your message. I always build
Rockbox from source anyway, so I am making a firmware with USB debug
support and will try to figure out what is going on - not today or
tomorrow though as I have a holiday trip planned. I will be back with
more information in a couple of days.

- Bartosz
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Bartosz Fabianowski
In reply to this post by Hans Petter Selasky
> Could you check this with the Rock-box developers first!

The bug was in Rockbox indeed. It turns out that the Rockbox USB stack
was expecting to receive a reset command as part of the USB
initialization sequence. Linux, Windows and OS X all issue one. FreeBSD
does not. Hence, Rockbox was misbehaving under FreeBSD only. I made a
patch [1] that I hope will be committed soon.

- Bartosz

[1] http://www.rockbox.org/tracker/task/12497
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Bartosz Fabianowski
In reply to this post by Hans Petter Selasky
With USB_DEBUG, I see that da0 has the NO_SYNCHRONIZE_CACHE set. But I
still have no idea where the second umass device is gone that used to
show up in 8-STABLE :(. Is there any other debug option I could enable
to chase after that? I see no trace of another umass or even a ugen device.

- Bartosz

Here is the output I get now:

ugen1.3: <vendor 0x091e> at usbus1
umass0: <vendor 0x091e product 0x23c0, class 0/0, rev 1.10/5.09, addr 3>
on usbus1
umass0:  SCSI over Bulk-Only; quirks = 0x4000
umass0:3:0:-1: Attached to scbus3
da0 at umass-sim0 bus 0 scbus3 target 0 lun 0
da0: <Garmin GARMIN Flash 1.00> Removable Direct Access SCSI-5 device
da0: 1.000MB/s transfers
da0: 934MB (1912832 512 byte sectors: 64H 32S/T 934C)
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Hans Petter Selasky
On Friday 30 December 2011 23:23:16 Bartosz Fabianowski wrote:

> With USB_DEBUG, I see that da0 has the NO_SYNCHRONIZE_CACHE set. But I
> still have no idea where the second umass device is gone that used to
> show up in 8-STABLE :(. Is there any other debug option I could enable
> to chase after that? I see no trace of another umass or even a ugen device.
>
> - Bartosz
>
> Here is the output I get now:
>
> ugen1.3: <vendor 0x091e> at usbus1
> umass0: <vendor 0x091e product 0x23c0, class 0/0, rev 1.10/5.09, addr 3>
> on usbus1
> umass0:  SCSI over Bulk-Only; quirks = 0x4000
> umass0:3:0:-1: Attached to scbus3
> da0 at umass-sim0 bus 0 scbus3 target 0 lun 0
> da0: <Garmin GARMIN Flash 1.00> Removable Direct Access SCSI-5 device
> da0: 1.000MB/s transfers
> da0: 934MB (1912832 512 byte sectors: 64H 32S/T 934C)

Try to set the no synchronize cache quirk. Then reattach your device. It might
be the msctest which is causing your problem!

usbconfig -h | grep quirk

--HPS
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Bartosz Fabianowski
> Try to set the no synchronize cache quirk. Then reattach your device. It might
> be the msctest which is causing your problem!

I tried setting the quirk just for the device but I failed to find the
right magic numbers. The device shows up as:

<vendor 0x091e product 0x23c0, class 0/0, rev 1.10/5.09, addr 5>

So I tried the following:

usbconfig add_dev_quirk_vplh 0x091e 0x23c0 0x0509 0x0110
UQ_MSC_NO_SYNC_CACHE

On re-attach, I see an unchanged quirks = 0x4000.

I then tried setting the quirk globally:

usbconfig add_quirk UQ_MSC_NO_SYNC_CACHE

On re-attach, I see an unchanged quirks = 0x4000.

How do I make the quirk actually stick?

> usbconfig -h | grep quirk

I have seen you post this line before. At least on my system, it does
not work. usbconfig writes straight to the screen, grep does not filter
anything.

- Bartosz
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Hans Petter Selasky
On Saturday 31 December 2011 13:44:37 Bartosz Fabianowski wrote:

> > Try to set the no synchronize cache quirk. Then reattach your device. It
> > might be the msctest which is causing your problem!
>
> I tried setting the quirk just for the device but I failed to find the
> right magic numbers. The device shows up as:
>
> <vendor 0x091e product 0x23c0, class 0/0, rev 1.10/5.09, addr 5>
>
> So I tried the following:
>
> usbconfig add_dev_quirk_vplh 0x091e 0x23c0 0x0509 0x0110
> UQ_MSC_NO_SYNC_CACHE
>
> On re-attach, I see an unchanged quirks = 0x4000.
>
> I then tried setting the quirk globally:
>
> usbconfig add_quirk UQ_MSC_NO_SYNC_CACHE

^^

Set "-d ugenX.Y" first. Then add quirk. Then re-plug.

>
> On re-attach, I see an unchanged quirks = 0x4000.

The quirk mask should be the same, only there should be two luns.

Else enable umass and usb debuggin, and "dmesg | grep -i lun"

>
> How do I make the quirk actually stick?

--HPS
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Bartosz Fabianowski
> Set "-d ugenX.Y" first. Then add quirk. Then re-plug.

OK, thanks, I did that.

> The quirk mask should be the same, only there should be two luns.

No, still just one :(.

> Else enable umass and usb debuggin, and "dmesg | grep -i lun"

I have USB_DEBUG enabled. The output I get is:

da0 at umass-sim0 bus 0 scbus3 target 0 lun 0
(repeated for each time I plugged in the device).

- Bartosz
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Warren Block
In reply to this post by Bartosz Fabianowski
On Sat, 31 Dec 2011, Bartosz Fabianowski wrote:

> How do I make the quirk actually stick?
>
>> usbconfig -h | grep quirk
>
> I have seen you post this line before. At least on my system, it does not
> work. usbconfig writes straight to the screen, grep does not filter anything.

-h output is being written to stderr.  Redirect it:

sh(1):
   usbconfig -h 2>&1 | grep quirk

csh(1):
   usbconfig -h |& grep quirk

Maybe there is a reason for this.  Otherwise, line 268 of usbconfig.c
could be changed to print to stdout.
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Hans Petter Selasky
On Saturday 31 December 2011 16:55:52 Warren Block wrote:

> On Sat, 31 Dec 2011, Bartosz Fabianowski wrote:
> > How do I make the quirk actually stick?
> >
> >> usbconfig -h | grep quirk
> >
> > I have seen you post this line before. At least on my system, it does not
> > work. usbconfig writes straight to the screen, grep does not filter
> > anything.
>
> -h output is being written to stderr.  Redirect it:
>
> sh(1):
>    usbconfig -h 2>&1 | grep quirk
>
> csh(1):
>    usbconfig -h |& grep quirk
>
> Maybe there is a reason for this.  Otherwise, line 268 of usbconfig.c
> could be changed to print to stdout.

Did you kldload usb_quirk ?

--HPS
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Bartosz Fabianowski
> Did you kldload usb_quirk ?

%kldload usb_quirk
kldload: can't load usb_quirk: File exists

It seems to be compiled into my kernel (even though I did not enable any
option with "quirk" in its name).

- Bartosz
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Bartosz Fabianowski
In reply to this post by Hans Petter Selasky
> Did you kldload usb_quirk ?

After reading through /usr/src/sys/conf/files, it seems to me that
usb_quirk.c is always included in the kernel when usb is enabled, both
on 9-STABLE and 10-CURRENT. The "device usb_quirk" that the man page
refers to does not seem to be a valid kernel configuration option.

So, it appears that USB quirks are enabled, I did turn on
UQ_MSC_NO_SYNC_CACHE and yet, get only one lun. What else can I try? I
just double-checked using my 8-STABLE installation: there, the same
Garmin gadget shows up as two luns and two umass devices.

- Bartosz
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Hans Petter Selasky
On Tuesday 03 January 2012 15:47:58 Bartosz Fabianowski wrote:

> > Did you kldload usb_quirk ?
>
> After reading through /usr/src/sys/conf/files, it seems to me that
> usb_quirk.c is always included in the kernel when usb is enabled, both
> on 9-STABLE and 10-CURRENT. The "device usb_quirk" that the man page
> refers to does not seem to be a valid kernel configuration option.
>
> So, it appears that USB quirks are enabled, I did turn on
> UQ_MSC_NO_SYNC_CACHE and yet, get only one lun. What else can I try? I
> just double-checked using my 8-STABLE installation: there, the same
> Garmin gadget shows up as two luns and two umass devices.

Is it possible that you could run usbdump to capture the traffic on the bus
where the USB device is connected?

Use options "-vvv -s 65536" in addition to specifying the correct serial bus
number.

--HPS
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: umass regression

Bartosz Fabianowski
> Is it possible that you could run usbdump to capture the traffic on the bus
> where the USB device is connected?

Absolutely. I uploaded the dump at [1]. This dump covers 30 seconds from
plugging in.

- Bartosz

[1] http://www.fabianowski.eu/garmin_dakota_20_attach.usbdump
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[hidden email]"
12
Loading...