All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Sujit Reddy Thumma <sthumma@codeaurora.org>
Cc: Chris Ball <cjb@laptop.org>,
	per.lkml@gmail.com, linux-mmc@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH V3] mmc: allow upper layers to determine immediately if a card has been removed
Date: Mon, 28 Nov 2011 16:22:43 +0200	[thread overview]
Message-ID: <4ED39933.4020306@intel.com> (raw)
In-Reply-To: <c879641273f32677cf926c10eeee0220.squirrel@www.codeaurora.org>

On 28/11/11 15:32, Sujit Reddy Thumma wrote:
> 
>> Add a function mmc_detect_card_removed() which upper layers
>> can use to determine immediately if a card has been removed.
>> This function should be called after an I/O request fails so
>> that all queued I/O requests can be errored out immediately
>> instead of waiting for the card device to be removed.
>>
>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
>> ---
>>  drivers/mmc/core/core.c  |   51
>> +++++++++++++++++++++++++++++++++++++++++++--
>>  drivers/mmc/core/core.h  |    3 ++
>>  drivers/mmc/core/mmc.c   |   12 ++++++++++-
>>  drivers/mmc/core/sd.c    |   12 ++++++++++-
>>  drivers/mmc/core/sdio.c  |   11 +++++++++-
>>  include/linux/mmc/card.h |    3 ++
>>  include/linux/mmc/core.h |    2 +
>>  include/linux/mmc/host.h |    1 +
>>  8 files changed, 89 insertions(+), 6 deletions(-)
>>
> ...
> 
>> +int _mmc_detect_card_removed(struct mmc_host *host)
>> +{
>> +	int ret;
>> +
>> +	if (!(host->caps & MMC_CAP_NONREMOVABLE) || !host->bus_ops->alive)
> 
> This should be just "if ((host->caps & MMC_CAP_NONREMOVABLE) || ...)"
> 
> Otherwise, Acked-by: Sujit Reddy Thumma <sthumma@codeaurora.org>

Fixed in V4

> 
>> +		return 0;
>> +
>> +	if (!host->card || mmc_card_removed(host->card))
>> +		return 1;
>> +
>> +	ret = host->bus_ops->alive(host);
>> +	if (ret) {
>> +		mmc_card_set_removed(host->card);
>> +		pr_info("%s: card removed\n", mmc_hostname(host));
>> +	}
>> +
>> +	return ret;
>> +}
>> +
> 
> 

  reply	other threads:[~2011-11-28 14:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-28 13:02 [PATCH V3] mmc: allow upper layers to determine immediately if a card has been removed Adrian Hunter
2011-11-28 13:32 ` Sujit Reddy Thumma
2011-11-28 14:22   ` Adrian Hunter [this message]
2011-11-28 13:37 ` Sujit Reddy Thumma
2011-11-28 14:23   ` Adrian Hunter

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=4ED39933.4020306@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=cjb@laptop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=per.lkml@gmail.com \
    --cc=sthumma@codeaurora.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 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.