Merge tag 'mmc-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
[muen/linux.git] / drivers / mmc / core / block.c
index d89e17829527cdb6147a2e8ae1999dac77c3ec9d..a0b9102c4c6e10dca0472328e7f97631863a9208 100644 (file)
@@ -2351,7 +2351,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
        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;
+               md->disk->flags |= GENHD_FL_NO_PART_SCAN
+                                  | GENHD_FL_SUPPRESS_PARTITION_INFO;
 
        /*
         * As discussed on lkml, GENHD_FL_REMOVABLE should:
@@ -2965,9 +2966,11 @@ static void mmc_blk_remove(struct mmc_card *card)
        mmc_blk_remove_debugfs(card, md);
        mmc_blk_remove_parts(card, md);
        pm_runtime_get_sync(&card->dev);
-       mmc_claim_host(card->host);
-       mmc_blk_part_switch(card, md->part_type);
-       mmc_release_host(card->host);
+       if (md->part_curr != md->part_type) {
+               mmc_claim_host(card->host);
+               mmc_blk_part_switch(card, md->part_type);
+               mmc_release_host(card->host);
+       }
        if (card->type != MMC_TYPE_SD_COMBO)
                pm_runtime_disable(&card->dev);
        pm_runtime_put_noidle(&card->dev);