From: "Yauhen Kharuzhy" <jekhor@gmail.com>
To: "Pierre Ossman" <drzeus-mmc@drzeus.cx>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MMC: Fix race condition in resume/card detect code
Date: Sun, 19 Oct 2008 19:32:55 +0300 [thread overview]
Message-ID: <83f9afec0810190932v7ca18936m1c1fdba9323159a4@mail.gmail.com> (raw)
In-Reply-To: <20081019160422.GA16377@jeknote.loshitsa1.net>
2008/10/19 Yauhen Kharuzhy <jekhor@gmail.com>:
> On Sat, Oct 18, 2008 at 07:11:47PM +0200, Pierre Ossman wrote:
>> On Thu, 16 Oct 2008 19:09:36 +0300
>> Yauhen Kharuzhy <jekhor@gmail.com> wrote:
>>
>> > When device wakes up by card change interrupt and MMC_UNSAFE_RESUME is
>> > enabled then race condition between mmc_rescan() and
>> > mmc_resume()/mmc_sd_resume() appeared.
>> >
>> > Resume functions can sleep into mmc_remove_card() and at this time
>> > mmc_rescan() can be called by delayed work handler. Double-free of
>> > kobject or double-remove of host->card can be result of this.
>> >
>> > This patch adds an mutex which deny simultaneous executing of
>> > mmc_sd_resume()/mmc_resume() and mmc_rescan() functions. Probably, it is
>> > not right way.
>> >
>> > Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
>> > ---
>>
>> Can't we just ask the PM layer if this device is currently resuming,
>> and if so ignore card notifications from the driver?
>
> What about another idea: mmc_sd_resume() checks if host->detect is
> scheduled and if true then it don't try to reinitialize card.
> host->detect can be scheduled at this moment only in one case: if device has been waked up by
> card change interrupt.
Hmm... But it will cause a race condition if SD card change interrupt
will be raised during resume process.
--
Best regards,
Yauhen Kharuzhy jekhor_(at)_gmail.com
A: No
Q: Should I quote below my post?
next prev parent reply other threads:[~2008-10-19 16:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-16 16:09 Yauhen Kharuzhy
2008-10-18 17:11 ` Pierre Ossman
2008-10-19 16:04 ` Yauhen Kharuzhy
2008-10-19 16:32 ` Yauhen Kharuzhy [this message]
2008-10-20 19:41 ` Yauhen Kharuzhy
2008-10-20 20:47 ` J.A. Magallón
2008-10-26 11:47 ` Pierre Ossman
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=83f9afec0810190932v7ca18936m1c1fdba9323159a4@mail.gmail.com \
--to=jekhor@gmail.com \
--cc=drzeus-mmc@drzeus.cx \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®