aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorAjay Kumar Gupta <ajay.gupta@ti.com>2008-09-11 04:53:21 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-10-17 17:40:58 -0400
commit2492e6747f2441562b1341cef1d46e076f346a1f (patch)
tree9f2f1928a36b4fb7e05f79e0c694382713dc8c92 /drivers/usb/musb
parentae5ad2963939d24eb77b8fa725d0703dc0f97a47 (diff)
OMAP:MUSB: Corrects urb unlink function path
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(). Acquired musb->lock() before usb_hcd_unlink_urb_from_ep() within in enqueue path. Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/musb_host.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index fcd72b54c851..17b5c189250e 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -291,6 +291,7 @@ __acquires(musb->lock)
291 urb->actual_length, urb->transfer_buffer_length 291 urb->actual_length, urb->transfer_buffer_length
292 ); 292 );
293 293
294 usb_hcd_unlink_urb_from_ep(musb_to_hcd(musb), urb);
294 spin_unlock(&musb->lock); 295 spin_unlock(&musb->lock);
295 usb_hcd_giveback_urb(musb_to_hcd(musb), urb, status); 296 usb_hcd_giveback_urb(musb_to_hcd(musb), urb, status);
296 spin_lock(&musb->lock); 297 spin_lock(&musb->lock);
@@ -353,8 +354,6 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status)
353 break; 354 break;
354 } 355 }
355 356
356 usb_hcd_unlink_urb_from_ep(musb_to_hcd(musb), urb);
357
358 qh->is_ready = 0; 357 qh->is_ready = 0;
359 __musb_giveback(musb, urb, status); 358 __musb_giveback(musb, urb, status);
360 qh->is_ready = ready; 359 qh->is_ready = ready;
@@ -1791,7 +1790,9 @@ static int musb_urb_enqueue(
1791 */ 1790 */
1792 qh = kzalloc(sizeof *qh, mem_flags); 1791 qh = kzalloc(sizeof *qh, mem_flags);
1793 if (!qh) { 1792 if (!qh) {
1793 spin_lock_irqsave(&musb->lock, flags);
1794 usb_hcd_unlink_urb_from_ep(hcd, urb); 1794 usb_hcd_unlink_urb_from_ep(hcd, urb);
1795 spin_unlock_irqrestore(&musb->lock, flags);
1795 return -ENOMEM; 1796 return -ENOMEM;
1796 } 1797 }
1797 1798
@@ -1907,7 +1908,9 @@ static int musb_urb_enqueue(
1907 1908
1908done: 1909done:
1909 if (ret != 0) { 1910 if (ret != 0) {
1911 spin_lock_irqsave(&musb->lock, flags);
1910 usb_hcd_unlink_urb_from_ep(hcd, urb); 1912 usb_hcd_unlink_urb_from_ep(hcd, urb);
1913 spin_unlock_irqrestore(&musb->lock, flags);
1911 kfree(qh); 1914 kfree(qh);
1912 } 1915 }
1913 return ret; 1916 return ret;