From: Christoph Fritz <chf.fritz@googlemail.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Shawn Lin <shawn.lin@rock-chips.com>,
linux-mmc <linux-mmc@vger.kernel.org>
Subject: [PATCH v3] mmc: core: apply NO_CMD23 quirk to some specific cards
Date: Sat, 09 Dec 2017 23:47:55 +0100 [thread overview]
Message-ID: <1512859675.7186.8.camel@googlemail.com> (raw)
In-Reply-To: <1512859465.7186.4.camel@googlemail.com>
To get an usdhc Apacer and some ATP SD cards work reliable, CMD23 needs
to be disabled. This has been tested on i.MX6 (sdhci-esdhc) and rk3288
(dw_mmc-rockchip).
Without this patch on i.MX6 (sdhci-esdhc):
$ dd if=/dev/urandom of=/mnt/test bs=1M count=10 conv=fsync
| <mmc0: starting CMD23 arg 00000400 flags 00000015>
| mmc0: starting CMD25 arg 00a71f00 flags 000000b5
| mmc0: blksz 512 blocks 1024 flags 00000100 tsac 3000 ms nsac 0
| mmc0: CMD12 arg 00000000 flags 0000049d
| sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
| mmc0: Timeout waiting for hardware interrupt.
Without this patch on rk3288 (dw_mmc-rockchip):
| mmc1: Card stuck in programming state! mmcblk1 card_busy_detect
| dwmmc_rockchip ff0c0000.dwmmc: Busy; trying anyway
| mmc_host mmc1: Bus speed (slot 0) = 400000Hz (slot req 400000Hz,
| actual 400000HZ div = 0)
| mmc1: card never left busy state
| mmc1: tried to reset card, got error -110
| blk_update_request: I/O error, dev mmcblk1, sector 139778
| Buffer I/O error on dev mmcblk1p1, logical block 131586, lost async
| page write
Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
---
Changes since v1:
- s/CMD32/CMD23
Changes since v2:
- add an Apacer card
- adapt comment
drivers/mmc/core/card.h | 2 ++
drivers/mmc/core/quirks.h | 8 ++++++++
2 files changed, 10 insertions(+)
diff --git a/drivers/mmc/core/card.h b/drivers/mmc/core/card.h
index f06cd91..79a5b98 100644
--- a/drivers/mmc/core/card.h
+++ b/drivers/mmc/core/card.h
@@ -75,9 +75,11 @@ struct mmc_fixup {
#define EXT_CSD_REV_ANY (-1u)
#define CID_MANFID_SANDISK 0x2
+#define CID_MANFID_ATP 0x9
#define CID_MANFID_TOSHIBA 0x11
#define CID_MANFID_MICRON 0x13
#define CID_MANFID_SAMSUNG 0x15
+#define CID_MANFID_APACER 0x27
#define CID_MANFID_KINGSTON 0x70
#define CID_MANFID_HYNIX 0x90
diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h
index 9107f0b..d4ff9d8 100644
--- a/drivers/mmc/core/quirks.h
+++ b/drivers/mmc/core/quirks.h
@@ -53,6 +53,14 @@ static const struct mmc_fixup mmc_blk_fixups[] = {
MMC_QUIRK_BLK_NO_CMD23),
/*
+ * Some SD cards lockup while using CMD23 multiblock transfers.
+ */
+ MMC_FIXUP("AF SD", CID_MANFID_ATP, CID_OEMID_ANY, add_quirk_sd,
+ MMC_QUIRK_BLK_NO_CMD23),
+ MMC_FIXUP("APUSD", CID_MANFID_APACER, 0x5048, add_quirk_sd,
+ MMC_QUIRK_BLK_NO_CMD23),
+
+ /*
* Some MMC cards need longer data read timeout than indicated in CSD.
*/
MMC_FIXUP(CID_NAME_ANY, CID_MANFID_MICRON, 0x200, add_quirk_mmc,
--
2.1.4
next prev parent reply other threads:[~2017-12-09 22:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-09 23:12 [PATCH] mmc: block: apply NO_CMD32 quirk to an ATP card Christoph Fritz
2017-09-09 23:44 ` [PATCH v2] mmc: core: apply NO_CMD23 " Christoph Fritz
2017-09-22 8:42 ` Ulf Hansson
2017-09-22 9:26 ` Shawn Lin
2017-09-23 19:51 ` Christoph Fritz
2017-09-25 3:33 ` Shawn Lin
2017-09-25 11:23 ` Christoph Fritz
2017-09-26 0:56 ` Shawn Lin
2017-12-04 13:38 ` Christoph Fritz
2017-12-09 22:44 ` Christoph Fritz
2017-12-09 22:47 ` Christoph Fritz [this message]
2017-12-11 13:00 ` [PATCH v3] mmc: core: apply NO_CMD23 quirk to some specific cards Ulf Hansson
2017-12-11 20:19 ` Christoph Fritz
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=1512859675.7186.8.camel@googlemail.com \
--to=chf.fritz@googlemail.com \
--cc=linux-mmc@vger.kernel.org \
--cc=shawn.lin@rock-chips.com \
--cc=ulf.hansson@linaro.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.