[PATCH v2 7/8] mmc: block: Enable partition-table scanning for boot partitions

From: Dmitry Osipenko
Date: Thu Mar 05 2020 - 21:13:14 EST


Some NVIDIA Tegra devices store partition table on a boot eMMC partition,
and thus, boot partitions need to be scanned. This patch enables scanning
of the boot MMC partitions. Please note that boot partitions will be
scanned-only, i.e. the scanned boot partitions will be kept hidden.

Signed-off-by: Dmitry Osipenko <digetx@xxxxxxxxx>
---
drivers/mmc/core/block.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 2c2bec114fd6..b834c830e19a 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -2410,9 +2410,12 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
md->parent = parent;
set_disk_ro(md->disk, md->read_only || default_ro);
md->disk->flags = GENHD_FL_EXT_DEVT;
+
if (area_type & (MMC_BLK_DATA_AREA_RPMB | MMC_BLK_DATA_AREA_BOOT))
- md->disk->flags |= GENHD_FL_NO_PART_SCAN
- | GENHD_FL_SUPPRESS_PARTITION_INFO;
+ md->disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
+
+ if (area_type & MMC_BLK_DATA_AREA_RPMB)
+ md->disk->flags |= GENHD_FL_NO_PART_SCAN;

/*
* As discussed on lkml, GENHD_FL_REMOVABLE should:
--
2.25.1