Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

AM335x musb driver problems when heavily loaded

Other Parts Discussed in Thread: AM3352

On my system, AM3352 with kernel 3.14.26 I am seeing the musb driver sometimes return -ENOSPC. This appears to be because it cannot find an endpoint for the current URB. From what I can see in the source it would be possible to queue the URB but this is not done for anything other than control or bulk endpoints. I guess that this was a simplification done when the musb driver was written.

I also see babble errors on rare occasions which I think is a result of the lack of bandwidth management.


Is there anyone working on either queuing of URBs when all the endpoints are in use and/or bandwidth tracking and management for the musb driver?

  • Andrew,
    I never received an issue report similar to this. Can you please provide more detail about your USB use case, especially how those endpoints have been used? Maybe that will give a clue how to investigate the issue.

  • Hi Bin,


    We are doing USB/IP with multiple iPads and Apple Configurator. The failures occur when doing a 'Prepare' of the iPads. The failures occur most often when the iPads reset themselves and attempt to re-establish connection with the host. I have not established what is using all the endpoints in the controller but I believe that it will be mostly bulk transfers and that is not leaving any endpoints available for the interrupt transfers. There should not be any isochronous transfers involved at all.

    The problem is when musb_schedule in musb_host.c returns -ENOSPC

  • Andrew,

    Is the topology multiple Ipad/configurator connected to MUSB via a USB hub? If so, please connect one of the devices directly to MUSB (or Linux PC), then run command 'lsusb -v -d <vid:pid>' on the host, and send me the log, I want to check the ipad/configurator descriptors. I suspect the USB devices do not use BULK endpoints.

    Please review musb_schedule(), it only returns -ENOSPC for non-BULK endpoint request while no endpoint available.

  • Bus 001 Device 007: ID 05ac:12ab Apple, Inc.
    Device Descriptor:
    bLength 18
    bDescriptorType 1
    bcdUSB 2.00
    bDeviceClass 0 (Defined at Interface level)
    bDeviceSubClass 0
    bDeviceProtocol 0
    bMaxPacketSize0 64
    idVendor 0x05ac Apple, Inc.
    idProduct 0x12ab
    bcdDevice 3.40
    iManufacturer 1 Apple Inc.
    iProduct 2 iPad
    iSerial 3 c08340dc0090401dea1882cd5dd1288e9a427987
    bNumConfigurations 4
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 39
    bNumInterfaces 1
    bConfigurationValue 1
    iConfiguration 5 PTP
    bmAttributes 0xc0
    Self Powered
    MaxPower 500mA
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 0
    bAlternateSetting 0
    bNumEndpoints 3
    bInterfaceClass 6 Imaging
    bInterfaceSubClass 1 Still Image Capture
    bInterfaceProtocol 1 Picture Transfer Protocol (PIMA 15470)
    iInterface 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x02 EP 2 OUT
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 10
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x81 EP 1 IN
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 10
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x83 EP 3 IN
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0040 1x 64 bytes
    bInterval 10
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 149
    bNumInterfaces 3
    bConfigurationValue 2
    iConfiguration 6 iPod USB Interface
    bmAttributes 0xc0
    Self Powered
    MaxPower 500mA
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 0
    bAlternateSetting 0
    bNumEndpoints 0
    bInterfaceClass 1 Audio
    bInterfaceSubClass 1 Control Device
    bInterfaceProtocol 0
    iInterface 0
    AudioControl Interface Descriptor:
    bLength 9
    bDescriptorType 36
    bDescriptorSubtype 1 (HEADER)
    bcdADC 1.00
    wTotalLength 30
    bInCollection 1
    baInterfaceNr( 0) 1
    AudioControl Interface Descriptor:
    bLength 12
    bDescriptorType 36
    bDescriptorSubtype 2 (INPUT_TERMINAL)
    bTerminalID 1
    wTerminalType 0x0201 Microphone
    bAssocTerminal 2
    bNrChannels 2
    wChannelConfig 0x0003
    Left Front (L)
    Right Front (R)
    iChannelNames 0
    iTerminal 0
    AudioControl Interface Descriptor:
    bLength 9
    bDescriptorType 36
    bDescriptorSubtype 3 (OUTPUT_TERMINAL)
    bTerminalID 2
    wTerminalType 0x0101 USB Streaming
    bAssocTerminal 1
    bSourceID 1
    iTerminal 0
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 1
    bAlternateSetting 0
    bNumEndpoints 0
    bInterfaceClass 1 Audio
    bInterfaceSubClass 2 Streaming
    bInterfaceProtocol 0
    iInterface 0
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 1
    bAlternateSetting 1
    bNumEndpoints 1
    bInterfaceClass 1 Audio
    bInterfaceSubClass 2 Streaming
    bInterfaceProtocol 0
    iInterface 0
    AudioStreaming Interface Descriptor:
    bLength 7
    bDescriptorType 36
    bDescriptorSubtype 1 (AS_GENERAL)
    bTerminalLink 2
    bDelay 1 frames
    wFormatTag 1 PCM
    AudioStreaming Interface Descriptor:
    bLength 35
    bDescriptorType 36
    bDescriptorSubtype 2 (FORMAT_TYPE)
    bFormatType 1 (FORMAT_TYPE_I)
    bNrChannels 2
    bSubframeSize 2
    bBitResolution 16
    bSamFreqType 9 Discrete
    tSamFreq[ 0] 8000
    tSamFreq[ 1] 11025
    tSamFreq[ 2] 12000
    tSamFreq[ 3] 16000
    tSamFreq[ 4] 22050
    tSamFreq[ 5] 24000
    tSamFreq[ 6] 32000
    tSamFreq[ 7] 44100
    tSamFreq[ 8] 48000
    Endpoint Descriptor:
    bLength 9
    bDescriptorType 5
    bEndpointAddress 0x81 EP 1 IN
    bmAttributes 1
    Transfer Type Isochronous
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x00c0 1x 192 bytes
    bInterval 4
    bRefresh 0
    bSynchAddress 0
    AudioControl Endpoint Descriptor:
    bLength 7
    bDescriptorType 37
    bDescriptorSubtype 1 (EP_GENERAL)
    bmAttributes 0x01
    Sampling Frequency
    bLockDelayUnits 0 Undefined
    wLockDelay 0 Undefined
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 2
    bAlternateSetting 0
    bNumEndpoints 1
    bInterfaceClass 3 Human Interface Device
    bInterfaceSubClass 0 No Subclass
    bInterfaceProtocol 0 None
    iInterface 0
    HID Device Descriptor:
    bLength 9
    bDescriptorType 33
    bcdHID 1.11
    bCountryCode 0 Not supported
    bNumDescriptors 1
    bDescriptorType 34 Report
    wDescriptorLength 208
    Report Descriptors:
    ** UNAVAILABLE **
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x83 EP 3 IN
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0040 1x 64 bytes
    bInterval 1
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 62
    bNumInterfaces 2
    bConfigurationValue 3
    iConfiguration 7 PTP + Apple Mobile Device
    bmAttributes 0xc0
    Self Powered
    MaxPower 500mA
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 0
    bAlternateSetting 0
    bNumEndpoints 3
    bInterfaceClass 6 Imaging
    bInterfaceSubClass 1 Still Image Capture
    bInterfaceProtocol 1 Picture Transfer Protocol (PIMA 15470)
    iInterface 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x02 EP 2 OUT
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 10
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x81 EP 1 IN
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 10
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x83 EP 3 IN
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0040 1x 64 bytes
    bInterval 10
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 1
    bAlternateSetting 0
    bNumEndpoints 2
    bInterfaceClass 255 Vendor Specific Class
    bInterfaceSubClass 254
    bInterfaceProtocol 2
    iInterface 10 Apple USB Multiplexor
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x04 EP 4 OUT
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x85 EP 5 IN
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 0
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 117
    bNumInterfaces 3
    bConfigurationValue 4
    iConfiguration 8 PTP + Apple Mobile Device + Apple USB Ethernet
    bmAttributes 0xc0
    Self Powered
    MaxPower 500mA
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 0
    bAlternateSetting 0
    bNumEndpoints 3
    bInterfaceClass 6 Imaging
    bInterfaceSubClass 1 Still Image Capture
    bInterfaceProtocol 1 Picture Transfer Protocol (PIMA 15470)
    iInterface 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x02 EP 2 OUT
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 10
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x81 EP 1 IN
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 10
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x83 EP 3 IN
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0040 1x 64 bytes
    bInterval 10
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 1
    bAlternateSetting 0
    bNumEndpoints 2
    bInterfaceClass 255 Vendor Specific Class
    bInterfaceSubClass 254
    bInterfaceProtocol 2
    iInterface 10 Apple USB Multiplexor
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x04 EP 4 OUT
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x85 EP 5 IN
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 0
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 2
    bAlternateSetting 0
    bNumEndpoints 0
    bInterfaceClass 255 Vendor Specific Class
    bInterfaceSubClass 253
    bInterfaceProtocol 1
    iInterface 0
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 2
    bAlternateSetting 1
    bNumEndpoints 2
    bInterfaceClass 255 Vendor Specific Class
    bInterfaceSubClass 253
    bInterfaceProtocol 1
    iInterface 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x86 EP 6 IN
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x05 EP 5 OUT
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 0
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 2
    bAlternateSetting 2
    bNumEndpoints 2
    bInterfaceClass 255 Vendor Specific Class
    bInterfaceSubClass 253
    bInterfaceProtocol 1
    iInterface 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x86 EP 6 IN
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x05 EP 5 OUT
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 0
    Device Qualifier (for other device speed):
    bLength 10
    bDescriptorType 6
    bcdUSB 2.00
    bDeviceClass 0 (Defined at Interface level)
    bDeviceSubClass 0
    bDeviceProtocol 0
    bMaxPacketSize0 64
    bNumConfigurations 4
    Device Status: 0x0000
    (Bus Powered)
  • Andrew,

    As expected, this device uses multiple Interrupt and Isochronous endpoints, for those type of transfers, MUSB does not support dynamic endpoint allocation.

    MUSB has 15 IN and 15 OUT endpoints, As more such devices enumerated, the 15 IN/OUT endpoints will be used up, then -ENOSPC is returned for further endpoint allocation request.

    This is a system limitation, it can only simultaneously support limited devices which use Interrupt or Isochronous endpoints, I am not aware of any workaround. Other USB controllers, for example xHCI, also have the same limitation, xHCI has more endpoints available though.

  • But is it not actually a driver limitation? EP1(in,out) is used with queues but EP2-15 have no queue. Would it not be possible to queue URBs on the endpoints that are not reserved for bulk or control traffic ie EP2-15?
  • Adding queue to the Interrupt or Isochronous endpoints does not solve the issue. Unlike the endpoints for Bulk or Control transfers, once an endpoint is allocated for a periodic transfer (Int or Isoch), it will never be freed until application terminates the transfer - typically by unplugging the device, so even if there was a such queue, the URBs in the queue would never be executed, because the endpoint is always running for the very first URB.
  • Thank you for this explanation.
    It is a shame that using endpoints in the hardware to offload from the CPU ends up severely restricting the number of USB devices that can be supported at a time. The limited endpoints in xHCI are also a problem for us although at least on Apple hardware there is a workaround for that.