On Fri, 22 Aug 2008 [EMAIL PROTECTED] wrote:

> From: Ajay Kumar Gupta <[EMAIL PROTECTED]>
>
> Fixes kernel panic while ISO IN transfer is aborted.Replaced 
> usb_hcd_unlink_urb_from_ep() from musb_giveback() to __musb_giveback() to 
> make sure urb is unlinked before giveback when __musb_giveback() is called 
> from musb_urb_dequeue().
>
> Signed-off-by: Ajay Kumar Gupta <[EMAIL PROTECTED]>
> ---
>  drivers/usb/musb/musb_host.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
> index 93b0678..a889ac4 100644
> --- a/drivers/usb/musb/musb_host.c
> +++ b/drivers/usb/musb/musb_host.c
> @@ -292,6 +292,7 @@ __acquires(musb->lock)
>                       );
>
>       spin_unlock(&musb->lock);
> +     usb_hcd_unlink_urb_from_ep(musb_to_hcd(musb), urb);
>       usb_hcd_giveback_urb(musb_to_hcd(musb), urb, status);
>       spin_lock(&musb->lock);

This is wrong.  You must call usb_hcd_unlink_urb_from_ep() while
holding musb->lock.

You are correct. the unlink function should be moved above spin_unlock().  as,

+       usb_hcd_unlink_urb_from_ep(musb_to_hcd(musb), urb);
         spin_unlock(&musb->lock);
         usb_hcd_giveback_urb(musb_to_hcd(musb), urb, status);
         spin_lock(&musb->lock);

Simiar locking issue is also in enqueue path where unlink is being done 
without holding musb->lock.

Alan Stern--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to