lkml.org 
[lkml]   [2012]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 51/57] power: ab8500: Re-alignment with internal developement.
On Thu, Sep 27, 2012 at 07:35:10PM -0700, Anton Vorontsov wrote:
[...]
> abx500_chargalg_check_safety_timer()
> {
> if (di->batt_data.percent < 100) {
> dev_dbg(di->dev, "stopping safety timer\n");
> abx500_chargalg_stop_safety_timer(di);
> return;
> }
>
> dev_dbg(di->dev, "starting safety timer\n");
> abx500_chargalg_start_safety_timer(di);
> }
>
> The thing is, restarting an already pending timer is no-op, unless you
> program the timer before the previously programmed value.

Oh, actually, no. It's no-op if old expires == new expires. :-/

So, yes, you need to check for pending before (re)starting. So, it'll
become

if (pending)
return;
abx500_chargalg_start_safety_timer(di);

(Or better, start_safety_timer() should do that, and it seems that it
already does.)

Thanks,
Anton.


\
 
 \ /
  Last update: 2012-09-28 05:41    [W:0.426 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site