From: Anton Vorontsov <anton.vorontsov@linaro.org>
To: Zoran Markovic <zoran.markovic@linaro.org>
Cc: linux-kernel@vger.kernel.org,
David Woodhouse <dwmw2@infradead.org>,
Arve Hjonnevag <arve@android.com>,
Todd Poynor <toddpoynor@google.com>,
John Stultz <john.stultz@linaro.org>
Subject: Re: [RFC PATCH] pm: prevent suspend until power supply events are processed
Date: Tue, 27 Aug 2013 18:43:29 -0700 [thread overview]
Message-ID: <20130828014328.GG10506@lizard> (raw)
In-Reply-To: <1375475882-3660-1-git-send-email-zoran.markovic@linaro.org>
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@enomsg.org>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: Arve Hjonnevag <arve@android.com>
> Cc: Todd Poynor <toddpoynor@google.com>
> Cc: John Stultz <john.stultz@linaro.org>
> Signed-off-by: Zoran Markovic <zoran.markovic@linaro.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
next prev parent reply other threads:[~2013-08-28 1:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-02 20:38 [RFC PATCH] pm: prevent suspend until power supply events are processed Zoran Markovic
2013-08-22 17:10 ` Zoran Markovic
2013-08-28 1:43 ` Anton Vorontsov [this message]
2014-09-03 4:39 ` Viresh Kumar
2014-09-03 5:05 ` Viresh Kumar
[not found] ` <CA+B8BG5Hf8=ki0JDeRR13Mo7QRFDmsDuEpW8ozepvCp5KsY8ZA@mail.gmail.com>
2014-09-04 4:51 ` Viresh Kumar
2014-09-04 4:53 ` Viresh Kumar
2014-09-04 16:37 ` Tc, Jenny
2014-09-09 21:53 ` Todd Poynor
2014-09-09 21:55 ` Todd Poynor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130828014328.GG10506@lizard \
--to=anton.vorontsov@linaro.org \
--cc=arve@android.com \
--cc=dwmw2@infradead.org \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=toddpoynor@google.com \
--cc=zoran.markovic@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox