From: Santosh <santosh.shilimkar@ti.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Govindraj.R" <govindraj.raja@ti.com>,
Partha Basak <p-basak2@ti.com>, Tero Kristo <t-kristo@ti.com>,
Felipe Balbi <balbi@ti.com>,
Keshava Munegowda <keshava_mgowda@ti.com>,
linux-pm@lists.linux-foundation.org, linux-omap@vger.kernel.org
Subject: Re: [linux-pm] Issue: Runtime API usage in wake-up device irq_handler during wakeup from system-wide-suspend.
Date: Sat, 27 Aug 2011 12:00:02 +0530 [thread overview]
Message-ID: <4E588EEA.7090004@ti.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1108261429340.2275-100000@netrider.rowland.org>
Alen,
On Saturday 27 August 2011 12:06 AM, Alan Stern wrote:
> On Fri, 26 Aug 2011, Govindraj.R wrote:
>
>> Hello,
>>
>> During system_wide_suspend pm runtime is disabled.
>> I.e. __pm_runtime_disable is called from __device_suspend.
>> Now, if a wakeup interrupt is triggered and the wakeup device irq handler
>> is called even before device_resume and pm_runtime_enable happens,
>> the device irq_handler proceeds to enable clock with runtime API to
>> handle wakeup event.
>>
>> Wouldn't this result in system wide abort since the pm_runtime is not enabled
>> yet from dpm_resume?
>> As we end up accessing regs after doing runtime get_sync.
>>
>> Looks like this scenario is not handled currently.
>> Or Am I missing something here?
>
> I don't have the complete picture, but it seems that the IRQ handler
> needs to check the return code from pm_runtime_get_sync(). If the call
> fails then the handler shouldn't try to access the device registers.
>
> In the case of a genuine wakeup event, the event should be handled
> later on as part of the resume or resume_noirq processing.
>
> However, this does raise a potential problem. What happens if the
> clocks are needed in order to turn off the IRQ source? Runtime PM
> won't allow the clocks to be enabled until after interrupts have been
> enabled, and by then it will be too late -- the source will have caused
> an interrupt storm.
>
I might be wrong here, but after discussion with Govindraj on this
issue, it seems there is a flaw in the way OMAP chain handler
handling the child interrupts.
On OMAP, we have special interrupt wakeup source at PRCM level and
many devices can trigger wakeup from low power via this common
interrupt source. The common interrupt source upon wakeup from low
power state, decodes the source of interrupt and based on that
source, calls the respective device ISR directly.
The issue I see here is, the ISR on _a_ device (UART in this case)
is happening even before UART resume and DPM resume has been completed.
If this is the case, then it is surely asking for trouble. Because not
just clocks, but even driver state machine is already in suspend state
when the ISR is called.
Regards
Santosh
next prev parent reply other threads:[~2011-08-27 6:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-26 13:01 Issue: Runtime API usage in wake-up device irq_handler during wakeup from system-wide-suspend Govindraj.R
2011-08-26 18:36 ` [linux-pm] " Alan Stern
2011-08-27 6:30 ` Santosh [this message]
2011-08-27 14:01 ` Alan Stern
2011-08-27 14:49 ` Santosh
2011-08-27 19:42 ` Alan Stern
2011-09-07 15:48 ` Tero Kristo
2011-09-07 17:59 ` Kevin Hilman
2011-09-08 4:58 ` Tero Kristo
2011-09-08 13:51 ` Kevin Hilman
2011-08-26 20:52 ` Rafael J. Wysocki
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=4E588EEA.7090004@ti.com \
--to=santosh.shilimkar@ti.com \
--cc=balbi@ti.com \
--cc=govindraj.raja@ti.com \
--cc=keshava_mgowda@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=p-basak2@ti.com \
--cc=stern@rowland.harvard.edu \
--cc=t-kristo@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