Mega ACPI and PMU cleanup
David Zeuthen
david at fubar.dk
Sun Feb 26 13:18:51 PST 2006
Hi,
I wanted to get 0.5.7 out before looking at this...
On Mon, 2006-02-20 at 19:11 +0000, Richard Hughes wrote:
> Okay, mega patch enclosed to make acpi and pmu do things a bit
> differently, more efficiently.
>
> Lots of times we are calling the functions:
>
> hal_util_grep_{bool|int|string}_elem_from_file
>
> (which saves the value in the hal key)
>
> and then reading this key, then checking stuff, then writing it back.
>
> Okay, this is probably cached, but less efficient than keeping the
> variable around and re-using it.
>
> The bigger problem, is whilst checking stuff, if we end up changing the
> values (to fix broken bioses that get the numbers wrong) then the key
> will go from one value, to another, then to another. This upsets g-p-m
> (and I suspect also battstat-applet) greatly. One such fix is included.
Hmm.. we do have
device_property_atomic_update_begin();
device_property_atomic_update_end();
to fix this and we do use them... Are we doing something wrong? Care to
post a log where we change values right after each other?
> It's more logical to read back the values into a variable, do the
> checking, and then save to a key. There's lots of places in the code
> that make this very easy to do, and also lets us do more clever error
> handling if the key does not exist, rather than not just setting the
> key.
>
> Typos and logic errors may have crept in, but I've done my best to check
> these. I've also tidied up trailing spaces, and got rid of some code
> duplication in util.c.
>
> It's a big diff, but if you use something like meld, you'll see there
> are not that many changes, and hardly any regarding program logic.
>
> Comments please.
I haven't looked much into the details of the patch since yourself and
others are probably more familiar with this code. Go ahead and commit it
we'll figure out soon enough if something is wrong.
Thanks,
David
More information about the hal
mailing list