From: Ulf Hansson <ulf.hansson@stericsson.com>
To: Sujit Reddy Thumma <sthumma@codeaurora.org>
Cc: "Dong, Chuanxiao" <chuanxiao.dong@intel.com>,
Viresh KUMAR <viresh.kumar@st.com>, Chris Ball <cjb@laptop.org>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
Shiraz HASHIM <shiraz.hashim@st.com>,
Armando VISCONTI <armando.visconti@st.com>
Subject: Re: [Query] mmc/sdhci: Suspend hangs if card is inserted at suspend.
Date: Thu, 17 Nov 2011 18:46:58 +0100 [thread overview]
Message-ID: <4EC54892.5010906@stericsson.com> (raw)
In-Reply-To: <4EC21EC1.2090607@codeaurora.org>
Sujit Reddy Thumma wrote:
> Hi Ulf,
>
> I see similar issue with your patch in 3.2 "mmc: core: Prevent too long
> response times for suspend".
>
> if (mmc_try_claim_host(host)) {
> <snip>
> /* if CONFIG_MMC_UNSAFE_RESUME is not set, remove() callback would get
> blocked until mmcqd gets mmc_claim_host() causing deadlock here */
> if (host->bus_ops->remove)
> host->bus_ops->remove(host);
> <snip>
You are definitely right. I did not test my patch properly, without
CONFIG_MMC_UNSAFE_RESUME, I realize now.
> } else {
> err = -EBUSY;
> }
> }
>
> Proabably, we can do something like this:
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 5278ffb..0177d4a 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -2309,6 +2309,7 @@ int mmc_suspend_host(struct mmc_host *host)
> * We simply "remove" the card in this
> case.
> * It will be redetected on resume.
> */
> + mmc_do_release_host(host);
> if (host->bus_ops->remove)
> host->bus_ops->remove(host);
> mmc_claim_host(host);
> @@ -2317,8 +2318,9 @@ int mmc_suspend_host(struct mmc_host *host)
> mmc_release_host(host);
> host->pm_flags = 0;
> err = 0;
> + } else {
> + mmc_do_release_host(host);
> }
> - mmc_do_release_host(host);
Your changes looks feasible! Thanks for fixing this issue!
> } else {
> err = -EBUSY;
> }
>
> Please let me know if you agree. I can post a patch for this.
>
BR
Ulf Hansson
prev parent reply other threads:[~2011-11-17 17:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-11 6:45 [Query] mmc/sdhci: Suspend hangs if card is inserted at suspend Viresh Kumar
2011-11-12 3:24 ` Chris Ball
2011-11-15 5:46 ` Viresh Kumar
2011-11-15 6:57 ` Dong, Chuanxiao
2011-11-15 7:10 ` Viresh Kumar
2011-11-15 7:23 ` Dong, Chuanxiao
2011-11-15 8:11 ` Sujit Reddy Thumma
2011-11-17 17:46 ` Ulf Hansson [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=4EC54892.5010906@stericsson.com \
--to=ulf.hansson@stericsson.com \
--cc=armando.visconti@st.com \
--cc=chuanxiao.dong@intel.com \
--cc=cjb@laptop.org \
--cc=linux-mmc@vger.kernel.org \
--cc=shiraz.hashim@st.com \
--cc=sthumma@codeaurora.org \
--cc=viresh.kumar@st.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.