linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Warkentin <andreiw@motorola.com>
To: frank.hofmann@tomtom.com, linux-mmc@vger.kernel.org
Subject: Re: [PATCH] MMC: fix mmc_pm_notify bus_ops->remove deadlock.
Date: Mon, 4 Apr 2011 11:08:25 -0500	[thread overview]
Message-ID: <BANLkTikMmf-d1BVG6ZMUV-L-nB05ytQVYw@mail.gmail.com> (raw)
In-Reply-To: <BANLkTikmNZnFOfEaCm4RdNs5p6b-L5rY8w@mail.gmail.com>

On Mon, Apr 4, 2011 at 10:47 AM, Andrei Warkentin <andreiw@motorola.com> wrote:
> On Mon, Apr 4, 2011 at 10:26 AM, Frank Hofmann <frank.hofmann@tomtom.com> wrote:
>>
>>
>> On Mon, 4 Apr 2011, Andrei Warkentin wrote:
>>
>>> On Mon, Apr 4, 2011 at 8:27 AM, Andrei Warkentin <andreiw@motorola.com>
>>> wrote:
>>>>
>>>> On Mon, Apr 4, 2011 at 9:00 AM, Andrei Warkentin <andreiw@motorola.com>
>>>> wrote:
>>>>>
>>>>> This resolves the deadlock issue with suspend. There is no
>>>>> need to claim host before the remove op.
>>>>>
>>>>> Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
>>>>
>>>> Frank,
>>>>
>>>> Can you try this out? I think this fixes it.
>>>>
>>>> Ohad,
>>>>
>>>> I think this means we can take
>>>> 1c8cf9c997a4a6b36e907c7ede5f048aeaab1644 out (mmc: sdio: fix SDIO
>>>> suspend/resume regression). What do you think?
>>>>
>>>> Thanks,
>>>> A
>>>>
>>>
>>> Ohad, nevermind.
>>>
>>> I think there is a bigger issue here at stake for removeable cards. If
>>> you have a mounted file system,
>>> the usage count for mmc_blk usage will never drop enough to remove the
>>> device!
>>>
>>> I think the block.c for removal needs to change somewhat. Removed MDs
>>> need to clear devidx and be put on an "orphan list" from where
>>> they will remove themselves if usage count drops to zero. On re-probe,
>>> the "orphan list" needs to be scanned for allocated devidx, and if it
>>> is found, then that MD should be reused.
>>> I'll see if I can put something together.
>>>
>>> A
>>>
>>
>> Just to clarify, do you want a test result without
>> 1c8cf9c997a4a6b36e907c7ede5f048aeaab1644 or better wait for now ?
>>
>> FrankH.
>>
>
> I don't think there is a point. For example, for mounted media, if the
> userspace unmounts the filesystem on suspend, then the device will
> successfully remove.
> For root fs on a removeable card, it will never tear down the mmcblk
> MD, because mmc_blk_release will never be called enough times (fs is
> mounted).
>
> Is the card actually an external card for you or an eMMC? You could
> just get away with unsafe resume, I suppose...
>
> A
>

I don't think there is a good fix. Suspend with a removable card is
equivalent to pulling out the card with a file system mounted after
manually mounting the fs,
with the exception that all outstanding I/O is flushed. You could play
games with caching removed MDs if the use count doesn't drop to zero
and reusing them, but
the best you can achieve is a successful resume after a suspend as
long as the hardware configuration didn't change (no other cards
added).

A

  reply	other threads:[~2011-04-04 16:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30 10:52 deadlock between mmc_pm_notify() and mmcqd Frank Hofmann
2011-04-04 12:54 ` Andrei Warkentin
2011-04-04 13:11   ` Frank Hofmann
2011-04-04 14:00     ` [PATCH] MMC: fix mmc_pm_notify bus_ops->remove deadlock Andrei Warkentin
2011-04-04 13:27       ` Andrei Warkentin
2011-04-04 15:01         ` Ohad Ben-Cohen
2011-04-04 15:10           ` Andrei Warkentin
2011-04-04 15:01         ` Andrei Warkentin
     [not found]           ` <alpine.DEB.2.00.1104041624310.690@localhost6.localdomain6>
2011-04-04 15:47             ` Andrei Warkentin
2011-04-04 16:08               ` Andrei Warkentin [this message]
2011-04-04 20:31                 ` [RFC] MMC: Request for comments attempt at dealing with removeable suspend/resume Andrei Warkentin
2011-05-17 10:15                   ` Dong, Chuanxiao
2011-05-18  8:06                     ` Andrei Warkentin

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=BANLkTikMmf-d1BVG6ZMUV-L-nB05ytQVYw@mail.gmail.com \
    --to=andreiw@motorola.com \
    --cc=frank.hofmann@tomtom.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;
as well as URLs for NNTP newsgroup(s).