From: Adrian Hunter <adrian.hunter@intel.com>
To: Shridhar Rasal <shri.rasal@gmail.com>
Cc: linux-mmc <linux-mmc@vger.kernel.org>
Subject: Re: Regarding mmc: queue: let host controllers specify maximum discard timeout
Date: Wed, 08 Feb 2012 09:52:53 +0200 [thread overview]
Message-ID: <4F3229D5.8010906@intel.com> (raw)
In-Reply-To: <CAMKhXhmHvdxsQjm1UzQtqzcPn_mGByW4eJ7XBCBYH63CpPd8pw@mail.gmail.com>
On 07/02/12 18:33, Shridhar Rasal wrote:
> I was verifying/testing *make_ext4fs* command on android with wipe option.
> */_
> _/*
> $] make_ext4fs -w <device-path>
>
> This is taking long time (2 hrs) with Kernel 3.1 code compared to Kernel
> 2.39 (1 min)
>
> With more debugging, found that patch [mmc: queue: let host controllers
> specify maximum discard timeout] is culprit.
>
> In my case following code is executed and [max_discard] always set to
> [card->pref_erase] which is always 4096 and set far less than set in through
> K2.39.
>
> */+ if (mmc_card_mmc(card) && !(card->ext_csd.erase_group_def & 1))
> + return card->pref_erase;/*
>
> *I have verified by, hard coding [max_discard] to [UINT_MAX], it take around
> same time as K2.39.*
>
> 1. Is there any other patch required in controller apart from this.
> 2. Why are we returning [card->pref_erase] above, can we use some other
> bigger/SpecFollowed/preferred value?
> 3. Any other work around?
One possibility is to enable high-capacity erase size. There is a patch I
sent very recently that allows the driver to enable it:
http://permalink.gmane.org/gmane.linux.kernel.mmc/12691
Then you also need to set the capability flag e.g. this is for Medfield eMMC:
http://permalink.gmane.org/gmane.linux.kernel.mmc/12692
If you try that please enable the following debugging message to see what
the calculation produces:
pr_debug("%s: calculated max. discard sectors %u for timeout %u ms\n",
mmc_hostname(host), max_discard, host->max_discard_to);
Another alternative is to add a quirk to sdhci.c to set max_discard_to to
zero e.g. in sdhci_add_host()
mmc->max_discard_to = (1 << 27) / host->timeout_clk;
+ if (host->quirks2 & SDHCI_QUIRK2_NO_MAX_DISCARD_TO)
mmc->max_discard_to;
Then you would need to define the quirk and set it for your host controller.
parent reply other threads:[~2012-02-08 7:52 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <CAMKhXhmHvdxsQjm1UzQtqzcPn_mGByW4eJ7XBCBYH63CpPd8pw@mail.gmail.com>]
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=4F3229D5.8010906@intel.com \
--to=adrian.hunter@intel.com \
--cc=linux-mmc@vger.kernel.org \
--cc=shri.rasal@gmail.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;
as well as URLs for NNTP newsgroup(s).