summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci.h
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2021-11-15 10:23:45 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2021-11-17 10:34:06 +0100
commit3d7c194b7c9ad414264935ad4f943a6ce285ebb1 (patch)
tree176d254f1a856af9b1af121d1b6e2d0011fff5a2 /drivers/mmc/host/sdhci.h
parentadab993c25191b839b415781bdc7173a77315240 (diff)
downloadlinux-stable-3d7c194b7c9ad414264935ad4f943a6ce285ebb1.tar.gz
linux-stable-3d7c194b7c9ad414264935ad4f943a6ce285ebb1.tar.bz2
linux-stable-3d7c194b7c9ad414264935ad4f943a6ce285ebb1.zip
mmc: sdhci: Fix ADMA for PAGE_SIZE >= 64KiB
The block layer forces a minimum segment size of PAGE_SIZE, so a segment can be too big for the ADMA table, if PAGE_SIZE >= 64KiB. Fix by writing multiple descriptors, noting that the ADMA table is sized for 4KiB chunks anyway, so it will be big enough. Reported-and-tested-by: Bough Chen <haibo.chen@nxp.com> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20211115082345.802238-1-adrian.hunter@intel.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci.h')
-rw-r--r--drivers/mmc/host/sdhci.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index bb883553d3b4..d7929d725730 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -340,7 +340,8 @@ struct sdhci_adma2_64_desc {
/*
* Maximum segments assuming a 512KiB maximum requisition size and a minimum
- * 4KiB page size.
+ * 4KiB page size. Note this also allows enough for multiple descriptors in
+ * case of PAGE_SIZE >= 64KiB.
*/
#define SDHCI_MAX_SEGS 128
@@ -543,6 +544,7 @@ struct sdhci_host {
unsigned int blocks; /* remaining PIO blocks */
int sg_count; /* Mapped sg entries */
+ int max_adma; /* Max. length in ADMA descriptor */
void *adma_table; /* ADMA descriptor table */
void *align_buffer; /* Bounce buffer */