Linux bluetooth development
 help / color / mirror / Atom feed
* Re: [PATCH] Bluetooth: btusb: driver to enable the usb-wakeup feature
  2017-08-16 21:46 [PATCH] Bluetooth: btusb: driver to enable the usb-wakeup feature Sukumar Ghorai
@ 2017-08-16  9:37 ` Marcel Holtmann
  2017-08-16  9:42   ` Oliver Neukum
  2017-08-16  9:49 ` Marcel Holtmann
  1 sibling, 1 reply; 4+ messages in thread
From: Marcel Holtmann @ 2017-08-16  9:37 UTC (permalink / raw)
  To: Sukumar Ghorai, Oliver Neukum, Greg Kroah-Hartman
  Cc: Gustavo F. Padovan, Johan Hedberg, linux-bluetooth, Amit K Bag

Hi Oliver,

> BT-Controller connected as platform non-root-hub device and
> usb-driver initialize such device with wakeup disabled,
> Ref. usb_new_device().
> 
> At present wakeup-capability get enabled by hid-input device from usb
> function driver(e.g. BT HID device) at runtime. Again some functional
> driver does not set usb-wakeup capability(e.g LE HID device implement
> as HID-over-GATT), and can't wakeup the host on USB.
> 
> Most of the device operation (such as mass storage) initiated from host
> (except HID) and USB wakeup aligned with host resume procedure. For BT
> device, usb-wakeup capability need to enable form btusc driver as a
> generic solution for multiple profile use case and required for USB remote
> wakeup (in-bus wakeup) while host is suspended. Also usb-wakeup feature
> need to enable/disable with HCI interface up and down.
> 
> Signed-off-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
> Signed-off-by: Amit K Bag <amit.k.bag@intel.com>
> ---
> drivers/bluetooth/btusb.c | 5 +++++
> 1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index e8d8a3f61f5b..7a5c06aaa181 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -1088,6 +1088,10 @@ static int btusb_open(struct hci_dev *hdev)
> 	}
> 
> 	data->intf->needs_remote_wakeup = 1;
> +	/* device specific wakeup source enabled and required for USB
> +	 * remote wakeup while host is suspended
> +	 */
> +	device_wakeup_enable(&data->udev->dev);
> 
> 	if (test_and_set_bit(BTUSB_INTR_RUNNING, &data->flags))
> 		goto done;
> @@ -1151,6 +1155,7 @@ static int btusb_close(struct hci_dev *hdev)
> 		goto failed;
> 
> 	data->intf->needs_remote_wakeup = 0;
> +	device_wakeup_disable(&data->udev->dev);
> 	usb_autopm_put_interface(data->intf);

if this is an acceptable way of handling this, can I get an ack from you.

Regards

Marcel


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

* Re: [PATCH] Bluetooth: btusb: driver to enable the usb-wakeup feature
  2017-08-16  9:37 ` Marcel Holtmann
@ 2017-08-16  9:42   ` Oliver Neukum
  0 siblings, 0 replies; 4+ messages in thread
From: Oliver Neukum @ 2017-08-16  9:42 UTC (permalink / raw)
  To: Marcel Holtmann, Sukumar Ghorai, Greg Kroah-Hartman
  Cc: Johan Hedberg, Amit K Bag, Gustavo F. Padovan, linux-bluetooth

Am Mittwoch, den 16.08.2017, 11:37 +0200 schrieb Marcel Holtmann:
> Hi Oliver,
> 
> > 
> > BT-Controller connected as platform non-root-hub device and
> > usb-driver initialize such device with wakeup disabled,
> > Ref. usb_new_device().
> > 
> > At present wakeup-capability get enabled by hid-input device from usb
> > function driver(e.g. BT HID device) at runtime. Again some functional
> > driver does not set usb-wakeup capability(e.g LE HID device implement
> > as HID-over-GATT), and can't wakeup the host on USB.
> > 
> > Most of the device operation (such as mass storage) initiated from host
> > (except HID) and USB wakeup aligned with host resume procedure. For BT
> > device, usb-wakeup capability need to enable form btusc driver as a
> > generic solution for multiple profile use case and required for USB remote
> > wakeup (in-bus wakeup) while host is suspended. Also usb-wakeup feature
> > need to enable/disable with HCI interface up and down.
> > 
> > Signed-off-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
> > Signed-off-by: Amit K Bag <amit.k.bag@intel.com>
Acked-by: Oliver Neukum <oneukum@suse.com>

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

* Re: [PATCH] Bluetooth: btusb: driver to enable the usb-wakeup feature
  2017-08-16 21:46 [PATCH] Bluetooth: btusb: driver to enable the usb-wakeup feature Sukumar Ghorai
  2017-08-16  9:37 ` Marcel Holtmann
@ 2017-08-16  9:49 ` Marcel Holtmann
  1 sibling, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2017-08-16  9:49 UTC (permalink / raw)
  To: Sukumar Ghorai
  Cc: Gustavo F. Padovan, Johan Hedberg, linux-bluetooth, Amit K Bag

Hi Sukumar,

> BT-Controller connected as platform non-root-hub device and
> usb-driver initialize such device with wakeup disabled,
> Ref. usb_new_device().
> 
> At present wakeup-capability get enabled by hid-input device from usb
> function driver(e.g. BT HID device) at runtime. Again some functional
> driver does not set usb-wakeup capability(e.g LE HID device implement
> as HID-over-GATT), and can't wakeup the host on USB.
> 
> Most of the device operation (such as mass storage) initiated from host
> (except HID) and USB wakeup aligned with host resume procedure. For BT
> device, usb-wakeup capability need to enable form btusc driver as a
> generic solution for multiple profile use case and required for USB remote
> wakeup (in-bus wakeup) while host is suspended. Also usb-wakeup feature
> need to enable/disable with HCI interface up and down.
> 
> Signed-off-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
> Signed-off-by: Amit K Bag <amit.k.bag@intel.com>
> ---
> drivers/bluetooth/btusb.c | 5 +++++
> 1 file changed, 5 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel


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

* [PATCH] Bluetooth: btusb: driver to enable the usb-wakeup feature
@ 2017-08-16 21:46 Sukumar Ghorai
  2017-08-16  9:37 ` Marcel Holtmann
  2017-08-16  9:49 ` Marcel Holtmann
  0 siblings, 2 replies; 4+ messages in thread
From: Sukumar Ghorai @ 2017-08-16 21:46 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo Padovan, Johan Hedberg
  Cc: linux-bluetooth, Sukumar Ghorai, Amit K Bag

BT-Controller connected as platform non-root-hub device and
usb-driver initialize such device with wakeup disabled,
Ref. usb_new_device().

At present wakeup-capability get enabled by hid-input device from usb
function driver(e.g. BT HID device) at runtime. Again some functional
driver does not set usb-wakeup capability(e.g LE HID device implement
as HID-over-GATT), and can't wakeup the host on USB.

Most of the device operation (such as mass storage) initiated from host
(except HID) and USB wakeup aligned with host resume procedure. For BT
device, usb-wakeup capability need to enable form btusc driver as a
generic solution for multiple profile use case and required for USB remote
wakeup (in-bus wakeup) while host is suspended. Also usb-wakeup feature
need to enable/disable with HCI interface up and down.

Signed-off-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
Signed-off-by: Amit K Bag <amit.k.bag@intel.com>
---
 drivers/bluetooth/btusb.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index e8d8a3f61f5b..7a5c06aaa181 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -1088,6 +1088,10 @@ static int btusb_open(struct hci_dev *hdev)
 	}
 
 	data->intf->needs_remote_wakeup = 1;
+	/* device specific wakeup source enabled and required for USB
+	 * remote wakeup while host is suspended
+	 */
+	device_wakeup_enable(&data->udev->dev);
 
 	if (test_and_set_bit(BTUSB_INTR_RUNNING, &data->flags))
 		goto done;
@@ -1151,6 +1155,7 @@ static int btusb_close(struct hci_dev *hdev)
 		goto failed;
 
 	data->intf->needs_remote_wakeup = 0;
+	device_wakeup_disable(&data->udev->dev);
 	usb_autopm_put_interface(data->intf);
 
 failed:
-- 
2.7.4

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

end of thread, other threads:[~2017-08-16 21:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-16 21:46 [PATCH] Bluetooth: btusb: driver to enable the usb-wakeup feature Sukumar Ghorai
2017-08-16  9:37 ` Marcel Holtmann
2017-08-16  9:42   ` Oliver Neukum
2017-08-16  9:49 ` Marcel Holtmann

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