[systemd-devel] Udev rules hardware database

Greg Kroah-Hartman gregkh at linuxfoundation.org
Thu Nov 6 15:09:32 PST 2014


On Thu, Nov 06, 2014 at 07:49:38PM +0100, Lennart Poettering wrote:
> On Wed, 05.11.14 16:55, Patrick Häcker (pat_h at web.de) wrote:
> 
> heya,
> 
> > sorry if this list is not the correct one for my post. In this case please 
> > just point me to the correct list.
> 
> It is the correct list.
> 
> > I you want to have permanent power saving activated for your devices, the 
> > recommended way is to use udev (e.g. 
> > https://wiki.archlinux.org/index.php/Power_saving#USB_autosuspend). Some 
> > devices do not work with active power saving, which is the reason why it's 
> > not activated by default. To get it working anyway, users should activated it 
> > for all devices and create their own blacklists.
> > 
> > I did exactly that and had to copy blacklists to multiple computers when 
> > moving my devices around. As this should be distribution agnostic, I wonder 
> > if there are upstream blacklists or whitelists to take care of this problem.
> > 
> > A power save whitelist would be useful, as distributions could start 
> > activating power saving for theses devices immediately. A power save 
> > blacklist would be useful as users could try to activate power saving for all 
> > devices and if their problematic hardware is already on the blacklist, 
> > everything works and they can save even more power as with the whitelist.
> > 
> > In the long run there could even be a small "please test your hardware" tool, 
> > where the power saving is activated for, e.g., your mouse. You then have to 
> > click to confirm that it is working. Otherwise power saving gets deactivated 
> > after a timeout, so you can use your mouse again. This result could then be 
> > automatically uploaded (after user confirmation) and added to the 
> > blacklist/whitelist.
> > 
> > So I have several questions:
> > - Is there already something like this?
> 
> No there's nothing like that to my knowledge.
> 
> > - If not, is udev the correct piece in the Linux stack to put this?
> 
> Yes, and the hwdb has been created for things likt this.
> 
> > - What is the general way to contribute udev rules?
> 
> The matching bits really belong in hwdb. The matching should then set
> a property and a udev rule should then update the hw device.
> 
> > - Where is it documented?
> 
> it's tersely documented in the udev man page. systemd already ships
> some hwdb bits (such as the PCI/USB name databases), and we should add
> more to this.
> 
> IIUC we probably can implement this as a blacklist, rather than a
> whitelist. IIRC there used to be a kernel bug that caused autosuspend
> to mostly not work on Linux, which they however blamed on crappy
> devices for a long time. After that kernel bug got fixed I think
> autosuspend works on most devices now, hence we only need a blacklist?
> 
> I figure Greg has all the details on this, let's ask him (added to CC):
> 
> Greg, say something! Is the autosuspend stuff something we can enable
> safely on most devices now? Do we need a blacklist? Or should we even
> go for a whitelist?

I really don't know.  Some other operating system relies on a whitelist
due to all of the horrible devices out there that can't handle suspend
(keyboards and mice are notorious for being bad.)  You might want to ask
one of the distro people to see if they have ever turned it on "by
default" and what happened if they tried that.

thanks,

greg k-h


More information about the systemd-devel mailing list