From: Olof Johansson <olof@lixom.net>
To: Chris Ball <cjb@laptop.org>
Cc: Wolfram Sang <w.sang@pengutronix.de>,
linux-mmc@vger.kernel.org, linux-tegra@vger.kernel.org,
Olof Johansson <olof@lixom.net>
Subject: [PATCH 1/2] sdhci: add quirk for max len ADMA descriptors
Date: Thu, 23 Dec 2010 03:27:54 -0600 [thread overview]
Message-ID: <1293096475-19634-2-git-send-email-olof@lixom.net> (raw)
In-Reply-To: <1293096475-19634-1-git-send-email-olof@lixom.net>
Some controllers misparse segment length 0 as being 0, not 65536. Add
a quirk to deal with it.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
drivers/mmc/host/sdhci.c | 10 +++++++---
include/linux/mmc/sdhci.h | 2 ++
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index a25db426..c0094c1 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1928,10 +1928,14 @@ int sdhci_add_host(struct sdhci_host *host)
* of bytes. When doing hardware scatter/gather, each entry cannot
* be larger than 64 KiB though.
*/
- if (host->flags & SDHCI_USE_ADMA)
- mmc->max_seg_size = 65536;
- else
+ if (host->flags & SDHCI_USE_ADMA) {
+ if (host->quirks & SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC)
+ mmc->max_seg_size = 65535;
+ else
+ mmc->max_seg_size = 65536;
+ } else {
mmc->max_seg_size = mmc->max_req_size;
+ }
/*
* Maximum block size. This varies from controller to controller and
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 1fdc673..dfb2106 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -83,6 +83,8 @@ struct sdhci_host {
#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28)
/* Controller doesn't have HISPD bit field in HI-SPEED SD card */
#define SDHCI_QUIRK_NO_HISPD_BIT (1<<29)
+/* Controller treats ADMA descriptors with length 0000h incorrectly */
+#define SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC (1<<30)
int irq; /* Device IRQ */
void __iomem *ioaddr; /* Mapped address */
--
1.7.3.GIT
next prev parent reply other threads:[~2010-12-23 9:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-23 9:27 [PATCH 0/3 v3] Add SDHCI driver for Tegra Olof Johansson
2010-12-23 9:27 ` Olof Johansson [this message]
2010-12-23 11:26 ` [PATCH 1/2] sdhci: add quirk for max len ADMA descriptors Wolfram Sang
2010-12-23 18:26 ` Olof Johansson
2011-01-04 14:14 ` Wolfram Sang
2010-12-23 9:33 ` [PATCH 2/2] mmc: add sdhci-tegra driver for Tegra SoCs Olof Johansson
2010-12-23 11:23 ` Wolfram Sang
2010-12-23 18:27 ` Olof Johansson
2010-12-31 4:11 ` Chris Ball
2011-01-02 0:28 ` Olof Johansson
2011-01-04 14:24 ` Wolfram Sang
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=1293096475-19634-2-git-send-email-olof@lixom.net \
--to=olof@lixom.net \
--cc=cjb@laptop.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=w.sang@pengutronix.de \
/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