[systemd-devel] udev rule not applied after resume from sleep

Kay Sievers kay at vrfy.org
Tue Dec 10 16:09:22 PST 2013


On Wed, Dec 11, 2013 at 12:05 AM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Tue, 10.12.13 23:59, Jason A. Donenfeld (Jason at zx2c4.com) wrote:
>
>> Hi folks,
>>
>> I hope this is the right list to ask about udev. I've got a lenovo usb
>> keyboard with a trackpoint on it -- essentially an external replica of
>> the classic thinkpad keyboard. The trackpoint by default isn't very
>> sensitive, so I've got a udev rule that applies the settings I like:
>>
>> zx2c4 at thinkpad ~ $ cat /etc/udev/rules.d/90-trackpoint.rules
>> ACTION=="add", SUBSYSTEM=="hid", DRIVER=="lenovo_tpkbd", \
>>         ATTR{sensitivity}="230", \
>>         ATTR{press_to_select}="1"
>>
>> This works well and gets the job done. However, if my computer is in
>> sleep mode, and then I plug in the keyboard, and then I resume my
>> computer, the rule doesn't get applied. Likewise, if the rule is in
>> effect, but then I put my computer to sleep, on resume, the rule isn't
>> applied.
>>
>> Is this by design, and I need to add something to my rule to also
>> active on resumption from sleep, or am I hitting some kind of bug?
>
> This really sounds like something the lenovo_tpkbd driver should handle
> internally: if the hw does not save its settings across suspend/resume
> cycles, then the driver should do that instead...
>
> udev rules are only executed when hw appears/disappears or "changes",
> but not on resume/suspend... sorry...
>
> My recommendation would be to file a bug against the driver in kernel
> bugzilla...

As outline in the earlier mail, please check with udevadm monitor
before filing bugs if the device is really not going away in the kernel.
I would expect that for usb input devices. If it does, the kernel
cannot restore anything, and we need to check what udev does.

Kay


More information about the systemd-devel mailing list