public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RFC] usbhid: enable autosuspend for internal devices
@ 2015-06-26 19:24 Tom Gundersen
  2015-06-26 19:32 ` Greg Kroah-Hartman
  2015-06-26 20:08 ` Alan Stern
  0 siblings, 2 replies; 16+ messages in thread
From: Tom Gundersen @ 2015-06-26 19:24 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-input, linux-kernel, Tom Gundersen, Jiri Kosina,
	Greg Kroah-Hartman

This policy used to be unconditionally applied by udev, but there
is no reason to make userspace be involved in this and in the future
udev will not be doing it by default.

See: <https://github.com/systemd/systemd/pull/353>.

Signed-off-by: Tom Gundersen <teg@jklm.no>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---

Hi,

I don't have the right hardware for this, so it has only been compile-tested.
I'm therefore sending it as an RFC only. Mainly I want to bring it to people's
attention that it would be great to get this feature into the kernel as we want
to drop it from udev.

Cheers,

Tom

 drivers/hid/usbhid/hid-core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index bfbe1be..af80700 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -1358,6 +1358,9 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *
 	setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid);
 	spin_lock_init(&usbhid->lock);
 
+	if (dev->removable == USB_DEVICE_FIXED)
+		usb_enable_autosuspend(dev);
+
 	ret = hid_add_device(hid);
 	if (ret) {
 		if (ret != -ENODEV)
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 16+ messages in thread
* Re: [PATCH][RFC] usbhid: enable autosuspend for internal devices
@ 2015-07-02  7:18 Andreas Mohr
  2015-07-02 14:08 ` Alan Stern
  0 siblings, 1 reply; 16+ messages in thread
From: Andreas Mohr @ 2015-07-02  7:18 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Alan Stern, linux-kernel, Jiri Kosina

Hi,

Greg Kroah-Hartman wrote:
> On Fri, Jun 26, 2015 at 09:20:19PM -0400, Alan Stern wrote:
> > I can test it next week, if you would like to see the actual values.

> That would be great.

That one? (plus mouse plugged into keyboard hub)

http://lisas.de/~andi/lkml/Apple_A1048_lsusb/

HTH,

Andreas Mohr

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

end of thread, other threads:[~2015-07-02 14:09 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-26 19:24 [PATCH][RFC] usbhid: enable autosuspend for internal devices Tom Gundersen
2015-06-26 19:32 ` Greg Kroah-Hartman
2015-06-26 20:08 ` Alan Stern
2015-06-26 20:28   ` Alan Stern
2015-06-26 22:15   ` Greg Kroah-Hartman
2015-06-27  1:20     ` Alan Stern
2015-06-27  1:29       ` Greg Kroah-Hartman
2015-06-27  6:29         ` Jiri Kosina
2015-06-27 15:31           ` Greg Kroah-Hartman
2015-06-30 15:21             ` Alan Stern
2015-06-29  9:48           ` Oliver Neukum
2015-06-29 11:16             ` Jiri Kosina
2015-06-29 11:37               ` Oliver Neukum
2015-06-29 12:00                 ` Jiri Kosina
  -- strict thread matches above, loose matches on Subject: below --
2015-07-02  7:18 Andreas Mohr
2015-07-02 14:08 ` Alan Stern

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