From: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@stericsson.com>
Cc: linux-mmc@vger.kernel.org, Chris Ball <cjb@laptop.org>,
Per Forlin <per.forlin@stericsson.com>,
Johan Rudholm <johan.rudholm@stericsson.com>,
Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH 1/2] mmc: core: Prevent I/O as soon as possible at card removal
Date: Fri, 20 Jan 2012 13:55:27 +0200 [thread overview]
Message-ID: <4F19562F.6010907@intel.com> (raw)
In-Reply-To: <1326991191-12472-2-git-send-email-ulf.hansson@stericsson.com>
On 19/01/12 18:39, Ulf Hansson wrote:
> Once the card has been detected to be removed by the
> mmc_detect_card_removed function, schedule a new detect work
> immediately and without a delay to let a rescan remove the
> card device as soon a possible. This will sooner prevent
> further I/O requests.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com>
> ---
> drivers/mmc/core/core.c | 16 ++++++++++++++--
> 1 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index bec0bf2..265dfd8 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -2077,6 +2077,7 @@ int _mmc_detect_card_removed(struct mmc_host *host)
> int mmc_detect_card_removed(struct mmc_host *host)
> {
> struct mmc_card *card = host->card;
> + int ret;
>
> WARN_ON(!host->claimed);
> /*
> @@ -2086,9 +2087,20 @@ int mmc_detect_card_removed(struct mmc_host *host)
> if (card && !host->detect_change && !(host->caps & MMC_CAP_NEEDS_POLL))
> return mmc_card_removed(card);
>
> - host->detect_change = 0;
That line should not be removed. It is not related to your change.
> + ret = mmc_card_removed(card);
Calling mmc_card_removed() is not needed here since
_mmc_detect_card_removed() does it anyway.
> + if (!ret) {
> + ret = _mmc_detect_card_removed(host);
> + if (ret) {
> + /*
> + * Schedule a detect work as soon as possible to let a
> + * rescan handle the card removal.
> + */
> + cancel_delayed_work(&host->detect);
Why cancel the detect work?
> + mmc_detect_change(host, 0);
> + }
> + }
>
> - return _mmc_detect_card_removed(host);
> + return ret;
> }
> EXPORT_SYMBOL(mmc_detect_card_removed);
>
next prev parent reply other threads:[~2012-01-20 11:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-19 16:39 [PATCH 0/2] Improve handling of card removal Ulf Hansson
2012-01-19 16:39 ` [PATCH 1/2] mmc: core: Prevent I/O as soon as possible at " Ulf Hansson
2012-01-20 11:55 ` Adrian Hunter [this message]
2012-01-31 12:54 ` Ulf Hansson
2012-01-31 13:56 ` Adrian Hunter
2012-01-31 15:23 ` Ulf Hansson
2012-02-01 3:02 ` Jaehoon Chung
2012-02-01 9:40 ` Ulf Hansson
2012-02-02 4:00 ` Jaehoon Chung
2012-01-19 16:39 ` [PATCH 2/2] mmc: core: Detect card removal on I/O error Ulf Hansson
2012-01-20 11:55 ` [PATCH 0/2] Improve handling of card removal Adrian Hunter
2012-01-31 13:00 ` Ulf Hansson
2012-01-31 13:56 ` Adrian Hunter
2012-01-31 15:40 ` Ulf Hansson
2012-02-01 9:37 ` Adrian Hunter
2012-02-01 9:44 ` Ulf Hansson
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=4F19562F.6010907@intel.com \
--to=adrian.hunter@intel.com \
--cc=cjb@laptop.org \
--cc=johan.rudholm@stericsson.com \
--cc=lee.jones@linaro.org \
--cc=linux-mmc@vger.kernel.org \
--cc=per.forlin@stericsson.com \
--cc=ulf.hansson@stericsson.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.