USB: musb: fix urb_dequeue() method
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().

[ a0d09457d62acbdeb1fae1223575100ccbfffdf9@users.sourceforge.net: update patch description,
  and fold in a dequeue() comment patch ]

Signed-off-by: Sergei Shtylyov <38a867ea26f35d3eeb42270f1bc7b9d1d135e6a2@ru.mvista.com>
Signed-off-by: David Brownell <a0d09457d62acbdeb1fae1223575100ccbfffdf9@users.sourceforge.net>
Cc: Felipe Balbi <d79216928cfdb58376b0b00a1a44a75e52dbc84e@nokia.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>


TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas