Ticket #2278 (new defect)

Opened 9 years ago

Last modified 12 months ago

kernel: g_file_storage fails with usb 1-1: failed to restore interface 0 altsetting 0 (error=-110)

Reported by: lindi Owned by: openmoko-kernel
Priority: normal Milestone:
Component: kernel Version:
Severity: normal Keywords: kernel usb gadget
Cc: arnaud.patard@… Blocked By:
Blocking: Estimated Completion (week):
HasPatchForReview: no PatchReviewResult:
Reproducible: always

Description

Steps to reproduce:
1) boot freerunner without loading any usb gadgets (just to prove they don't cause this problem), connect it to a PC and then type the following on freerunner:
2) dd if=/dev/urandom of=/tmp/disk bs=4M count=1
3) sudo modprobe g_file_storage file=/tmp/disk

Expected results:
3) freerunner shows up as a USB mass storage device to the PC in /dev

Actual results:
3) No new files are created to /dev on PC side.

More info:
1) The PC starts to log the following repeatedly:

304.796079] usb 1-1: new full speed USB device using uhci_hcd and address 5
304.988733] usb 1-1: configuration #1 chosen from 1 choice
310.001061] usb 1-1: New USB device found, idVendor=0525, idProduct=a4a5
310.001093] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
310.001108] usb 1-1: Product: File-backed Storage Gadget
310.001120] usb 1-1: Manufacturer: Linux 2.6.29-GTA02_lindi-andy-tracking-mokodev with s3c2410_udc
310.001134] usb 1-1: SerialNumber: 3230204E6F76
310.342798] Initializing USB Mass Storage driver...
310.343113] scsi0 : SCSI emulation for USB Mass Storage devices
310.343516] usbcore: registered new interface driver usb-storage
310.343535] USB Mass Storage support registered.
310.343568] usb-storage: device found at 5
310.343578] usb-storage: waiting for device to settle before scanning
315.341912] usb-storage: device scan complete
315.345889] scsi 0:0:0:0: Direct-Access     Linux    File-Stor Gadget 0312 PQ: 0 ANSI: 2
315.624107] Driver 'sd' needs updating - please use bus_type methods
315.635764] sd 0:0:0:0: [sda] 8192 512-byte hardware sectors (4 MB)
315.748080] usb 1-1: reset full speed USB device using uhci_hcd and address 5
320.901788] usb 1-1: failed to restore interface 0 altsetting 0 (error=-110)
320.902084] sd 0:0:0:0: [sda] Write Protect is off
320.902100] sd 0:0:0:0: [sda] Mode Sense: 00 00 00 00
320.902113] sd 0:0:0:0: [sda] Assuming drive cache: write through
320.903174] sd 0:0:0:0: [sda] READ CAPACITY failed
320.903187] sd 0:0:0:0: [sda] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK,SUGGEST_OK
320.903207] sd 0:0:0:0: [sda] Sense not available.
320.903430] sd 0:0:0:0: [sda] Write Protect is off
320.903445] sd 0:0:0:0: [sda] Mode Sense: 00 00 00 00
320.903457] sd 0:0:0:0: [sda] Assuming drive cache: write through
320.903719] sd 0:0:0:0: [sda] Attached SCSI disk
320.905060] usb 1-1: USB disconnect, address 5

2) freerunner logs

[21474661.380000] g_file_storage gadget: File-backed Storage Gadget, version: 20 November 2008
[21474661.400000] g_file_storage gadget: Number of LUNs=1
[21474661.405000] g_file_storage gadget-lun0: ro=0, file: /tmp/disk
[21474661.410000] gta02_udc_command S3C2410_UDC_P_ENABLE
[21474661.865000] g_file_storage gadget: full speed config #1
[21474672.695000] g_file_storage gadget: full speed config #1
[21474677.925000] g_file_storage gadget: full speed config #1
[21474688.140000] g_file_storage gadget: full speed config #1
[21474693.400000] g_file_storage gadget: full speed config #1
[21474703.610000] g_file_storage gadget: full speed config #1
[21474708.840000] g_file_storage gadget: full speed config #1
[21474719.065000] g_file_storage gadget: full speed config #1
[21474724.305000] g_file_storage gadget: full speed config #1
...

3) freerunner runs andy-tracking 9ecc089861ab238e (2.6.29 from Apr 28)
4) I tested this with two PCs and get the same results.
4.1) 400 MHz fujitsu-siemens laptop with linux 2.6.27.6
4.1) 200 MHz compaq deskpro desktop with linux 2.6.26-2-486
5) I am not using extra USB hubs or "extension cables". The cable I use works perfectly with g_ether so I don't think this is a hardware issue.

Please test this and let me know if you can reproduce it.

Attachments

g_file_storage1.log (22.9 KB) - added by lindi 9 years ago.
debug output of g_file_storage.ko when debugging enabled it seems to make things work

Change History

comment:1 Changed 9 years ago by lindi

I added
#define DEBUG
#define VERBOSE_DEBUG
#define DUMP_MSGS
to file_storage.c and now the device seems to magically work so I guess there's some odd timing issue. Laptop prints

