mmc-utils: add patch for cache size scaling
authorMichael Heimpold <mhei@heimpold.de>
Tue, 18 Feb 2020 21:29:53 +0000 (22:29 +0100)
committerMichael Heimpold <mhei@heimpold.de>
Tue, 18 Feb 2020 21:30:03 +0000 (22:30 +0100)
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
utils/mmc-utils/Makefile
utils/mmc-utils/patches/0011-mmc-utils-Fix-scaling-of-cache-size.patch [new file with mode: 0644]

index 060381ee4837849c9dd6a76e06a2cfad1e493aa1..43513f5f9de64d6d756c2e3d6ab5f11b69229fd5 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mmc-utils
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git
diff --git a/utils/mmc-utils/patches/0011-mmc-utils-Fix-scaling-of-cache-size.patch b/utils/mmc-utils/patches/0011-mmc-utils-Fix-scaling-of-cache-size.patch
new file mode 100644 (file)
index 0000000..5910564
--- /dev/null
@@ -0,0 +1,34 @@
+From 8121cece25da8dad1dc91393f5285195997c71b1 Mon Sep 17 00:00:00 2001
+From: Patrick Oppenlander <patrick.oppenlander@gmail.com>
+Date: Fri, 14 Feb 2020 09:13:32 +1100
+Subject: [PATCH] mmc-utils: Fix scaling of cache size
+
+JESD84-B51 7.4.30 CACHE_SIZE [252:249] states that "the size is
+indicated as multiple of kilobits". This is also supported by Table 39,
+"e.MMC internal sizes and related Units / Granularities" which lists
+"32Kb (=4KB)" as the cache size granularity for 4KiB native devices.
+
+Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
+Reviewed-by: Avri Altman <avri.altman@wdc.com>
+---
+ mmc_cmds.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mmc_cmds.c b/mmc_cmds.c
+index c006ef2..556c105 100644
+--- a/mmc_cmds.c
++++ b/mmc_cmds.c
+@@ -1427,8 +1427,8 @@ int do_read_extcsd(int nargs, char **argv)
+               printf("Power off notification [POWER_OFF_LONG_TIME: 0x%02x]\n",
+                       ext_csd[247]);
+               printf("Cache Size [CACHE_SIZE] is %d KiB\n",
+-                      ext_csd[249] << 0 | (ext_csd[250] << 8) |
+-                      (ext_csd[251] << 16) | (ext_csd[252] << 24));
++                      (ext_csd[249] << 0 | (ext_csd[250] << 8) |
++                      (ext_csd[251] << 16) | (ext_csd[252] << 24)) / 8);
+       }
+       /* A441: Reserved [501:247]
+-- 
+2.17.1
+