Re: at91sam9x5: USB mass storage gadget problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> writes:
> On Thu, 12 Nov 2015, Felipe Balbi wrote:
>
>> Hi,
>> 
>> Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> writes:
>> > [Adding linux-usb to the CC list]
>> >
>> > On Wed, 11 Nov 2015, Douglas Gilbert wrote:
>> >
>> >> Hi,
>> >> I have been running into problems trying to use a USB device port
>> >> on an Acme System's Arietta G25 (Atmel at91sam9g25 hence at91sam9x5
>> >> family in the kernel) as a USB mass storage gadget. Since the problem
>> >> may be anywhere in the stack, I have sent this post to a USB expert
>> >> as well as at91sam9x5 experts.
>> >> 
>> >> In all cases the mass storage device appears on the host system
>> >> after I do 'modprobe g_mass_storage file=/tmp/backing_file' on the
>> >> Arietta G25:
>> >> 
>> >> # lsscsi
>> >> [0:0:0:0]    disk    ATA      INTEL SSDSC2BW18 DC32  /dev/sda
>> >> [6:0:0:0]    disk    Linux    File-Stor Gadget 0400  /dev/sdb
>> >> 
>> >> However if the host port is USB 3.0 (e.g. on my Lenovo
>> >> X240 laptop) and the kernel is in the 4.0 series then all attempts
>> >
>> > You mean if the _gadget's_ kernel is >= 4.0, right?  Not the host's 
>> > kernel.
>> >
>> >> by the host to read data fail on that mass storage gadget.
>> >> For example, I see lots of this in my syslog:
>> >> 
>> >>    sd 6:0:0:0: [sdb]
>> >>    Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
>> >>    sd 6:0:0:0: [sdb] CDB:
>> >>    Read(10): 28 00 00 00 00 00 00 00 08 00
>> >>    end_request: I/O error, dev sdb, sector 0
>> >>    Buffer I/O error on device sdb, logical block 0
>> >>    usb 2-2: reset high-speed USB device number 9 using xhci_hcd
>> >>    xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep 
>> >> ffff8800ae58f180
>> >>    xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep 
>> >> ffff8800ae58f1c0
>> >>    ...
>> >> 
>> >> I have tried around 6 different kernels in the lk 3.19 to lk 4.3.0
>> >> on the mass storage gadget (Arietta) with 3.19 works while lk 4.0.0-rc4
>> >> is the lowest (in my sample) that fails. My host system is Ubuntu 14.04
>> >> with either its stock kernel (3.13.0-68-generic) or my own hand built
>> >> lk 4.3.0; both react the same way to this problem.
>> >> 
>> >> Attached are the outputs of 'lsusb -v' for that mass storage gadget as
>> >> seen on the host system. The "319" works while the other two fail. One
>> >> difference is that wMaxPacketSize is 512 bytes for "319" and 64 bytes
>> >> for the other two. Is that significant? [The block size on most
>> >> storage devices is typically 512 bytes.]
>> >
>> > That most certainly _is_ significant.  Almost nothing will work right
>> > if the maxpacket size is wrong.
>> 
>> sounds like this gadget is using FS ?
>
> No.  See this line from above:
>
>> >>    usb 2-2: reset high-speed USB device number 9 using xhci_hcd
>
>> >> Also, my problem seems to be sensitive to the host port being USB
>> >> 3.0 since I have an older Lenovo X201 with USB 2.0 ports that does
>> >> _not_ exhibit this problem. IOW when I connect my Arietta G25 mass
>> >> storage gadget to the X201, it works properly for all G25 kernels
>> >> that I have tried.
>> >> 
>> >> 
>> >> Also tested a W7 host box with both USB 2.0 and USB 3.0 host ports
>> >> and my mass storage gadget worked properly with lk 4.0.0-rc4 on
>> >> both 2.0 and 3.0 ports. The Device Manager in W7 shows that it has
>> >> xHCI driver present.
>> >
>> > I don't know what's going on with Windows, but this seems like a bug in 
>> > either the at91sam9g25 UDC driver or the composite gadget core.
>> 
>> I'd blame UDC driver. We have several other UDCs working with the same
>> configuration.
>
> Sounds reasonable to me.  But that doesn't explain why it works okay 
> with the older Lenovo X201 laptop.

it seems like only x240 is running > 4.0. What is x201 running ? Could
be older, buggy xhci driver.

-- 
balbi

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux