All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sujit Reddy Thumma <sthumma@codeaurora.org>
To: Pavan Kondeti <pkondeti@codeaurora.org>
Cc: linux-mmc@vger.kernel.org, cjb@laptop.org, linux-arm-msm@vger.kernel.org
Subject: Re: [RFC/PATCH] mmc: core: Kill block requests if card is removed
Date: Thu, 13 Oct 2011 23:23:58 +0530	[thread overview]
Message-ID: <4E9725B6.7010907@codeaurora.org> (raw)
In-Reply-To: <4E956D2E.5070706@codeaurora.org>

On 10/12/2011 4:04 PM, Pavan Kondeti wrote:
> Hello Sujit,
>
> On 10/12/2011 1:06 PM, Sujit Reddy Thumma wrote:
>> Kill block requests when the host knows that the card is
>> removed from the slot and is sure that it can no longer
>> accept any requests.
>>
>> Kill this silently so that the block layer don't output
>> error messages unnecessarily.
>>
>> Signed-off-by: Sujit Reddy Thumma<sthumma@codeaurora.org>
>>
> <snip>
>>
>> diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
>> index 0ea4a06..7cdbc14 100644
>> --- a/include/linux/mmc/card.h
>> +++ b/include/linux/mmc/card.h
>> @@ -196,6 +196,7 @@ struct mmc_card {
>>   #define MMC_STATE_HIGHSPEED_DDR (1<<4)		/* card is in high speed mode */
>>   #define MMC_STATE_ULTRAHIGHSPEED (1<<5)		/* card is in ultra high speed mode */
>>   #define MMC_CARD_SDXC		(1<<6)		/* card is SDXC */
>> +#define MMC_STATE_INSERTED      (1<<7)          /* card present in the slot */
>>   	unsigned int		quirks; 	/* card quirks */
>>   #define MMC_QUIRK_LENIENT_FN0	(1<<0)		/* allow SDIO FN0 writes outside of the VS CCCR range */
>>   #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1)	/* use func->cur_blksize */
>> @@ -344,6 +345,7 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
>>   #define mmc_card_sdio(c)	((c)->type == MMC_TYPE_SDIO)
>>
>>   #define mmc_card_present(c)	((c)->state&  MMC_STATE_PRESENT)
>> +#define mmc_card_inserted(c)     ((c)->state&  MMC_STATE_INSERTED)
>>   #define mmc_card_readonly(c)	((c)->state&  MMC_STATE_READONLY)
>>   #define mmc_card_highspeed(c)	((c)->state&  MMC_STATE_HIGHSPEED)
>>   #define mmc_card_blockaddr(c)	((c)->state&  MMC_STATE_BLOCKADDR)
>> @@ -352,6 +354,7 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
>>   #define mmc_card_ext_capacity(c) ((c)->state&  MMC_CARD_SDXC)
>>
>>   #define mmc_card_set_present(c)	((c)->state |= MMC_STATE_PRESENT)
>> +#define mmc_card_set_inserted(c) ((c)->state |= MMC_STATE_INSERTED)
>>   #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
>>   #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED)
>>   #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
>
> Why do we need another flag to indicate card's presence? can not we use
> MMC_STATE_PRESENT flag? This flag is set in mmc_add_card(). But not
> cleared any where...
>
MMC_STATE_PRESENT signifies the card presence in sysfs i.e. after 
device_add() is called we can be sure that kobject for card device is 
created. This will be cleared automatically when we do 
mmc_release_card() after card removal. But before this when doing 
device_del() is called the FS layer flush/sync the dirty data onto card. 
This creates unnecessary noise in dmesg log when the card is removed 
from the slot (without unmounting).
> Thanks,
> Pavan
>
>
Thanks,
Sujit

      reply	other threads:[~2011-10-13 17:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-12  7:36 [RFC/PATCH] mmc: core: Kill block requests if card is removed Sujit Reddy Thumma
2011-10-12 10:34 ` Pavan Kondeti
2011-10-13 17:53   ` Sujit Reddy Thumma [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=4E9725B6.7010907@codeaurora.org \
    --to=sthumma@codeaurora.org \
    --cc=cjb@laptop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=pkondeti@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.