* [PATCH] Bluetooth USB: fix kernel panic during suspend - 2.6.24
@ 2009-02-13 9:49 Colin Ian King
2009-02-13 19:09 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Colin Ian King @ 2009-02-13 9:49 UTC (permalink / raw)
To: linux-kernel
The kernel panics when hci_usb_tx_complete() calls _urb_unlink()
on an _urb which has been previously been removed from a list.
This occurs during suspend while audio is being streamed to
a bluetooth headset.
The panic occurs because hci_usb_suspend() dequeues _urb
and then calls usb_kill_urb() - instead it should put _urb on
the killed list first before killing the urb.
Also added a spin_lock around the list_add operation.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/bluetooth/hci_usb.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index cf734ca..22fd5b5 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -1029,8 +1029,10 @@ static int hci_usb_suspend(struct usb_interface
*intf, pm_message_t message)
while ((_urb = _urb_dequeue(q))) {
/* reset queue since _urb_dequeue sets it to NULL */
_urb->queue = q;
- usb_kill_urb(&_urb->urb);
+ spin_lock_irqsave(&q->lock, flags);
list_add(&_urb->list, &killed);
+ spin_unlock_irqrestore(&q->lock, flags);
+ usb_kill_urb(&_urb->urb);
}
spin_lock_irqsave(&q->lock, flags);
--
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth USB: fix kernel panic during suspend - 2.6.24
2009-02-13 9:49 [PATCH] Bluetooth USB: fix kernel panic during suspend - 2.6.24 Colin Ian King
@ 2009-02-13 19:09 ` Greg KH
2009-02-14 12:53 ` Marcel Holtmann
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2009-02-13 19:09 UTC (permalink / raw)
To: Colin Ian King; +Cc: linux-kernel
On Fri, Feb 13, 2009 at 09:49:45AM +0000, Colin Ian King wrote:
>
> The kernel panics when hci_usb_tx_complete() calls _urb_unlink()
> on an _urb which has been previously been removed from a list.
> This occurs during suspend while audio is being streamed to
> a bluetooth headset.
>
> The panic occurs because hci_usb_suspend() dequeues _urb
> and then calls usb_kill_urb() - instead it should put _urb on
> the killed list first before killing the urb.
>
> Also added a spin_lock around the list_add operation.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Is this still an issue on a supported-by-the-community kernel (.27, .28,
.29)?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth USB: fix kernel panic during suspend - 2.6.24
2009-02-13 19:09 ` Greg KH
@ 2009-02-14 12:53 ` Marcel Holtmann
0 siblings, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2009-02-14 12:53 UTC (permalink / raw)
To: Greg KH; +Cc: Colin Ian King, linux-kernel
Hi Greg,
> > The kernel panics when hci_usb_tx_complete() calls _urb_unlink()
> > on an _urb which has been previously been removed from a list.
> > This occurs during suspend while audio is being streamed to
> > a bluetooth headset.
> >
> > The panic occurs because hci_usb_suspend() dequeues _urb
> > and then calls usb_kill_urb() - instead it should put _urb on
> > the killed list first before killing the urb.
> >
> > Also added a spin_lock around the list_add operation.
> >
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> Is this still an issue on a supported-by-the-community kernel (.27, .28,
> .29)?
starting with 2.6.29 the hci_usb driver has been replaced by btusb.
Regards
Marcel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-02-14 12:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-13 9:49 [PATCH] Bluetooth USB: fix kernel panic during suspend - 2.6.24 Colin Ian King
2009-02-13 19:09 ` Greg KH
2009-02-14 12:53 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox