aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/0587-mmc-sdhci-add-adma_table_cnt-member-to-struct-sdhci_.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/0587-mmc-sdhci-add-adma_table_cnt-member-to-struct-sdhci_.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/0587-mmc-sdhci-add-adma_table_cnt-member-to-struct-sdhci_.patch71
1 files changed, 71 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/0587-mmc-sdhci-add-adma_table_cnt-member-to-struct-sdhci_.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/0587-mmc-sdhci-add-adma_table_cnt-member-to-struct-sdhci_.patch
new file mode 100644
index 00000000..e4a509a2
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/0587-mmc-sdhci-add-adma_table_cnt-member-to-struct-sdhci_.patch
@@ -0,0 +1,71 @@
+From 7849151093d23a2f63900bd315247c6487b532dd Mon Sep 17 00:00:00 2001
+From: Sudheesh Mavila <sudheesh.mavila@amd.com>
+Date: Thu, 24 Jan 2019 11:41:47 +0530
+Subject: [PATCH 0587/2940] mmc: sdhci: add adma_table_cnt member to struct
+ sdhci_host
+
+Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
+---
+ drivers/mmc/host/sdhci.c | 17 +++++++++--------
+ drivers/mmc/host/sdhci.h | 3 +++
+ 2 files changed, 12 insertions(+), 8 deletions(-)
+ mode change 100644 => 100755 drivers/mmc/host/sdhci.h
+
+diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
+index 97e4efaf9f87..9f6398ae9181 100644
+--- a/drivers/mmc/host/sdhci.c
++++ b/drivers/mmc/host/sdhci.c
+@@ -3324,6 +3324,13 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,
+
+ host->sdma_boundary = SDHCI_DEFAULT_BOUNDARY_ARG;
+
++ /*
++ * The DMA table descriptor count is calculated as the maximum
++ * number of segments times 2, to allow for an alignment
++ * descriptor for each segment, plus 1 for a nop end descriptor.
++ */
++ host->adma_table_cnt = SDHCI_MAX_SEGS * 2 + 1;
++
+ return host;
+ }
+
+@@ -3569,18 +3576,12 @@ int sdhci_setup_host(struct sdhci_host *host)
+ dma_addr_t dma;
+ void *buf;
+
+- /*
+- * The DMA descriptor table size is calculated as the maximum
+- * number of segments times 2, to allow for an alignment
+- * descriptor for each segment, plus 1 for a nop end descriptor,
+- * all multipled by the descriptor size.
+- */
+ if (host->flags & SDHCI_USE_64_BIT_DMA) {
+- host->adma_table_sz = (SDHCI_MAX_SEGS * 2 + 1) *
++ host->adma_table_sz = host->adma_table_cnt *
+ SDHCI_ADMA2_64_DESC_SZ;
+ host->desc_sz = SDHCI_ADMA2_64_DESC_SZ;
+ } else {
+- host->adma_table_sz = (SDHCI_MAX_SEGS * 2 + 1) *
++ host->adma_table_sz = host->adma_table_cnt *
+ SDHCI_ADMA2_32_DESC_SZ;
+ host->desc_sz = SDHCI_ADMA2_32_DESC_SZ;
+ }
+diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
+old mode 100644
+new mode 100755
+index 732d82f17d91..6968c0717a93
+--- a/drivers/mmc/host/sdhci.h
++++ b/drivers/mmc/host/sdhci.h
+@@ -566,6 +566,9 @@ struct sdhci_host {
+
+ u64 data_timeout;
+
++ /* Host ADMA table count */
++ u32 adma_table_cnt;
++
+ unsigned long private[0] ____cacheline_aligned;
+ };
+
+--
+2.17.1
+