• Sergei Shtylyov's avatar
    USB: musb: fix urb_dequeue() method · a2fd814e
    Sergei Shtylyov authored
    The urb_dequeue() method forgets to unlink 'struct musb_qh' from the
    control or bulk schedules when the URB being cancelled is the only
    one queued to its endpoint.  That will cause musb_advance_schedule()
    to block once it reaches 'struct musb_qh' with now empty URB list, so
    URBs queued for other endpoints after the one being dequeued will not
    be served.
    
    Fix by unlinking the QH from the list except when it's already being
    handled (typically by musb_giveback).  Since a QH with an empty URB
    list is now supposed to be freed, do that.  And remove a now-useless
    check from musb_advance_schedule().
    
    [ dbrownell@users.sourceforge.net: update patch description,
      and fold in a dequeue() comment patch ]
    Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
    Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
    Cc: Felipe Balbi <felipe.balbi@nokia.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    a2fd814e
musb_host.c 58.5 KB