Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753759AbbF0BaF (ORCPT ); Fri, 26 Jun 2015 21:30:05 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47742 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751762AbbF0B37 (ORCPT ); Fri, 26 Jun 2015 21:29:59 -0400 Date: Fri, 26 Jun 2015 18:29:59 -0700 From: Greg Kroah-Hartman To: Alan Stern Cc: Tom Gundersen , linux-usb@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Kosina Subject: Re: [PATCH][RFC] usbhid: enable autosuspend for internal devices Message-ID: <20150627012959.GA15207@kroah.com> References: <20150626221517.GB2761@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23+89 (0255b37be491) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2659 Lines: 59 On Fri, Jun 26, 2015 at 09:20:19PM -0400, Alan Stern wrote: > On Fri, 26 Jun 2015, Greg Kroah-Hartman wrote: > > > > This doesn't do what the patch title says. USB_DEVICE_FIXED means that > > > the device can't be unplugged from its upstream port. It doesn't mean > > > the device is internal to the computer. > > > > > > As an example, consider a composite Apple keyboard, which has an > > > internal 3-port USB hub where two of the hub's ports are exposed on the > > > edge of the keyboard case and the keyboard controller is permanently > > > attached to the third hub port. Then the controller device would be > > > marked USB_DEVICE_FIXED, even though the whole thing is external to > > > the computer and can be unplugged. > > > > > > > Is that really how those devices are marked? I can't find any of my > > keyboard with hubs that mark things that way. > > My Apple keyboard isn't here at the moment, and I don't remember > exactly what its hub descriptor contains. In theory, it _should_ mark > the permanently attached port as non-removable. > > I can test it next week, if you would like to see the actual values. That would be great. > > > Also, are you really certain this is safe? Aren't there a number of > > > built-in keyboards that will work badly if you allow them to > > > autosuspend? > > > > udev has been doing this for a while now by default, with no reports of > > problems, so I think we should be safe. > > I thought udev used a whitelist of devices known to work okay with > autosuspend. Does it really turn on autosuspend for _every_ USB HID > device that is marked as removable? Yes, it had a tiny whitelist of 3-4 devices, and then would turn on autosuspend for anything not marked as removable or unknown. Look at /usr/lib/udev/rules.d/42-usb-hid-pm.rules on your system for them, it's these lines: ACTION=="add", SUBSYSTEM=="usb", SUBSYSTEMS=="usb", ATTR{../removable}=="removable", GOTO="usb_hid_pm_end" ACTION=="add", SUBSYSTEM=="usb", SUBSYSTEMS=="usb", ATTR{../removable}=="unknown", GOTO="usb_hid_pm_end" > (Come to think of it, given the bug in the hub driver, no device > attached directly to the root hub will _ever_ be marked as removable > AFAICS. So maybe that bug is masking possible regressions.) Maybe that's the issue, don't know, it would be good to figure out as upstream udev just deleted that whole rules file :) thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/