From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Chris Ball <cjb@laptop.org>
Cc: Andrei Warkentin <andreiw@motorola.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 22:04:00 +0100 [thread overview]
Message-ID: <20110427210400.GA30875@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <m3y62vl954.fsf@pullcord.laptop.org>
On Wed, Apr 27, 2011 at 04:41:27PM -0400, Chris Ball wrote:
> 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.
Yes, exactly - that's what I saw through code inspection. I haven't
actually seen this directly and analysed enough to understand a
particular race, I just looked at the fixes that we are carrying in our
tree and looked at the code sufficiently to determine that the fixes
addressed an issue I could identify.
> We could consider taking Mark's first patch and also adding to the top:
Ben's patch.
> /*
> * 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.
Yes, that's a broader way of writing Dimitris' patch. The issue isn't
concurrent *schedules* - they will just fall out into a single queue for
the task - it's that the tasklet can be rescheduled while it's running.
next prev parent reply other threads:[~2011-04-27 21:03 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
2011-04-27 21:04 ` Mark Brown [this message]
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=20110427210400.GA30875@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=andreiw@motorola.com \
--cc=ben-linux@fluff.org \
--cc=cjb@laptop.org \
--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