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:	Tue, 27 Aug 2013 18:43:29 -0700
From:	Anton Vorontsov <anton.vorontsov@...aro.org>
To:	Zoran Markovic <zoran.markovic@...aro.org>
Cc:	linux-kernel@...r.kernel.org,
	David Woodhouse <dwmw2@...radead.org>,
	Arve Hjonnevag <arve@...roid.com>,
	Todd Poynor <toddpoynor@...gle.com>,
	John Stultz <john.stultz@...aro.org>
Subject: Re: [RFC PATCH] pm: prevent suspend until power supply events are
 processed

On Fri, Aug 02, 2013 at 01:38:02PM -0700, Zoran Markovic wrote:
> This patch, originally authored by Arve Hjonnevag and Todd Poynor,
> prevents the system from entering suspend mode until the power
> supply plug, unplug, or any other change of state event is fully
> processed. This guarantees that the screen lights up and displays
> the battery charging state. The implementation uses the power
> supply wakeup_source object.
> 
> Cc: Anton Vorontsov <anton@...msg.org>
> Cc: David Woodhouse <dwmw2@...radead.org>
> Cc: Arve Hjonnevag <arve@...roid.com>
> Cc: Todd Poynor <toddpoynor@...gle.com>
> Cc: John Stultz <john.stultz@...aro.org>
> Signed-off-by: Zoran Markovic <zoran.markovic@...aro.org>
> ---
...
> +		kobject_uevent(&psy->dev->kobj, KOBJ_CHANGE);
> +		spin_lock_irqsave(&psy->changed_lock, flags);
> +	}
> +	/* dependent power supplies (e.g. battery) may have changed

Multi-line comments style issue...

> +	 * state as a result of this event, so poll again and hold
> +	 * the wakeup_source until all events are processed.
> +	 */
> +	if (!psy->changed)
> +		pm_relax(psy->dev);
...
> diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
> index 804b906..253d412 100644
> --- a/include/linux/power_supply.h
> +++ b/include/linux/power_supply.h
> @@ -194,6 +194,8 @@ struct power_supply {
>  	/* private */
>  	struct device *dev;
>  	struct work_struct changed_work;
> +	spinlock_t changed_lock;

#include <linux/spinlock.h> is needed.

I fixed it up and applied the patch, thanks a lot!

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