From: Kevin Hilman <khilman@deeprootsystems.com>
To: "Basak, Partha" <p-basak2@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"Kalliguddi, Hema" <hemahk@ti.com>,
"Raja, Govindraj" <govindraj.raja@ti.com>,
"Varadarajan, Charulatha" <charu@ti.com>,
"Nayak, Rajendra" <rnayak@ti.com>,
"Cousson, Benoit" <b-cousson@ti.com>
Subject: Re: Issues with calling pm_runtime functions in platform_pm_suspend_noirq/IRQ disabled context.
Date: Tue, 03 Aug 2010 10:35:59 -0700 [thread overview]
Message-ID: <874ofbppj4.fsf@deeprootsystems.com> (raw)
In-Reply-To: <B85A65D85D7EB246BE421B3FB0FBB59301E7ED1089@dbde02.ent.ti.com> (Partha Basak's message of "Tue, 3 Aug 2010 19:19:40 +0530")
"Basak, Partha" <p-basak2@ti.com> writes:
> Resending with the corrected mailing list
>
> Hello Kevin,
>
> I want to draw your attention to an issue the following patch
> introduces. http://dev.omapzoom.org/?p=swarch/linux-omap-adv.git;a=commitdiff;h=8041359e18e49bf8a3d41f15894db9e476f3a8fc
[...]
> I believe, it is not correct to call the pm_runtime APIs from
> interrupt locked context since the underlying functions
> __pm_runtime_suspend & __pm_runtime_resume enable interrupts and call
> schedule().
>
> Further, from a s/w layering standpoint, platform-bus is a deeper
> layer than the Runtime layer, which the runtime layer calls into. So
> it may not be correct to have this layer calling into pm_runtime(). It
> should directly call omap_device APIs.
The original version of this patch did directly call the omap_device
APIs. However, Paul didn't like that approach and there were
use-counting problems to handle as well (e.g. if a driver was not (yet)
in use, it would already be disabled, and a suspend would trigger an
omap_device_disable() which would fail since device was already
disabled.)
Paul and I agreed that this current approach would solve the
use-counting problems, but you're correct in that it introduces
new problems as these functions can _possibly_ sleep/schedule.
That being said, have you actually seen problems here? I would like
to see how they are triggered?
By the time the drivers _noirq hooks are called, the PM core has
shutdown all the drivers, prevented any runtime PM transitions and
disabled interrupts, so no pending runtime transitions will be queued
so the sleeping patch of the __pm_runtime_* should never be entered.
> We are facing a similar issue with a few drivers USB, UART & GPIO
> where, we need to enable/disable clocks & restore/save context in the
> CPU-Idle path with interrupts locked.
These are unrelated issues. The above is for the static suspend/resume
case. These are for runtime PM.
> As we are unable to use Runtime APIs, we are using omap_device APIs
> directly with the following modification in the .activate_funcion/
> deactivate_funcion (example UART driver)
[...]
The UART driver is a special case as it is managed from deep inside the
idle path.
> Can you feedback on my observations and comment on the approach taken
> for these drivers?
I cannot comment until I understand why these drivers need to
enable/disable with interrupts off.
In general, any use of the interrupts-off versions of the omap_device
APIs need to be thorougly justified.
Even the UART one will go away when the omap-serial driver is converted
to runtime PM.
Kevin
next prev parent reply other threads:[~2010-08-03 17:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-03 13:49 Issues with calling pm_runtime functions in platform_pm_suspend_noirq/IRQ disabled context Basak, Partha
2010-08-03 17:35 ` Kevin Hilman [this message]
2010-08-04 13:19 ` Basak, Partha
2010-08-04 21:47 ` Kevin Hilman
2010-08-04 22:32 ` Kevin Hilman
2010-08-04 23:20 ` Kevin Hilman
2010-08-06 14:22 ` Basak, Partha
2010-08-06 14:37 ` Basak, Partha
2010-08-04 23:35 ` Kevin Hilman
2010-08-06 14:21 ` Basak, Partha
[not found] <B85A65D85D7EB246BE421B3FB0FBB59301E7ED0FDF@dbde02.ent.ti.com>
[not found] ` <alpine.DEB.2.00.1008061305360.5732@utopia.booyaka.com>
[not found] ` <B85A65D85D7EB246BE421B3FB0FBB59301E800BD63@dbde02.ent.ti.com>
2010-08-09 7:50 ` Paul Walmsley
2010-08-09 10:31 ` Basak, Partha
2010-08-09 15:31 ` Kevin Hilman
2010-08-09 15:39 ` Shilimkar, Santosh
2010-08-09 15:55 ` Kevin Hilman
2010-08-09 16:13 ` Shilimkar, Santosh
2010-08-09 16:25 ` Shilimkar, Santosh
2010-08-10 14:59 ` Basak, Partha
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=874ofbppj4.fsf@deeprootsystems.com \
--to=khilman@deeprootsystems.com \
--cc=b-cousson@ti.com \
--cc=charu@ti.com \
--cc=govindraj.raja@ti.com \
--cc=hemahk@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=p-basak2@ti.com \
--cc=paul@pwsan.com \
--cc=rnayak@ti.com \
/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