• R/O
  • HTTP
  • SSH
  • HTTPS

linux-2.4.36: Commit

2.4.36-stable kernel tree


Commit MetaInfo

Revisionf68679b942671fe80db13082a88f72e7a0b0b03c (tree)
Time2005-06-03 06:03:57
AuthorMarcel Holtmann <marcel@holt...>
CommiterMarcelo Tosatti

Log Message

[PATCH] Fix" introduced in 2.4.27pre2 for bluetooth hci_usb race causes kernel hang

I have noticed a problem with a race condition fix introduced in
2.4.27-pre2 that causes the kernel to hang when disconnecting a
Bluetooth USB dongle or doing 'hciconfig hci0 down'. No message is
printed, the kernel just doesn't respond anymore.

if this works then we should do the same change in the bfusb driver. A
patch that fixes both drivers is attached.

Change Summary

Incremental Difference

--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -470,12 +470,11 @@ static int bfusb_close(struct hci_dev *hdev)
470470 return 0;
471471
472472 write_lock_irqsave(&bfusb->lock, flags);
473+ write_unlock_irqrestore(&bfusb->lock, flags);
473474
474475 bfusb_unlink_urbs(bfusb);
475476 bfusb_flush(hdev);
476477
477- write_unlock_irqrestore(&bfusb->lock, flags);
478-
479478 MOD_DEC_USE_COUNT;
480479
481480 return 0;
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -398,13 +398,13 @@ static int hci_usb_close(struct hci_dev *hdev)
398398
399399 BT_DBG("%s", hdev->name);
400400
401+ /* Synchronize with completion handlers */
401402 write_lock_irqsave(&husb->completion_lock, flags);
402-
403+ write_unlock_irqrestore(&husb->completion_lock, flags);
404+
403405 hci_usb_unlink_urbs(husb);
404406 hci_usb_flush(hdev);
405407
406- write_unlock_irqrestore(&husb->completion_lock, flags);
407-
408408 MOD_DEC_USE_COUNT;
409409 return 0;
410410 }
Show on old repository browser