From: nm@ti.com (Nishanth Menon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4] ARM: omap: edma: add suspend suspend/resume hooks
Date: Thu, 7 Nov 2013 09:18:59 -0600 [thread overview]
Message-ID: <527BAF63.10308@ti.com> (raw)
In-Reply-To: <527B9673.60400@gmail.com>
On 11/07/2013 07:32 AM, Daniel Mack wrote:
> On 11/07/2013 02:30 PM, Gururaja Hebbar wrote:
>> On Wednesday 06 November 2013 11:06 PM, Joel Fernandes wrote:
>>> Hi Vaibhav,
>>>
>>> On 10/31/2013 05:25 PM, Vaibhav Bedia wrote:
>>>> Hi Daniel,
>>>>
>>>> On Wed, Oct 30, 2013 at 4:21 PM, Daniel Mack <zonque@gmail.com> wrote:
>>>> [...]
>>>>> +
>>>>> +static SIMPLE_DEV_PM_OPS(edma_pm_ops, edma_pm_suspend, edma_pm_resume);
>>>>> +
>>>>> static struct platform_driver edma_driver = {
>>>>> .driver = {
>>>>> .name = "edma",
>>>>> + .pm = &edma_pm_ops,
>>>>> .of_match_table = edma_of_ids,
>>>>> },
>>>>
>>>> A while back we discovered a nasty race condition here that had us move the EDMA
>>>> PM callbacks to the noirq phase. IIRC the MMC driver was resuming
>>>> before the EDMA
>>>> driver had a chance to run and that was leading to a deadlock. I am
>>>> not sure how to force
>>>> this scenario but i do remember spending time debugging this on a
>>>> random codebase.
>>>> Maybe some else has some better ideas on how to force this race condition...
>>>
>>> I think you're talking about the patch at [1] which is not upstream. A quick
>>> question with my limited knowledge of suspend/resume- How can there be pending
>>> I/O operations between suspend/resume cycles?
>>
>> AFAIK, MMC framework started talking to cards immediately after resume.
>> Due to race condition, EDMA resume callback had not yet completed and
>> HSMMC driver had initiated a DMA operation. This resulted in Deadlock.
>
> Hmm. At least in my case, that doesn't happen. And my debug logs also
> show that the calls are in expected order. Which tree were you on when
> you saw this?
Tested this on a vendor V3.12 tag based kernel:
Test patch: http://pastebin.com/AmnktQ7B
test: echo -n "1">/sys/power/pm_print_times; rtcwake -d /dev/rtc0 -m
mem -s 5
with the current patch: http://pastebin.com/RujarRLV
suspend_late and resume_early: http://pastebin.com/RujarRLV
suspend_noirq and resume_noirq: http://pastebin.com/nKfbm7Mj
one needs to be careful of the sequence - donot forget that
omap_device also does stuff in the background to every SoC device in
noirq - sequence is paramount. you would want to ensure edma is saving
after every single dependent device is done with it's stuff and
guarenteed to never request any further transaction, and resume is
done before any of the dependent devices need edma. but edma is also a
peripheral that omap_device and generic runtime pm framework deals
with - so ensure sequences consider that as well.
--
Regards,
Nishanth Menon
next prev parent reply other threads:[~2013-11-07 15:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-30 20:21 [PATCH v4] ARM: omap: edma: add suspend suspend/resume hooks Daniel Mack
2013-10-31 22:25 ` Vaibhav Bedia
2013-11-06 17:36 ` Joel Fernandes
2013-11-07 13:30 ` Gururaja Hebbar
2013-11-07 13:32 ` Daniel Mack
2013-11-07 15:18 ` Nishanth Menon [this message]
2013-11-07 15:36 ` Daniel Mack
2013-11-07 15:48 ` Nishanth Menon
2013-11-07 20:42 ` Vaibhav Bedia
2013-11-15 14:39 ` Nishanth Menon
2013-11-17 22:09 ` Daniel Mack
2013-11-07 20:34 ` Vaibhav Bedia
2013-11-07 15:34 ` Nishanth Menon
2013-11-07 16:27 ` Grygorii Strashko
2013-11-07 20:46 ` Vaibhav Bedia
2013-11-07 16:34 ` Joel Fernandes
2013-11-07 16:49 ` Joel Fernandes
2013-11-07 17:37 ` Daniel Mack
2013-11-07 21:39 ` Joel Fernandes
2013-11-08 4:07 ` Gururaja Hebbar
2013-11-08 7:51 ` Daniel Mack
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=527BAF63.10308@ti.com \
--to=nm@ti.com \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).