RE: [PATCH] OMAP:MUSB: Corrects urb unlink function path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




________________________________________
From: linux-usb-owner@xxxxxxxxxxxxxxx [linux-usb-owner@xxxxxxxxxxxxxxx] On Behalf Of Gupta, Ajay Kumar [ajay.gupta@xxxxxx]
Sent: Friday, August 22, 2008 8:44 PM
To: Alan Stern
Cc: linux-omap@xxxxxxxxxxxxxxx; linux-usb@xxxxxxxxxxxxxxx; felipe.balbi@xxxxxxxxx; ajaykuee@xxxxxxxxx
Subject: RE: [PATCH] OMAP:MUSB: Corrects urb unlink function path

On Fri, 22 Aug 2008 ajay.gupta@xxxxxx wrote:

> From: Ajay Kumar Gupta <ajay.gupta@xxxxxx>
>
> 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 <ajay.gupta@xxxxxx>
> ---
>  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.
I will resend the patch with other lock fixes.

Ajay

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

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux