From: b29396@freescale.com (Dong Aisheng)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 0/5] mmc: sdhci: a few fixes on timeout and max_discard_to
Date: Tue, 17 Dec 2013 16:16:26 +0800 [thread overview]
Message-ID: <1387268191-19859-1-git-send-email-b29396@freescale.com> (raw)
Patch 1~4 mainly fixes the issue that the max timeout counter for uSDHC is
1 << 28 rather than 1 << 27. 1~2 fix getting the max timeout counter
while 3~4 fix setting the max timeout.
Thus it introduces two new platform hook: get_max_timeout_count and set_timeout
for those platform which have different timeout setting.
This issue is firstly reported here by Ed Sutter:
http://www.spinics.net/lists/linux-mmc/msg23375.html
The root cause is the max_discard_to got from uSDHC is too small, only 677ms,
which cause the max_discard_bytes for eMMC is only 512, then the discard operation
of mkfs.ext3 for an eMMC card is too slow, just like dead.
With above patches, the issue can be fixed.
Patch 5 adds the capability to calcalute the max_discard_to dynamically
for SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK.
Originally the max_discard_to for a high speed sdhc card may be:
mmc1: new high speed SDHC card at address aaaa
mmc1: calculated max. discard sectors 49152 for timeout 1355 ms
After fix:
mmc1: new high speed SDHC card@address aaaa
mmc1: calculated max. discard sectors 712704 for timeout 5422 ms
It also improves the card discard performance a lot due to max_discard_sectors
increase a lot.
There's also discussion about remove max_discard_to limit here:
http://www.spinics.net/lists/linux-mmc/msg23395.html
But it does not help for uSDHC since we can observe data timeout
on a Toshiba SD3.0 cards if we do not disable data timeout interrupt.
ChangeLog:
v1->v2:
1. change .get_max_timeout to .get_max_timeout_count to reuse some code
2. some other minor changes based on Shawn's comment.
3. patch 6 in v1 is dropped since not need anymore after change 1
Dong Aisheng (5):
mmc: sdhci: add platfrom get_max_timeout_count hook
mmc: sdhci-esdhc-imx: fix incorrect max_discard_to for uSDHC
mmc: sdhci: add platform set_timeout hook
mmc: sdhci-esdhc-imx: set the correct max timeout value for uSDHC
mmc: sdhci: calculate max_discard_to dynamically for
SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK
drivers/mmc/host/sdhci-esdhc-imx.c | 20 +++++++++++
drivers/mmc/host/sdhci.c | 66 +++++++++++++++++++++++------------
drivers/mmc/host/sdhci.h | 3 ++
3 files changed, 66 insertions(+), 23 deletions(-)
--
1.7.2.rc3
next reply other threads:[~2013-12-17 8:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-17 8:16 Dong Aisheng [this message]
2013-12-17 8:16 ` [PATCH v2 1/5] mmc: sdhci: add platfrom get_max_timeout_count hook Dong Aisheng
2013-12-17 8:16 ` [PATCH v2 2/5] mmc: sdhci-esdhc-imx: fix incorrect max_discard_to for uSDHC Dong Aisheng
2013-12-17 8:16 ` [PATCH v2 3/5] mmc: sdhci: add platform set_timeout hook Dong Aisheng
2013-12-17 8:16 ` [PATCH v2 4/5] mmc: sdhci-esdhc-imx: set the correct max timeout value for uSDHC Dong Aisheng
2013-12-17 8:16 ` [PATCH v2 5/5] mmc: sdhci: calculate max_discard_to dynamically for SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK Dong Aisheng
2013-12-17 14:30 ` [PATCH v2 0/5] mmc: sdhci: a few fixes on timeout and max_discard_to Shawn Guo
2014-01-13 10:55 ` Dong Aisheng
2014-01-20 2:42 ` Dong Aisheng
2014-01-13 13:01 ` Ulf Hansson
2014-01-15 6:53 ` Dong Aisheng
2014-05-17 14:09 ` Shawn Guo
2014-05-19 2:43 ` Dong Aisheng
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=1387268191-19859-1-git-send-email-b29396@freescale.com \
--to=b29396@freescale.com \
--cc=linux-arm-kernel@lists.infradead.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 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).