Skip to content

Commit 4935f1c

Browse files
pebolleGustavo F. Padovan
authored andcommitted
Bluetooth: btusb: be quiet on device disconnect
Disabling the bluetooth usb device embedded in (some) ThinkPads tends to lead to errors like these: btusb_bulk_complete: hci0 urb ffff88011b9bfd68 failed to resubmit (19) btusb_intr_complete: hci0 urb ffff88011b46a318 failed to resubmit (19) btusb_bulk_complete: hci0 urb ffff88011b46a000 failed to resubmit (19) That is because usb_disconnect() doesn't "quiesces" pending urbs. Disconnecting a device is a normal thing to happen so it's no big deal that usb_submit_urb() returns -ENODEV. The simplest way to get rid of these errors is to stop treating that return as an error. Trivial, actually. While we're at it, add comments to be explicit about the reasons we're not complaining about -EPERM and -ENODEV. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
1 parent 8475e23 commit 4935f1c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎drivers/bluetooth/btusb.c‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ static void btusb_intr_complete(struct urb *urb)
256256

257257
err = usb_submit_urb(urb, GFP_ATOMIC);
258258
if (err < 0) {
259-
if (err != -EPERM)
259+
/* -EPERM: urb is being killed;
260+
* -ENODEV: device got disconnected */
261+
if (err != -EPERM && err != -ENODEV)
260262
BT_ERR("%s urb %p failed to resubmit (%d)",
261263
hdev->name, urb, -err);
262264
usb_unanchor_urb(urb);
@@ -341,7 +343,9 @@ static void btusb_bulk_complete(struct urb *urb)
341343

342344
err = usb_submit_urb(urb, GFP_ATOMIC);
343345
if (err < 0) {
344-
if (err != -EPERM)
346+
/* -EPERM: urb is being killed;
347+
* -ENODEV: device got disconnected */
348+
if (err != -EPERM && err != -ENODEV)
345349
BT_ERR("%s urb %p failed to resubmit (%d)",
346350
hdev->name, urb, -err);
347351
usb_unanchor_urb(urb);
@@ -431,7 +435,9 @@ static void btusb_isoc_complete(struct urb *urb)
431435

432436
err = usb_submit_urb(urb, GFP_ATOMIC);
433437
if (err < 0) {
434-
if (err != -EPERM)
438+
/* -EPERM: urb is being killed;
439+
* -ENODEV: device got disconnected */
440+
if (err != -EPERM && err != -ENODEV)
435441
BT_ERR("%s urb %p failed to resubmit (%d)",
436442
hdev->name, urb, -err);
437443
usb_unanchor_urb(urb);

0 commit comments

Comments
 (0)