From: Chris Ball <cjb@laptop.org>
To: Andrei Warkentin <andreiw@motorola.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
linux-mmc@vger.kernel.org, Ben Dooks <ben-linux@fluff.org>,
Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Subject: Re: [PATCH 0/2] Race fixes in sdhci
Date: Wed, 27 Apr 2011 16:41:27 -0400 [thread overview]
Message-ID: <m3y62vl954.fsf@pullcord.laptop.org> (raw)
In-Reply-To: <BANLkTint2cr6vFwBGX1RCTYyvrTc0if=yA@mail.gmail.com> (Andrei Warkentin's message of "Wed, 27 Apr 2011 14:33:13 -0500")
Hi,
On Wed, Apr 27 2011, Andrei Warkentin wrote:
> On Wed, Apr 27, 2011 at 8:23 AM, Mark Brown
> <broonie@opensource.wolfsonmicro.com> wrote:
>> I've had this pair of patches sitting in my tree for a while now (I
>> believe they were previously posted) providing stability improvements in
>> sdhci on my systems. Having looked through the code I believe but have
>> not confirmed that the issue is that the timeout is racing with an
>> actual completion of a pending task - both paths will trigger the
>> tasklet, and if you trigger a tasklet while it is running this causes it
>> to be rescheduled. The result will be that the tasklet gets run a
>> second time with no work pending for it.
>>
>> I'm not convinced that these are the best fixes (it feels like we should
>> instead be closing the races down) but I don't really have time to come
>> up with something better myself right now so I'm pushing them out as-is
>> for comment.
>
> So the timeout interrupt occurs after even though the command
> succeeds? Am I interpreting that correctly?
No, I think Mark's saying there's a race of:
* the successful completion interrupt fires, and
* the host timer fires to signify timeout due to *lack* of an interrupt
(via sdhci_timeout_timer()). i.e., the completion interrupt fires
very close to the timeout period.
Both cases call tasklet_schedule(&host->finish_tasklet), and if you
manage to schedule a tasklet while it's already running, it runs again
after it completes -- but during the first run we set host->mrq->cmd to
NULL, so then it oopses on the second run.
We could consider taking Mark's first patch and also adding to the top:
/*
* If we get scheduled twice concurrently, this tasklet will
* be run again afterwards but without any active request.
*/
if (!host->mrq)
return;
.. and pushing to .39 with a stable@ tag.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
next prev parent reply other threads:[~2011-04-27 20:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-27 13:23 [PATCH 0/2] Race fixes in sdhci Mark Brown
2011-04-27 19:33 ` Andrei Warkentin
2011-04-27 20:41 ` Chris Ball [this message]
2011-04-27 21:04 ` Mark Brown
2011-04-27 21:44 ` Chris Ball
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=m3y62vl954.fsf@pullcord.laptop.org \
--to=cjb@laptop.org \
--cc=andreiw@motorola.com \
--cc=ben-linux@fluff.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=dp@opensource.wolfsonmicro.com \
--cc=linux-mmc@vger.kernel.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