Skip to contentSkip to conversation

cmd: mmc: Cache-align extcsd read target

PATCH New Marek Vasut 2 participants 2 messages Jun 20, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd: mmc: Cache-align extcsd read target

The extcsd read target must be cache aligned in case the controller uses DMA to read the extcsd register, make it so.

---
 cmd/mmc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
cmd/mmc.c +3 -1
index 1c252e0502..1529a3e05d 100644
@@ -8,6 +8,7 @@
 #include <blk.h>
 #include <command.h>
 #include <console.h>
+#include <memalign.h>
 #include <mmc.h>
 #include <part.h>
 #include <sparse_format.h>
@@ -56,7 +57,8 @@ static void print_mmcinfo(struct mmc *mmc)
 	if (!IS_SD(mmc) && mmc->version >= MMC_VERSION_4_41) {
 		bool has_enh = (mmc->part_support & ENHNCD_SUPPORT) != 0;
 		bool usr_enh = has_enh && (mmc->part_attr & EXT_CSD_ENH_USR);
-		u8 wp, ext_csd[MMC_MAX_BLOCK_LEN];
+		ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN);
+		u8 wp;
 		int ret;
 
 #if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING)
Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/1 cmd: mmc: Cache-align extcsd read target

Hi

Quoted 6 lines · Marek Vasut

The extcsd read target must be cache aligned in case the controller uses DMA to read the extcsd register, make it so.

---

I think commit message should be start with Fix

Quoted 16 lines
 cmd/mmc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
cmd/mmc.c +1 -0
index 1c252e0502..1529a3e05d 100644
@@ -8,6 +8,7 @@
 #include <blk.h>
 #include <command.h>
 #include <console.h>
+#include <memalign.h>
 #include <mmc.h>
 #include <part.h>
 #include <sparse_format.h>

cmd/mmc.c static void print_mmcinfo(struct mmc *mmc) · line 64

Quoted 9 lines
cmd/mmc.c +2 -1
@@ -56,7 +57,8 @@ static void print_mmcinfo(struct mmc *mmc)
        if (!IS_SD(mmc) && mmc->version >= MMC_VERSION_4_41) {
                bool has_enh = (mmc->part_support & ENHNCD_SUPPORT) != 0;
                bool usr_enh = has_enh && (mmc->part_attr & EXT_CSD_ENH_USR);
-               u8 wp, ext_csd[MMC_MAX_BLOCK_LEN];
+               ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN);
+               u8 wp;
                int ret;
 
 #if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING)
Quoted 3 lines

--
2.27.0

Signature · 4 lines
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |