public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Cancel sync commands if a TX failure occurs
@ 2021-11-09 16:41 Benjamin Berg
  2021-11-09 16:41 ` [PATCH 1/4] Bluetooth: Reset more state when cancelling a sync command Benjamin Berg
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Benjamin Berg @ 2021-11-09 16:41 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Benjamin Berg

It was reported that userspace could hang for 10s after resuming due to
btusb hitting the internal timeout when sending the firmware.

In this case, the bluetooth dongle disappeared right after resume due to
the thinkpad_acpi rfkill being blocked. This causes the USB device to
disappear, however the bluetooth stack does not handle the
corresponding ENODEV errors and instead waits for a timeout to happen.

To avoid blocking everything for such a long time, the synchronous
command has to finish immediately after an ENODEV error occurs. This
requires further error handling, which this patchset adds by building
on top of the existing cancellation infrastructure for synchronous
commands.

Note that this just adds basic error handling in order to quickly abort
the initialization routine in case the device disappears at that time.
Additional error handling such as calling hci_reset_dev might be
sensible in some cases.

Benjamin Berg (4):
  Bluetooth: Reset more state when cancelling a sync command
  Bluetooth: Add new hci_tx_error function
  Bluetooth: hci_core: Signal TX failure if sending a frame failed
  Bluetooth: btusb: Signal URB errors as TX failure

 drivers/bluetooth/btusb.c        | 16 ++++++++++++----
 include/net/bluetooth/hci_core.h |  1 +
 net/bluetooth/hci_core.c         |  9 +++++++++
 net/bluetooth/hci_request.c      |  5 +++++
 4 files changed, 27 insertions(+), 4 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-12-02 23:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-09 16:41 [PATCH 0/4] Cancel sync commands if a TX failure occurs Benjamin Berg
2021-11-09 16:41 ` [PATCH 1/4] Bluetooth: Reset more state when cancelling a sync command Benjamin Berg
2021-12-02 23:52   ` Luiz Augusto von Dentz
2021-11-09 16:41 ` [PATCH 2/4] Bluetooth: Add new hci_tx_error function Benjamin Berg
2021-11-09 23:06   ` Luiz Augusto von Dentz
2021-11-09 16:41 ` [PATCH 3/4] Bluetooth: hci_core: Signal TX failure if sending a frame failed Benjamin Berg
2021-11-09 23:13   ` Luiz Augusto von Dentz
2021-11-10  8:46     ` Benjamin Berg
2021-11-09 16:41 ` [PATCH 4/4] Bluetooth: btusb: Signal URB errors as TX failure Benjamin Berg
2021-11-09 23:25   ` Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox