aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorChampion Chen <champion_chen@realsil.com.cn>2014-09-06 15:06:08 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-09-08 21:23:40 -0400
commit85560c4a828ec9c8573840c9b66487b6ae584768 (patch)
tree1e228a31513dbf5956e30ba8083794331e0728f0 /drivers/bluetooth
parente1e930f591bfd9604c3077f0af5c390f4f890259 (diff)
Bluetooth: Fix issue with USB suspend in btusb driver
Suspend could fail for some platforms because btusb_suspend==> btusb_stop_traffic ==> usb_kill_anchored_urbs. When btusb_bulk_complete returns before system suspend and resubmits an URB, the system cannot enter suspend state. Signed-off-by: Champion Chen <champion_chen@realsil.com.cn> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/btusb.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 0527b29c3954..a79d657c0845 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -331,6 +331,9 @@ static void btusb_intr_complete(struct urb *urb)
331 BT_ERR("%s corrupted event packet", hdev->name); 331 BT_ERR("%s corrupted event packet", hdev->name);
332 hdev->stat.err_rx++; 332 hdev->stat.err_rx++;
333 } 333 }
334 } else if (urb->status == -ENOENT) {
335 /* Avoid suspend failed when usb_kill_urb */
336 return;
334 } 337 }
335 338
336 if (!test_bit(BTUSB_INTR_RUNNING, &data->flags)) 339 if (!test_bit(BTUSB_INTR_RUNNING, &data->flags))
@@ -419,6 +422,9 @@ static void btusb_bulk_complete(struct urb *urb)
419 BT_ERR("%s corrupted ACL packet", hdev->name); 422 BT_ERR("%s corrupted ACL packet", hdev->name);
420 hdev->stat.err_rx++; 423 hdev->stat.err_rx++;
421 } 424 }
425 } else if (urb->status == -ENOENT) {
426 /* Avoid suspend failed when usb_kill_urb */
427 return;
422 } 428 }
423 429
424 if (!test_bit(BTUSB_BULK_RUNNING, &data->flags)) 430 if (!test_bit(BTUSB_BULK_RUNNING, &data->flags))
@@ -513,6 +519,9 @@ static void btusb_isoc_complete(struct urb *urb)
513 hdev->stat.err_rx++; 519 hdev->stat.err_rx++;
514 } 520 }
515 } 521 }
522 } else if (urb->status == -ENOENT) {
523 /* Avoid suspend failed when usb_kill_urb */
524 return;
516 } 525 }
517 526
518 if (!test_bit(BTUSB_ISOC_RUNNING, &data->flags)) 527 if (!test_bit(BTUSB_ISOC_RUNNING, &data->flags))