On Mon, 21 Jul 2014 10:49:56 +0530 Ritesh Raj Sarraf <r...@researchut.com>
wrote:
> On 07/21/2014 08:31 AM, Adam Lee wrote:
> >> > No. You should not be disabling runtime pm management. By doing that
you tell
> >> > the kernel to do no power savings. Which is not good.
> > Exactly, I don't want the power savings when AC is plugged in.
> >
> > Autosuspend is so broken that linux kernel disables it by default,
> > not enabling it by laptop-mode-tools when AC is plugged in might be a
> > good idea(only a suggestion).
>
>
> Blacklisting will work. Try it. It works for me.

Yes, blacklisting does work, but the problem is that the default behavior
of the system has changed in a very undesirable way, and it's very hard for
a non-expert to figure out how to fix it. On every optical mouse I've came
across (several different manufacturers) the autosuspend works by turning
off the mouse LED. After that the mouse stays suspended until a button is
pressed, which wakes up the mouse and turns the LED back on but it goes to
sleep again after the prescribed autosuspend delay. This is a new an
unexpected behavior, and although I consider myself an experienced expert
user, it took a long time to find the source of the problem as I also run
into the no longer used usb-autosuspend module that is still there giving
you a false hope that you can fix it there. A possible solution would be to
allow a blacklist based on the product name (found in the product file in
/sys/bus/usb/devices/*/product) and look for something like *Optical*Mouse*
in the product name to blacklist. It would be nice if optical mice would
behave as before, since that's what most people would prefer and expect.

There are also issues in the
/usr/share/laptop-mode-tools/modules/runtime-pm script, it assumes that the
$runtime_device variable does not contain spaces. Unfortunately, on my
system there is a file called

/sys/bus/platform/devices/Fixed MDIO bus.0

Note the spaces in the name. The shell by default does word splitting on
variables. All uses of $runtime_device should be quoted (and not only  that
but also any function that takes such a device as an argument should handle
names with spaces), list the blacklisted, whichlisted, listed_by_id,
listed_by_type etc. functions, they all use unquoted variables at the
moment. Unfortunately to support names with spaces, the script probably
needs some more invasive changes. The current module gives me error
messages like:

sirius /home/hzoli # service laptop-mode reload
/usr/sbin/laptop_mode: 108: [: /sys/bus/platform/devices/Fixed: unexpected
operator
/usr/sbin/laptop_mode: 115: [: /sys/bus/platform/devices/Fixed: unexpected
operator
/usr/sbin/laptop_mode: 118: [: /sys/bus/platform/devices/Fixed: unexpected
operator
[ ok ] Laptop mode disabled, not active.
/usr/sbin/laptop_mode: 108: [: /sys/bus/platform/devices/Fixed: unexpected
operator
/usr/sbin/laptop_mode: 115: [: /sys/bus/platform/devices/Fixed: unexpected
operator
/usr/sbin/laptop_mode: 118: [: /sys/bus/platform/devices/Fixed: unexpected
operator
[ ok ] Laptop mode enabled, not active.

These come from line 108 of /usr/share/laptop-mode-tools/modules/runtime-pm
not /usr/sbin/laptop_mode

-Zoltan

Reply via email to