mmc: core: expose RPMB partition only for CMD23 capable hosts
authorBalaji T K <balajitk@ti.com>
Fri, 25 Jan 2013 11:30:30 +0000 (17:00 +0530)
committerChris Ball <cjb@laptop.org>
Sun, 24 Feb 2013 19:37:05 +0000 (14:37 -0500)
SET_BLOCK_COUNT CMD23 is needed for all access to RPMB partition.  If
block count is not set by CMD23, all subsequent read/write commands fail
as per eMMC specification. So, If the host does not support CMD23, do not
expose RPMB partition.

Accessing RPMB partition can cause hang / huge delay for hosts which do
not support CMD23.

Signed-off-by: Balaji T K <balajitk@ti.com>
Reported-and-Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/core/mmc.c

index dc17d4097f9a3b3d2839d51099c75f01cca0dbab..0d7a9795a6da79ede565c6a552693a514b8c1fd8 100644 (file)
@@ -496,7 +496,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
                 * RPMB regions are defined in multiples of 128K.
                 */
                card->ext_csd.raw_rpmb_size_mult = ext_csd[EXT_CSD_RPMB_MULT];
-               if (ext_csd[EXT_CSD_RPMB_MULT]) {
+               if (ext_csd[EXT_CSD_RPMB_MULT] && mmc_host_cmd23(card->host)) {
                        mmc_part_add(card, ext_csd[EXT_CSD_RPMB_MULT] << 17,
                                EXT_CSD_PART_CONFIG_ACC_RPMB,
                                "rpmb", 0, false,