pmaports/device/linux-samsung-i927/0005-mmc-core-Add-a-quirk-for-NVIDIA-Tegra-EMMC.patch
Sergey Larin 5ccbcf999d
samsung-i927: update kernel to 5.2.1, more updates (!452)
- OTG support
- Charger
- WiFi 5GHz
- RTC bug "fixed" (always-on interrupt - made device overheat!)
- Kernel version bumped to 5.2.1
- Memory timings
- New WM8994 codec board driver (fixes suspend/resume)
- Camera's regulator supported now (saves power at least!)
- Updated panel driver (still not in mainline, idk why)
- MHL support in kernel (fixes boot times and screen, currently disabled in X,
  not tested)
- Other minor kernel chagnes

[ci:skip-build]: already built successfully in CI
2019-07-17 00:15:26 +02:00

38 lines
1.4 KiB
Diff

From 5a3ef17a66c43fc996d77d90f68f25af221c9b40 Mon Sep 17 00:00:00 2001
From: Dmitry Osipenko <digetx@gmail.com>
Date: Tue, 6 Oct 2015 19:27:48 +0300
Subject: [PATCH] mmc: core: Add a quirk for NVIDIA Tegra EMMC
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
(cherry picked from commit ab6cd574c16380931529501c367ae50a3ee96b3e)
Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
---
drivers/mmc/core/mmc.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index c8804895595f..d4c5592aa22b 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -405,8 +405,17 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)
ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
/* Cards with density > 2GiB are sector addressed */
- if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512)
+ if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512) {
+ if (card->host->caps & MMC_CAP_NONREMOVABLE) {
+ /*
+ * Size is in 256K chunks, i.e. 512 sectors each.
+ * This algorithm is defined and used by NVIDIA,
+ * according to eMMC 4.41, size is in 128K chunks.
+ */
+ card->ext_csd.sectors -= ext_csd[EXT_CSD_BOOT_MULT] * 512;
+ }
mmc_card_set_blockaddr(card);
+ }
}
card->ext_csd.strobe_support = ext_csd[EXT_CSD_STROBE_SUPPORT];
--
2.22.0