[patch] pmu patch

Sjoerd Simons sjoerd at luon.net
Thu Feb 3 11:16:53 PST 2005


On Thu, Feb 03, 2005 at 01:50:14PM -0500, David Zeuthen wrote:
> 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 :-/

Be sure that CONFIG_THERM_ADT746X is either build into the kernel or loaded
when it's a module. On my 1.25ghz 15" (PowerBook5,2) the fan is almost always
off, but the again it almost always runs at it's lowest clockspeed (765mhz)
  
> > > > 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.

Yes, i do.. And it will, not often, but stil..
> 
> > > 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.

True, but i don't like potentially exporting wrong info...
  
> 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.

Then you haven't looked good enough to my implementation. The battery only
needs one file for all the info. Will sent a patch for your code then...
> 
> 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.

Will do.. I'm a little sick currently, so it will take some time :)
  
> > <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?

Yep fair enough. Will do :) Or at least for the pmu parts 

  Sjoerd
-- 
Information is the inverse of entropy.
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list