From: Ulf Hansson <ulf.hansson@linaro.org>
To: Lina Iyer <lina.iyer@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Kevin Hilman <khilman@kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Axel Haslam <ahaslam+renesas@baylibre.com>,
Krzysztof Kozlowski <k.kozlowski.k@gmail.com>,
Russell King <linux@arm.linux.org.uk>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH V3] PM / Domains: Remove intermediate states from the power off sequence
Date: Thu, 18 Jun 2015 09:02:10 +0200 [thread overview]
Message-ID: <CAPDyKFp4Bh2C5PNNJS3bUqDLADS6MKTfH8UCzbm3c-ofbVOWow@mail.gmail.com> (raw)
In-Reply-To: <20150617200346.GC23268@linaro.org>
[...]
>> @@ -671,32 +475,29 @@ static int pm_genpd_runtime_suspend(struct device
>> *dev)
>> if (IS_ERR(genpd))
>> return -EINVAL;
>>
>> + /*
>> + * We can't allow to power off the PM domain if it holds an
>> irq_safe
>> + * device. That's because we use mutexes to protect data while
>> power
>> + * off and on the PM domain, thus we can't execute in atomic
>> context.
>> + */
>> + if (dev->power.irq_safe)
>> + return -EBUSY;
>> +
>
> This check will prevent the device from being saved/stopped. This should
> be allowed. Its the mutex_lock(&genpd->lock) below that would be a
> problem, if the device is IRQ safe. But that happens only after the
> device is stopped.
Yes, as we discussed around your patch in [1].
Earlier we could invoke the ->stop|start() callbacks for an IRQ
safe device. This version of $subject patch prevents that.
I am working on a v4, that brings back that functionality, but we can
actually do more. As from the changes in $subject patch, we don't need
to hold the mutex while invoking the runtime PM callbacks for a
device. This enables us to invoke them for IRQ safe devices, yet
another positive side effect.
>
> I am inclined to think that the existing check below is the correct
> place to check. Let me know if I am missing something.
>
You are correct.
Still, as I intend to invoke the runtime PM callbacks for IRQ safe
devices some minor change is also needed in pm_genpd_runtime_resume().
[...]
Kind regards
Uffe
[1]
http://www.spinics.net/lists/arm-kernel/msg425162.html
prev parent reply other threads:[~2015-06-18 7:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-11 11:05 [PATCH V3] PM / Domains: Remove intermediate states from the power off sequence Ulf Hansson
2015-06-15 23:49 ` Kevin Hilman
2015-06-15 23:56 ` Lina Iyer
2015-06-16 15:56 ` Kevin Hilman
2015-06-18 10:14 ` Ulf Hansson
2015-06-24 17:57 ` Kevin Hilman
2015-06-25 8:09 ` Ulf Hansson
2015-06-23 10:57 ` Geert Uytterhoeven
2015-06-25 12:24 ` Geert Uytterhoeven
2015-06-17 20:03 ` Lina Iyer
2015-06-18 7:02 ` Ulf Hansson [this message]
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=CAPDyKFp4Bh2C5PNNJS3bUqDLADS6MKTfH8UCzbm3c-ofbVOWow@mail.gmail.com \
--to=ulf.hansson@linaro.org \
--cc=ahaslam+renesas@baylibre.com \
--cc=dmitry.torokhov@gmail.com \
--cc=geert+renesas@glider.be \
--cc=k.kozlowski.k@gmail.com \
--cc=khilman@kernel.org \
--cc=len.brown@intel.com \
--cc=lina.iyer@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
/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;
as well as URLs for NNTP newsgroup(s).