* Re: [PATCH] bt usb-device initialize as wakeup enable
2017-08-14 18:24 [PATCH] bt usb-device initialize as wakeup enable Sukumar Ghorai
@ 2017-08-14 6:10 ` Marcel Holtmann
2017-08-14 7:25 ` Oliver Neukum
0 siblings, 1 reply; 4+ messages in thread
From: Marcel Holtmann @ 2017-08-14 6:10 UTC (permalink / raw)
To: Sukumar Ghorai, Greg Kroah-Hartman, Oliver Neukum
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.
>
> Hence usb-wakeup capability enable form btusc driver as a generic
> solution for multiple profile usecase and required for USB remote
> wakeup (in-bus wakeup) while host is suspended.
>
> Signed-off-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
> Signed-off-by: Amit K Bag <amit.k.bag@intel.com>#
> ---
> drivers/bluetooth/btusb.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index e1124ba44154..7eeeeb6ffae6 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -1083,6 +1083,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_init_wakeup(&data->udev->dev, true);
>
is this the right location? Are we repeating this on every hciconfig up / btmgmt poweron operation? Or is this something that should be actually happen only once during USB probe callback?
Regards
Marcel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] bt usb-device initialize as wakeup enable
2017-08-14 6:10 ` Marcel Holtmann
@ 2017-08-14 7:25 ` Oliver Neukum
2017-08-14 11:49 ` Ghorai, Sukumar
0 siblings, 1 reply; 4+ messages in thread
From: Oliver Neukum @ 2017-08-14 7:25 UTC (permalink / raw)
To: Marcel Holtmann, Sukumar Ghorai, Greg Kroah-Hartman
Cc: Johan Hedberg, Amit K Bag #, Gustavo F. Padovan, linux-bluetooth
Am Montag, den 14.08.2017, 08:10 +0200 schrieb Marcel Holtmann:
> 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.
> >
> > Hence usb-wakeup capability enable form btusc driver as a generic
> > solution for multiple profile usecase and required for USB remote
> > wakeup (in-bus wakeup) while host is suspended.
> >
> > Signed-off-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
> > Signed-off-by: Amit K Bag <amit.k.bag@intel.com>#
> > ---
> > drivers/bluetooth/btusb.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> > index e1124ba44154..7eeeeb6ffae6 100644
> > --- a/drivers/bluetooth/btusb.c
> > +++ b/drivers/bluetooth/btusb.c
> > @@ -1083,6 +1083,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_init_wakeup(&data->udev->dev, true);
> >
>
> is this the right location? Are we repeating this on every hciconfig up / btmgmt poweron operation? Or is this something that should be actually happen only once during USB probe callback?
Hi,
it would be more efficient to do that on probe(). But have you tested this for
side effects? Will other BT operations now wake up the host?
On a philosophical note it is kind of ugly to solve a generic problem
in btusb. Arguably wakeup capability should propagate up the device tree
if you request it. Have you discussed this with Rafael?
Regards
Oliver
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] bt usb-device initialize as wakeup enable
2017-08-14 7:25 ` Oliver Neukum
@ 2017-08-14 11:49 ` Ghorai, Sukumar
0 siblings, 0 replies; 4+ messages in thread
From: Ghorai, Sukumar @ 2017-08-14 11:49 UTC (permalink / raw)
To: Oliver Neukum, Marcel Holtmann, Greg Kroah-Hartman
Cc: Johan Hedberg, Bag, Amit K, Gustavo F. Padovan,
linux-bluetooth@vger.kernel.org, Wysocki, Rafael J
Pj4gPg0KPj4gPiBCVC1Db250cm9sbGVyIGNvbm5lY3RlZCBhcyBwbGF0Zm9ybSBub24tcm9vdC1o
dWIgZGV2aWNlIGFuZA0KPj4gPiB1c2ItZHJpdmVyIGluaXRpYWxpemUgc3VjaCBkZXZpY2Ugd2l0
aCB3YWtldXAgZGlzYWJsZWQsIFJlZi4NCj4+ID4gdXNiX25ld19kZXZpY2UoKS4NCj4+ID4NCj4+
ID4gQXQgcHJlc2VudCB3YWtldXAtY2FwYWJpbGl0eSBnZXQgZW5hYmxlZCBieSBoaWQtaW5wdXQg
ZGV2aWNlIGZyb20NCj4+ID4gdXNiIGZ1bmN0aW9uIGRyaXZlcihlLmcuIEJUIEhJRCBkZXZpY2Up
IGF0IHJ1bnRpbWUuIEFnYWluIHNvbWUNCj4+ID4gZnVuY3Rpb25hbCBkcml2ZXIgZG9lcyBub3Qg
c2V0IHVzYi13YWtldXAgY2FwYWJpbGl0eShlLmcgTEUgSElEDQo+PiA+IGRldmljZSBpbXBsZW1l
bnQgYXMgSElELW92ZXItR0FUVCksIGFuZCBjYW4ndCB3YWtldXAgdGhlIGhvc3Qgb24gVVNCLg0K
Pj4gPg0KPj4gPiBIZW5jZSB1c2Itd2FrZXVwIGNhcGFiaWxpdHkgZW5hYmxlIGZvcm0gYnR1c2Mg
ZHJpdmVyIGFzIGEgZ2VuZXJpYw0KPj4gPiBzb2x1dGlvbiBmb3IgbXVsdGlwbGUgcHJvZmlsZSB1
c2VjYXNlIGFuZCBy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c2VkIHRoaXMgd2l0aCBSYWZhZWw/DQpbU3VrdW1h
cl0gV2UgbmVlZCB0aGUgYnQtY29udHJvbGxlciB0byBiZSB3YWtlLXVwIGVuYWJsZSwgd2hpbGUg
aG9zdCBpcyBzdXNwZW5kZWQuDQpBbmQgZXZlbiB3aGVuIG5vIHByb2ZpbGUvcHJvdG9jb2wgaXMg
ZW5hYmxlZCBhbmQgdG8gYWNjZXB0IHRoZSByZW1vdGUgY29ubmVjdGlvbiwgDQpmb3IgZXhhbXBs
ZS4NCg0KPg0KPglSZWdhcmRzDQo+CQlPbGl2ZXINCg0K
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] bt usb-device initialize as wakeup enable
@ 2017-08-14 18:24 Sukumar Ghorai
2017-08-14 6:10 ` Marcel Holtmann
0 siblings, 1 reply; 4+ messages in thread
From: Sukumar Ghorai @ 2017-08-14 18:24 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.
Hence usb-wakeup capability enable form btusc driver as a generic
solution for multiple profile usecase and required for USB remote
wakeup (in-bus wakeup) while host is suspended.
Signed-off-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
Signed-off-by: Amit K Bag <amit.k.bag@intel.com>#
---
drivers/bluetooth/btusb.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index e1124ba44154..7eeeeb6ffae6 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -1083,6 +1083,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_init_wakeup(&data->udev->dev, true);
if (test_and_set_bit(BTUSB_INTR_RUNNING, &data->flags))
goto done;
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-08-14 18:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-14 18:24 [PATCH] bt usb-device initialize as wakeup enable Sukumar Ghorai
2017-08-14 6:10 ` Marcel Holtmann
2017-08-14 7:25 ` Oliver Neukum
2017-08-14 11:49 ` Ghorai, Sukumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).