2.4.36-stable kernel tree
Revision | f68679b942671fe80db13082a88f72e7a0b0b03c (tree) |
---|---|
Zeit | 2005-06-03 06:03:57 |
Autor | Marcel Holtmann <marcel@holt...> |
Commiter | Marcelo Tosatti |
[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.
@@ -470,12 +470,11 @@ static int bfusb_close(struct hci_dev *hdev) | ||
470 | 470 | return 0; |
471 | 471 | |
472 | 472 | write_lock_irqsave(&bfusb->lock, flags); |
473 | + write_unlock_irqrestore(&bfusb->lock, flags); | |
473 | 474 | |
474 | 475 | bfusb_unlink_urbs(bfusb); |
475 | 476 | bfusb_flush(hdev); |
476 | 477 | |
477 | - write_unlock_irqrestore(&bfusb->lock, flags); | |
478 | - | |
479 | 478 | MOD_DEC_USE_COUNT; |
480 | 479 | |
481 | 480 | return 0; |
@@ -398,13 +398,13 @@ static int hci_usb_close(struct hci_dev *hdev) | ||
398 | 398 | |
399 | 399 | BT_DBG("%s", hdev->name); |
400 | 400 | |
401 | + /* Synchronize with completion handlers */ | |
401 | 402 | write_lock_irqsave(&husb->completion_lock, flags); |
402 | - | |
403 | + write_unlock_irqrestore(&husb->completion_lock, flags); | |
404 | + | |
403 | 405 | hci_usb_unlink_urbs(husb); |
404 | 406 | hci_usb_flush(hdev); |
405 | 407 | |
406 | - write_unlock_irqrestore(&husb->completion_lock, flags); | |
407 | - | |
408 | 408 | MOD_DEC_USE_COUNT; |
409 | 409 | return 0; |
410 | 410 | } |