[laptop-mode] Wrong hdparm setting applied after resume

Joss Winn joss at josswinn.org
Sun Jul 13 13:13:45 CEST 2008


On Sat, Jul 12, 2008 at 10:16 PM, Bart Samwel <bart at samwel.tk> wrote:
> Hi Joss,
>
> The problem is that pm-utils, the package that handles suspend on
> Ubuntu, doesn't restart laptop-mode-tools after resuming from suspend.
> This means that laptop-mode-tools won't be able to reapply its settings
> at that point.
>
> In debian bug #473055 you find this file:
>
> http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=70;filename=66LTM;att=1;bug=473055
>
> If you put that in /etc/pm/sleep.d under the name "66LTM" (and make it
> executable, I think!), it may work for you.
>


Hi Bart,

Yes, that's fixed it. Thank you.  I've a few other related comments...

1). I've noticed that the default BATT_HD_POWERMGMT=180 in
laptop-mode.conf produces:

Advanced power management level: 128

when hdparm -I /dev/sda is run.

If I change 180 to 254, then that command returns 254.  Do you know
why the number 180 in the config file returns 128?


> In Ubuntu and Debian, there are also some cases in which the
> acpi-support package handles suspend (for instance when you suspend
> using a laptop's suspend button while not logged in to Gnome or KDE --
> but the exact set of cases is a bit diffuse). In Debian, acpi-support
> restarts laptop mode when resuming from suspend. I'm not sure about
> Ubuntu though. If it so happens that you turn out to use acpi-support
> for suspend, you may want to add a script to /etc/acpi/resume.d which
> restarts the laptop-mode service (through the command "invoke-rc.d
> laptop-mode-tools restart").
>

The default for Ubuntu in /etc/default/acpi-support is ENABLE_LAPTOP_MODE=false

Changing that to 'true', seems to work for me without the additional
script you mention above.

2). The other thing I've done because it was mentioned here:
https://wiki.ubuntu.com/PowerManagement

is to remove /usr/lib/pm-utils/power.d/laptop-tools. I don't know if
that workaround still applies if using laptop-mode on Ubuntu. Your
name is at the top of that file, so I guess you can tell me what I
should do with it! :-)

3). I'm still finding that my HDD is spinning down way too frequently.
smartmontools/smart-notifer still reports errors such as: 'Device:
/dev/sda, ATA error count increased from 483 to 485'

I get these often. The laptop is two weeks old.

4). I'm also finding that when I unplug AC power, the laptop freezes
for 2-3 seconds and the CPU spikes. I can't find which process is
doing this.

But syslog is showing:

Jul 13 11:09:56 joss-laptop kernel: [   32.610455] CPU0 attaching NULL
sched-domain.
Jul 13 11:09:56 joss-laptop kernel: [   32.610466] CPU1 attaching NULL
sched-domain.
Jul 13 11:09:56 joss-laptop kernel: [   32.636497] CPU0 attaching sched-domain:
Jul 13 11:09:56 joss-laptop kernel: [   32.636506]  domain 0: span 03
Jul 13 11:09:56 joss-laptop kernel: [   32.636510]   groups: 01 02
Jul 13 11:09:56 joss-laptop kernel: [   32.636517] CPU1 attaching sched-domain:
Jul 13 11:09:56 joss-laptop kernel: [   32.636521]  domain 0: span 03
Jul 13 11:09:56 joss-laptop kernel: [   32.636524]   groups: 02 01
Jul 13 11:09:58 joss-laptop anacron[13247]: Anacron 2.3 started on 2008-07-13
Jul 13 11:09:58 joss-laptop anacron[13247]: Will run job `cron.daily' in 5 min.
Jul 13 11:09:58 joss-laptop anacron[13247]: Jobs will be executed sequentially

the anacron script is not the cause of the freeze as it still freezes
when this script is removed.

I don't suppose this is related to laptop-mode-tools but I thought I'd
mention it as someone might have an idea.

Thanks for your help.

Joss


> Does this help?
>
> Cheers,
> Bart
>
> Joss Winn wrote:
>> Hello,
>>
>> I found the message below in the list archive. It describes exactly
>> what I have found after installing the latest laptop-mode-tools Debian
>> package on Ubuntu Hardy.
>>
>> After wrangling with laptop power management on Ubuntu, I think I've
>> got it worked out, but I can't see a way to correct the hdparm value
>> of 128 after resume from suspend.
>>
>> Any ideas on fixing this would be appreciated.
>>
>> Thank you
>> Joss
>>
>>
>> I've followed the conversation about this on launchpad, but haven't
>> seen it arise on Debian Lenny as of yet, except for
>> my own problems with it that is.
>>
>> The problem being that after resume from suspend an hdparm value of
>> 128 is always applied. Removing then re-inserting
>> the ac power applies the correct settings. Or, if you resume on
>> battery simply plugging in the ac-power will apply the
>> correct settings. So, this is really only a problem when resuming on
>> battery. In all other respects laptop-mode is
>> working quiet well. Thanks much for the iwl powersave stuff!
>>
>> I've attached text files of laptop-mode.conf, hdparm.conf, output of
>> hdparm -I /dev/sda and a text file of all installed
>> apps. The important ones to note - I think - are that I don't have
>> acpi or acpi-tools installed. Everything but this one
>> little bothersome thing is working so well, even without them, that
>> I'm afraid of messing something more important up by
>> installing them.
>>
>> Let me know what other information I can provide. Here's some basic
>> info, and I noticed that I don't have at least one
>> of the recommends, apmd. But this laptop is pretty new, and my
>> understanding was that apm was disabled in the newer
>> kernels by default anyway.
>>
>> Some basic info:
>> ================
>>
>> Debian Lenny/Testing 2.6.24-1-686
>>
>> arthur at archnix:~$ aptitude show laptop-mode-tools
>> Package: laptop-mode-tools
>> State: installed
>> Automatically installed: no
>> Version: 1.42-1
>> Recommends: acpid | apmd | pbbuttonsd | pmud, hdparm, sdparm, hal
>>
>>
>> Best,
>> Arthur
>> _______________________________________________
>> laptop-mode mailing list
>> laptop-mode at mailman.samwel.tk
>> http://mailman.samwel.tk/mailman/listinfo/laptop-mode
>
>


More information about the laptop-mode mailing list