Linux-Bluetooth Archive on lore.kernel.org
 help / Atom feed
* [PATCH] Bluetooth: btusb: btusb_intel_cmd_timeout: use sleeping functions
@ 2019-01-28 23:08 Rajat Jain
  2019-01-29 15:12 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Rajat Jain @ 2019-01-28 23:08 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Dmitry Torokhov, Rajat Jain,
	linux-bluetooth, linux-kernel
  Cc: rajatxjain, dtor

The btusb_intel_cmd_timeout() is called from workqueue contexts,
so use the helper functions that can sleep.

Signed-off-by: Rajat Jain <rajatja@google.com>

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 5de0c2e59b97..9a890b2a7ee1 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -523,9 +523,9 @@ static void btusb_intel_cmd_timeout(struct hci_dev *hdev)
 	}
 
 	bt_dev_err(hdev, "Initiating HW reset via gpio");
-	gpiod_set_value(reset_gpio, 1);
-	mdelay(100);
-	gpiod_set_value(reset_gpio, 0);
+	gpiod_set_value_cansleep(reset_gpio, 1);
+	msleep(100);
+	gpiod_set_value_cansleep(reset_gpio, 0);
 }
 
 static inline void btusb_free_frags(struct btusb_data *data)
-- 
2.20.1.495.gaa96b0ce6b-goog


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

* Re: [PATCH] Bluetooth: btusb: btusb_intel_cmd_timeout: use sleeping functions
  2019-01-28 23:08 [PATCH] Bluetooth: btusb: btusb_intel_cmd_timeout: use sleeping functions Rajat Jain
@ 2019-01-29 15:12 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2019-01-29 15:12 UTC (permalink / raw)
  To: Rajat Jain
  Cc: Johan Hedberg, Dmitry Torokhov, Bluez mailing list,
	Linux Kernel Mailing List, rajatxjain, dtor

Hi Rajat,

> The btusb_intel_cmd_timeout() is called from workqueue contexts,
> so use the helper functions that can sleep.
> 
> Signed-off-by: Rajat Jain <rajatja@google.com>

patch has been applied to bluetooth-next tree.

Regards

Marcel


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-28 23:08 [PATCH] Bluetooth: btusb: btusb_intel_cmd_timeout: use sleeping functions Rajat Jain
2019-01-29 15:12 ` Marcel Holtmann

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org linux-bluetooth@archiver.kernel.org
	public-inbox-index linux-bluetooth


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/ public-inbox