[systemd-devel] Udev rules hardware database

Lennart Poettering lennart at poettering.net
Thu Nov 6 10:49:38 PST 2014


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?

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list