mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Steven Liu <lingjiujianke@gmail.com>
Cc: linux-mmc@vger.kernel.org, liuqi@thundersoft.com,
	qinjian@thundersoft.com, linux-kernel@vger.kernel.org,
	Greg KH <greg@kroah.com>
Subject: Re: [PATCH] mmc: fix deadlock from mmc core when suspend the device
Date: Sat, 14 Jan 2012 09:19:44 -0500	[thread overview]
Message-ID: <m2r4z28iyn.fsf@bob.laptop.org> (raw)
In-Reply-To: <CADxeRw=_Qx+dcZHJZnq1tAStvsuCWrsARgyxP=aKC0WfLWHZLw@mail.gmail.com> (Steven Liu's message of "Sat, 14 Jan 2012 13:05:08 +0800")

Hi,

On Sat, Jan 14 2012, Steven Liu wrote:
> Hi Chris Ball & Greg KH,
>
> This patch can fix the mmc deadlock when suspen the mmc devices.
>
> when mmc_pm_notify to do the host->bus_ops->remove, there is deadlock,
> because it was locked at mmc_claim_host, so it modify the mmc_claim_host
> after the host->bus_ops->remove.
> the problem can reproduce at lots of the emmc/sd devices when create
> multi partitions,and I have tested this modify at lots of the platform.
>
> Can this patch fixed?
>
> Signed-off-by: LiuQi <liuqi@thundersoft.com>
> Signed-off-by: Jack Qin <qinjian@thundersoft.com>
>
> ---
>  drivers/mmc/core/core.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 950b97d..e68a0e8 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -2431,11 +2431,10 @@ int mmc_pm_notify(struct notifier_block *notify_block,
>                 if (!host->bus_ops || host->bus_ops->suspend)
>                         break;
>
> -               mmc_claim_host(host);
> -
>                 if (host->bus_ops->remove)
>                         host->bus_ops->remove(host);
>
> +               mmc_claim_host(host);
>                 mmc_detach_bus(host);
>                 mmc_power_off(host);
>                 mmc_release_host(host);

Another version of this patch has already gone to Linus, for 3.3-rc1.

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

      reply	other threads:[~2012-01-14 14:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-14  5:05 Steven Liu
2012-01-14 14:19 ` Chris Ball [this message]

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=m2r4z28iyn.fsf@bob.laptop.org \
    --to=cjb@laptop.org \
    --cc=greg@kroah.com \
    --cc=lingjiujianke@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=liuqi@thundersoft.com \
    --cc=qinjian@thundersoft.com \
    /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

Powered by JetHome