Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bluetooth: btusb: Reject autosuspend if discovery is active

If USB autosuspend occurs while discovery is active, the ongoing
HCI operation may not complete successfully. On some devices, this
can leave discovery.state stuck in DISCOVERY_FINDING.

Signed-off-by: Linmao Li <lilinmao@kylinos.cn>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

authored by

Linmao Li and committed by
Luiz Augusto von Dentz
312b09bb 97eb023c

+4 -3
+4 -3
drivers/bluetooth/btusb.c
··· 4472 4472 4473 4473 BT_DBG("intf %p", intf); 4474 4474 4475 - /* Don't auto-suspend if there are connections; external suspend calls 4476 - * shall never fail. 4475 + /* Don't auto-suspend if there are connections or discovery in 4476 + * progress; external suspend calls shall never fail. 4477 4477 */ 4478 - if (PMSG_IS_AUTO(message) && hci_conn_count(data->hdev)) 4478 + if (PMSG_IS_AUTO(message) && 4479 + (hci_conn_count(data->hdev) || hci_discovery_active(data->hdev))) 4479 4480 return -EBUSY; 4480 4481 4481 4482 if (data->suspend_count++)