[Pm-utils] Quirk for running hdparm after resume from suspend and hibernate

Pedro R eusou15 at yahoo.com
Thu Jan 29 07:36:55 PST 2009


Sorry for coming into the discussion like this, but i joined this mailing list because of exactly the same problem.

This hdparm issue is distro specific, i'm sure hdparm upstream will not want to handle it, because honestly they don't have to. Fixing it in pm-utils is pernicious, because this issue only affects laptops, but i still think it's the best way. 

This is a major issue going on since 2005 and nobody seems to want to get their hands dirty fixing it. It would be great to include this in pm-utils, since the collateral overhead for desktop computers is not that big either.

Anyway the hook should be executed on resume (but not on hibernate / standby) and on power change: battery -> ac adaptor and ac adaptor -> battery, because when on battery the setting should be -B 128 (because of physical shocks - for an explanation refer to the load_cycle_count issue on google) and on ac power it should be -B 254. To do this, the hook should not rely on other than the kernel itself. Like this:

	if cat /proc/acpi/ac_adapter/ACAD/state | grep 'off-line' ; then
	  hdparm -B 128 $dev
	else
	  hdparm -B 254 $dev

If Pacho Ramos won't mind sending me his hook, i can complete it this way. 

Pedro Ribeiro


--- On Thu, 29/1/09, Dan Nicholson <dbn.lists at gmail.com> wrote:

> From: Dan Nicholson <dbn.lists at gmail.com>
> Subject: Re: [Pm-utils] Quirk for running hdparm after resume from suspend and hibernate
> To: pacho at condmat1.ciencias.uniovi.es
> Cc: pm-utils at lists.freedesktop.org
> Date: Thursday, 29 January, 2009, 6:20 PM
> On Wed, Jan 28, 2009 at 11:42 PM, Pacho Ramos
> <pacho at condmat1.ciencias.uniovi.es> wrote:
> > El dom, 18-01-2009 a las 21:30 +0100, Pacho Ramos
> escribió:
> >> hi!
> >>
> >> On my laptop (a Dell XPS 1330) I need to run
> hdparm service at boot for
> >> setting -B 256 (you can check for
> "Load_Cycle_Count problem at google
> >> and you will see that a lot of laptops are
> affected).
> >>
> >> Until now, I were re-reunning hdparm after resume
> with a local script,
> >> but now, I read about pm-utils and I created a
> quirk that seems to work
> >> ok. I already know that pm-utils upstream prefers
> apps to install quirks
> >> instead of making pm-utils do it itself, but I
> want to ask for reviewing
> >> before sending this to hdparm upstream
> >>
> >> The quirk is attached
> >>
> >> Thanks a lot
> >> _______________________________________________
> >> Pm-utils mailing list
> >> Pm-utils at lists.freedesktop.org
> >>
> http://lists.freedesktop.org/mailman/listinfo/pm-utils
> >
> > Does it look ok then for sending to hdparm upstream?
> >
> > Thanks :-)
> 
> Meant to get back sooner on this, sorry.
> 
> One issue is that it makes the assumption that the distro
> has a hdparm
> initscript. None of the distros I've used have had one,
> so I don't
> think this is universal. What system are you using? It
> might end up
> being something that's distro specific. Here's what
> fedora does:
> 
> http://cvs.fedoraproject.org/viewvc/rpms/pm-utils/devel/pm-utils-99hd-apm-restore?view=markup
> 
> It may also be that hdparm upstream won't be that
> receptive, but
> there's only one way to find out. :)
> 
> --
> Dan
> _______________________________________________
> Pm-utils mailing list
> Pm-utils at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pm-utils


      


More information about the Pm-utils mailing list