mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-03 17:51:57 +09:00
Bluetooth: Fix issue with USB suspend in btusb driver
commit 85560c4a82 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
90f9a6a427
commit
41ba8fa07c
@@ -302,6 +302,9 @@ static void btusb_intr_complete(struct urb *urb)
|
||||
BT_ERR("%s corrupted event packet", hdev->name);
|
||||
hdev->stat.err_rx++;
|
||||
}
|
||||
} else if (urb->status == -ENOENT) {
|
||||
/* Avoid suspend failed when usb_kill_urb */
|
||||
return;
|
||||
}
|
||||
|
||||
if (!test_bit(BTUSB_INTR_RUNNING, &data->flags))
|
||||
@@ -390,6 +393,9 @@ static void btusb_bulk_complete(struct urb *urb)
|
||||
BT_ERR("%s corrupted ACL packet", hdev->name);
|
||||
hdev->stat.err_rx++;
|
||||
}
|
||||
} else if (urb->status == -ENOENT) {
|
||||
/* Avoid suspend failed when usb_kill_urb */
|
||||
return;
|
||||
}
|
||||
|
||||
if (!test_bit(BTUSB_BULK_RUNNING, &data->flags))
|
||||
@@ -484,6 +490,9 @@ static void btusb_isoc_complete(struct urb *urb)
|
||||
hdev->stat.err_rx++;
|
||||
}
|
||||
}
|
||||
} else if (urb->status == -ENOENT) {
|
||||
/* Avoid suspend failed when usb_kill_urb */
|
||||
return;
|
||||
}
|
||||
|
||||
if (!test_bit(BTUSB_ISOC_RUNNING, &data->flags))
|
||||
|
||||
Reference in New Issue
Block a user