USB: musb: fix urb_dequeue() method
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Sat, 21 Feb 2009 23:30:45 +0000 (15:30 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 27 Feb 2009 22:40:51 +0000 (14:40 -0800)
commita2fd814e6a9e172f7077b68a2a9391bbde777a92
tree1ac5659086a835b9935927621c72799f9d17f989
parentb7bdcb79de6de32e40dcc85a5e8c669bec2483d5
USB: musb: fix urb_dequeue() method

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: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/musb/musb_host.c