public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] btusb: Avoid reset of ISOC endpoint alt settings to zero
@ 2022-10-03  6:48 Kiran K
  2022-10-03  7:32 ` [v1] " bluez.test.bot
  2022-10-07 19:40 ` [PATCH v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 4+ messages in thread
From: Kiran K @ 2022-10-03  6:48 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: ravishankar.srivatsa, Chethan Tumkur Narayan, Kiran K

From: Chethan Tumkur Narayan <chethan.tumkur.narayan@intel.com>

In case of suspend/resume and HCI_RESET (BT On and Off),
ISOC endpoint set to alt setting 0 when no SCO connection exists.
This patch shall avoid resetting of ISOC endpoint to alt setting to 0.

Signed-off-by: Chethan Tumkur Narayan <chethan.tumkur.narayan@intel.com>
Signed-off-by: Kiran K <kiran.k@intel.com>
---
 drivers/bluetooth/btusb.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 271963805a38..ebfec6d8573f 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -1981,10 +1981,11 @@ static void btusb_work(struct work_struct *work)
 		if (btusb_switch_alt_setting(hdev, new_alts) < 0)
 			bt_dev_err(hdev, "set USB alt:(%d) failed!", new_alts);
 	} else {
-		clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
 		usb_kill_anchored_urbs(&data->isoc_anchor);
 
-		__set_isoc_interface(hdev, 0);
+		if (test_and_clear_bit(BTUSB_ISOC_RUNNING, &data->flags))
+			__set_isoc_interface(hdev, 0);
+
 		if (test_and_clear_bit(BTUSB_DID_ISO_RESUME, &data->flags))
 			usb_autopm_put_interface(data->isoc ? data->isoc : data->intf);
 	}
-- 
2.17.1


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

end of thread, other threads:[~2022-10-07 19:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-03  6:48 [PATCH v1] btusb: Avoid reset of ISOC endpoint alt settings to zero Kiran K
2022-10-03  7:32 ` [v1] " bluez.test.bot
2022-10-04 18:43   ` Luiz Augusto von Dentz
2022-10-07 19:40 ` [PATCH v1] " patchwork-bot+bluetooth

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