lkml.org 
[lkml]   [2007]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [2.6.24-rc1 regression] AC adapter state does not change after resume
Date
On Wednesday 31 October 2007, Alexey Starikovskiy wrote:
> Andrey Borzenkov wrote:
> > On Wednesday 31 October 2007, Alexey Starikovskiy wrote:
> >> Andrey Borzenkov wrote:
> >>> I suspect new ACPI AC adapter code but have to add some printk's to be
> >>> sure.
> >>>
> >>> To reproduce - plug in AC cord, suspend, unplug, resume - kpowersave
> >>> and sysfs still show AC adapter online. Or other way round.
> >>>
> >>> -andrey
> >>
> >> Please check if this patch helps.
> >
> > It does not even compile :)
> >
> > On serious note (after adding forward declaration) - patch half works. It
> > does make "online" return true value (which confirms that underlying ACPI
> > works correctly) but HAL still does not notice it.
> >
> > The problem is, with power_supply interface HAL does not use polling, it
> > relies on CHANGE event. This event is apparently never generated if AC
> > adapter state changes on resume. So the obvious fix is to compare AC
> > state before and after suspend in ->resume function and generate
> > synthetic CHANGE event if something has changed.
> >
> > This will also make superfluous polling redundant.
>
> Ok, here. This one compiles :)
>

For HAL regression:

Tested-by: Andrey Borzenkov <arvidjaar@mail.ru>

But the patch is incomplete. This synthetic event should be the same as if OS
were running; i.e. you should send both other events as well. As is you just
create latent bug to be hit by some netlink consumer sooner or later.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2007-11-01 20:09    [W:0.046 / U:1.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site