5135.104081] usb 1-1: new full speed USB device using uhci_hcd and address 36
5138.422262] usb 1-1: configuration #1 chosen from 1 choice
5143.732641] scsi33 : SCSI emulation for USB Mass Storage devices
5143.733119] usb-storage: device found at 36
5143.733130] usb-storage: waiting for device to settle before scanning
5144.039013] usb 1-1: New USB device found, idVendor=0525, idProduct=a4a5
5144.039045] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
5144.039059] usb 1-1: Product: File-backed3 Storage Gadget
5144.039072] usb 1-1: Manufacturer: Linux 2.6.29-GTA02_lindi-andy-tracking-mokodev with s3c2410_udc
5144.039086] usb 1-1: SerialNumber: 3230204E6F76
5148.863424] usb-storage: device scan complete
5149.631309] scsi 33:0:0:0: Direct-Access     Linux    File-Stor Gadget 0312 PQ: 0 ANSI: 2
5152.139797] sd 33:0:0:0: [sda] 8192 512-byte hardware sectors (4 MB)
5152.858697] sd 33:0:0:0: [sda] Write Protect is off
5152.858728] sd 33:0:0:0: [sda] Mode Sense: 0f 00 00 00
5152.858741] sd 33:0:0:0: [sda] Assuming drive cache: write through
5153.997484] sd 33:0:0:0: [sda] 8192 512-byte hardware sectors (4 MB)
5154.715390] sd 33:0:0:0: [sda] Write Protect is off
5154.715421] sd 33:0:0:0: [sda] Mode Sense: 0f 00 00 00
5154.715434] sd 33:0:0:0: [sda] Assuming drive cache: write through
5154.715465]  sda: unknown partition table
5156.613915] sd 33:0:0:0: [sda] Attached SCSI disk

and I can read data from the device too. The debug output from freerunner is attached since its quite long.

Changed 9 years ago by lindi

debug output of g_file_storage.ko when debugging enabled it seems to make things work

comment:2 Changed 9 years ago by lindi

If I run the debug version but

sudo sh -c 'echo 0 > /proc/sysrq-trigger'

then I hit the bug again so this bug is clearly sensitive to timing.

comment:3 Changed 9 years ago by arhuaco

lindi, it worked for me.

[  145.355000] g_file_storage gadget: File-backed Storage Gadget, version: 20 November 2008
[  145.365000] g_file_storage gadget: Number of LUNs=1
[  145.365000] g_file_storage gadget-lun0: ro=0, file: /var/volatile/tmp/disk
[  145.375000] gta02_udc_command S3C2410_UDC_P_ENABLE
[  146.160000] g_file_storage gadget: full speed config #1
[  151.515000] g_file_storage gadget: full speed config #1

And I could format and mount the raw device in the host.

comment:4 Changed 9 years ago by PaulFertser

  • Cc arnaud.patard@… added

Arnaud Patard said he's aware of the problems which are most probably related to the s3c core reporting interrupts with no interrupt flags set which is treated as error.

The workaround is in the works.

comment:5 Changed 16 months ago by Kennescoma

Viagra Without A Prescription <a href=http://cial5mg.xyz/ordering-cialis-online.php>Ordering Cialis Online</a> Xenical Canadian Pharcharmy Online Antidotes To Cephalexin <a href=http://zol1.xyz/generic-zoloft-cheapest.php>Generic Zoloft Cheapest</a> Strattera Sildenafil Tadalafil Generic <a href=http://levitra.ccrpdc.com/levitra-low-cost.php>Levitra Low Cost</a> Propecia Depression Sperm Viagra Prices Cvs <a href=http://zol1.xyz/buy-cheap-zoloft-pills.php>Buy Cheap Zoloft Pills</a> Buy Brand Cialis Propecia Svizzera Vendita <a href=http://kama1.xyz/cheapest-kamagra-online.php>Cheapest Kamagra Online</a> Buy Dapoxetine Hydrochloride Keflex And Utis <a href=http://zol1.xyz/implicane-online.php>Implicane Online</a> Priligy Mims Testosterona Propecia Generico <a href=http://zol1.xyz/sertraline-no-prescription.php>Sertraline No Prescription</a> Primary Care Propecia Vendita Levitra Italia <a href=http://zol1.xyz/buy-zoloft-cheap.php>Buy Zoloft Cheap</a> Order Generic Worldwide Isotretinoin 10mg Tablet Usa Is Keflex Doxycycline <a href=http://xenical.ccrpdc.com/low-price-xenical.php>Low Price Xenical</a> Bentyl Coligon Where To Purchase Ups Kamagra Kaufen Gunstig <a href=http://viag1.xyz/viagra-alternative.php>Viagra Alternative</a> 312 Global Pharmacy Canada

comment:6 Changed 13 months ago by Abrahammaime

what do you do if cialis doesnt work

<a href="http://cialisgsaa.com/">http://cialisgsaa.com/</a>

impotenz forum cialis

<a href=http://cialisgsaa.com/>Cialisgot</a>

comment:7 Changed 13 months ago by RalphCleks

cialis free sample voucher

<a href="http://cialisxrm.com/">buy cialis online</a>

typical cialis dosage

<a href=http://cialisxrm.com/>cialis generic</a>

comment:8 Changed 12 months ago by FelipeBuh

online canadian pharmacy

<a href="http://canadianpharmacyrxbsl.com/">canadian pharmacy</a>

canadian online pharmacy

<a href=http://canadianpharmacyrxbsl.com/?viagra-side-effects>viagra side effects</a>
canadadrugs
<a href="http://canadianpharmacyrxbsl.com/?prednisone">prednisone</a>

Note: See TracTickets for help on using tickets.