lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 27 Sep 2012 19:45:44 -0700
From:	Anton Vorontsov <anton.vorontsov@...aro.org>
To:	mathieu.poirier@...aro.org
Cc:	linux-kernel@...r.kernel.org, dwmw2@...radead.org
Subject: Re: [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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