This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USB driver reset under high load

Other Parts Discussed in Thread: TVP7002

Hello.

I need to write raw video frames to the USB mass storage device (DOK) on DM8148-EVM using the latest EXSDK. With standard Linux parameters I see relatively rare the phenomena of USB driver resetting the USB (see below).
To investigate the issue I tried:
1. Setting dirty_bytes=4M and a small application which does ONLY writing to the USB - USB reset happens almost immediately.
2. Setting as advised in e2e the INIT_PRIORITY_1 register of the USB controller to 0x000000F0 to increase the USB priority. This eliminated the USB reset in the test application, BUT:
3. When I added back the input capturing, the USB reset occurs again, just a bit later (about 30s).
Below is the Linux console output of the last case (looks the same each time the USB reset happens):

<15:48:18> vm.overcommit_memory = 2
<15:48:18> vm.overcommit_ratio = 90
<15:48:18> vm.dirty_bytes = 4194304

<15:48:20> Arago Project http://arago-project.org dm814x-evm ttyO0
<15:48:20> Arago 2011.09 dm814x-evm ttyO0

<15:53:05> ./avu0
<15:53:40> OMX_Init completed
<15:53:40> Capture component is created
<15:53:40> Buffer Size computed: 945000
<15:53:40> Set input port params (width = 720, height = 875)
<15:53:40> Enable capture output port
<15:53:40> Capture outport buffers allocated
<15:53:40> Capture is in IDLE state
<15:53:40> Capture state execute
<15:53:41> Control TVP7002 state execute
<15:53:41> File write thread created (RAW)
<15:53:41> Executing the application now!
<15:53:41> ===============================
<15:53:41> SetPrioStat(90)
<15:53:41> OPEN file - /dev/sda2
<15:53:41> FrameLengtht 512000

<15:54:13> usb 1-1: reset high speed USB device using musb-hdrc and address 2
<15:54:28> musb_h_ep0_irq 1159: no URB for end 0
<15:54:28> usb 1-1: device descriptor read/64, error -110
<15:54:44> musb_h_ep0_irq 1159: no URB for end 0
<15:54:44> usb 1-1: device descriptor read/64, error -110
<15:54:44> usb 1-1: reset high speed USB device using musb-hdrc and address 2
<15:54:59> musb_h_ep0_irq 1159: no URB for end 0
<15:54:59> usb 1-1: device descriptor read/64, error -110
<15:55:14> musb_h_ep0_irq 1159: no URB for end 0
<15:55:14> usb 1-1: device descriptor read/64, error -110
<15:55:14> usb 1-1: reset high speed USB device using musb-hdrc and address 2
<15:55:25> usb 1-1: device not accepting address 2, error -110
<15:55:25> usb 1-1: reset high speed USB device using musb-hdrc and address 2
<15:55:35> usb 1-1: device not accepting address 2, error -110
<15:55:35> usb 1-1: USB disconnect, address 2
<15:55:36> sd 1:0:0:0: Device offlined - not ready after error recovery
<15:55:36> sd 1:0:0:0: [sda] Unhandled error code
<15:55:36> sd 1:0:0:0: [sda] Result: hostbyte=0x01 driverbyte=0x00
<15:55:36> sd 1:0:0:0: [sda] CDB: cdb[0]=0x2a: 2a 00 00 20 96 10 00 00 f0 00
<15:55:36> end_request: I/O error, dev sda, sector 2135568
<15:55:36> Buffer I/O error on device sda2, logical block 4770
<15:55:36> lost page write due to I/O error on sda2
<15:55:36> Buffer I/O error on device sda2, logical block 4771
<15:55:36> lost page write due to I/O error on sda2
..........................

Is there any way to solve this issue?

Any hint will be highly appreciated.

  • Hello,

    I will notify our experts for help.

    Best Regards,

    Margarita

  • Hi Leon,

    Please switch to the latest version of the linux kernel, where we have some USB patches:

    http://arago-project.org/git/projects/?p=linux-omap3.git;a=shortlog;h=refs/heads/ti81xx-master

    Can you also try to reproduce this issue on the DM814x TI EVM?

    BR
    Pavel

  • , Pavel and Margarita.

    The new version really helped and there are no USB crashes any more.

    But I have another problem with this USB:

    I need to write unbuffered streams directly from the capture output to the USB.

    For this I opened the 128KB aligned partition as raw device:

    open("/dev/sda1", O_WRONLY | O_DIRECT)

    The open() function works fine, but write() operation of the capture buffer (from the second bank!) fails with the error EFAULT (14).

    This is not the problem of alignment and lengths - everything is rechecked tens times, all addresses (both real and virtual) are aligned perfectly on 128KB boundaries, the length is 128KB too. Also giving the address in the user space (leaving all the rest untouched) works fine.
    This brings me to the idea that your musb driver forbids the address to be from the syslink-provided memory for some unclear reason.

    Please, be so kind to comment on this.

  • Leon,

    Leon Pollak said:
    But I have another problem with this USB

    From what I understand this is new issue. If so, could you please open new e2e thread regarding this.

    BR
    Pavel