[patch] pmu patch

David Zeuthen david at fubar.dk
Thu Feb 3 10:50:14 PST 2005


On Thu, 2005-02-03 at 19:04 +0100, Sjoerd Simons wrote:
> If it's an albook and you don't have that info, i'm not surprised it it runs
> hot.. The module that exports that information is also responsible for turning
> your fans on.. (Simple check, the albook has all it ports on the sides, while a
> tibook has some at the back behind a small lid)

All ports on the side. The fan is running all the time. I feel so
screwed :-/

> > > The kernel doesn't care. The problem is that if you read it twice, there is
> > > no guarantee that the information you get the first time is from the same
> > > state as the second time. So it could well be that the first time you read,
> > > your on battery power with a discharging battery and the second time your
> > > on AC with a
> > > charging battery.

Within a few milliseconds you expect this to change? It really
looks like a non-issue to me.

> > But since we're going to poll that shouldn't be a problem.
> 
> I don't see how this solved the issue.

We're polling on regular intervals so over time it will get correct.

Note that we're screwed anyway since updating the battery status 
requires looking at *two* files and not only (look at battery_refresh()
in hald/linux2/pmu.c) because PMU is stoopid and doesn't export
whether the battery is discharging.

Anyway, feel free to send a patch against hald/linux2/util.[ch] and that
provides the utility needed if you want to improve this. I suppose
(because everything is single threaded) that you could make a

 hal_util_grep_file_use_existing_file (gboolean use_existing_file);

to make hal_util_grep_file not reload the file if it's the same. You
would then enclose the existing code around those.

> <snip stuff about providing potentially inaccurate information> 

Send patches for computing the time remaining and I'll integrate
them. The properties exported will be documented as optional
and if they're present they may be imprecise. 

Also, I don't want to spend time fixing bugs on those (since I
maintain that it's something you want in a higher-level app and I
expect people to complain about it), so if you want to do this, 
you're going to need to commit to maintaining that piece of 
code. Is that fair enough?

Cheers,
David


_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list