Skip to content

Bluetooth: Fix workqueue related issues

Johan Hedberg linux-bluetooth 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Bluetooth: Add a new workqueue for hci_request operationsinclude/net/bluetooth/hci_core.h net/bluetooth/hci_core.c+12 -01 reply
2/4Bluetooth: Use req_workqueue for hci_request operationsnet/bluetooth/hci_core.c net/bluetooth/mgmt.c+5 -41 reply
3/4Bluetooth: Fix using system-global workqueue when not necessarynet/bluetooth/hci_core.c net/bluetooth/mgmt.c+4 -32 replies
4/4Bluetooth: Fix write_scan_enable when HCI_AUTO_OFF is setnet/bluetooth/hci_event.c net/bluetooth/mgmt.c+27 -181 reply

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchMarcel Holtmann
1/4A-b
2/4A-b
3/4A-b
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] Bluetooth: Fix workqueue related issues

Hi,

I was initially only going to fix the thing in the last patch of this set but after starting to look at the code I found several other issues and hence the rest of the patches.

The first three patches fix work queue handling. We should, whenever possible, avoid the system-global workqueue (the schedule_*work functions) and use hdev-specific ones instead. However, we can't use hci_request() with the usual workqueue since that would block e.g. hci_send_cmd from completing so a second work queue is needed.

The last patch fixes a race with setting the scan mode that I was seeing every once in a while through a connectable or discoverable test case of mgmt-tester failing. There are several other HCI commands with the same potential issue (like the class of device and the local name) but I haven't gotten around to fixing those yet.

Johan