Skip to contentSkip to conversation

Bluetooth USB: fix kernel panic during suspend - 2.6.24

PATCH In review Colin Ian King 3 participants 3 messages Feb 13, 2009 – Feb 14, 2009 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth USB: fix kernel panic during suspend - 2.6.24

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.

---
 drivers/bluetooth/hci_usb.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/bluetooth/hci_usb.c +0 -0
index cf734ca..22fd5b5 100644
@@ -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);

#1 lore raw
Quoted 6 lines · Colin Ian King

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.

Quoted 7 lines

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.

Is this still an issue on a supported-by-the-community kernel (.27, .28, .29)?

thanks,

greg k-h

maintainer
#2 lore raw

Hi Greg,

Quoted 9 lines
Quoted 9 lines

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.

Quoted 6 lines
Quoted 3 lines

Also added a spin_lock around the list_add operation.

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