Skip to content
  • Hema Kalliguddi's avatar
    92d2711f
    usb: musb: unmap dma buffer when switching to PIO · 92d2711f
    Hema Kalliguddi authored
    Buffer is mapped to dma when dma channel is
    allocated. If, for some reason, dma channel
    programming fails, musb code will fallback
    to PIO mode to transfer that request. In
    that case, we need to unmap the buffer
    back to CPU.
    
    MUSB RTL1.8 and above cannot handle buffers
    which are not 32bit aligned. That happens to
    every request sent by g_ether gadget
    driver. Since the buffer sent was unaligned,
    we need to fallback to PIO.
    
    Because of that, g_ether was failing due
    to missing buffer unmapping.
    
    With this patch and [1] g_ether works fine
    with all MUSB revisions.
    
    Verified with OMAP3630 board, which has
    MUSB RTL1.8 using g_ether and g_zero.
    
    [1] http://www.spinics.net/lists/linux-usb/msg38400.html
    
    
    
    Signed-off-by: default avatarHema HK <hemahk@ti.com>
    Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
    92d2711f
    usb: musb: unmap dma buffer when switching to PIO
    Hema Kalliguddi authored
    Buffer is mapped to dma when dma channel is
    allocated. If, for some reason, dma channel
    programming fails, musb code will fallback
    to PIO mode to transfer that request. In
    that case, we need to unmap the buffer
    back to CPU.
    
    MUSB RTL1.8 and above cannot handle buffers
    which are not 32bit aligned. That happens to
    every request sent by g_ether gadget
    driver. Since the buffer sent was unaligned,
    we need to fallback to PIO.
    
    Because of that, g_ether was failing due
    to missing buffer unmapping.
    
    With this patch and [1] g_ether works fine
    with all MUSB revisions.
    
    Verified with OMAP3630 board, which has
    MUSB RTL1.8 using g_ether and g_zero.
    
    [1] http://www.spinics.net/lists/linux-usb/msg38400.html
    
    
    
    Signed-off-by: default avatarHema HK <hemahk@ti.com>
    Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
Loading