mmc: block: Fix issue with block device operation mmc_blk_ioctl

The MMC block device ioctl path is not updated with necessary
mmc_rpm_hold and mmc_rpm_release APIs due to which the device
is either not getting resumed if it is already runtime suspended
or it is getting into runtime suspend state while the ioctl
request is still in progress. This issue would be observed only
if MMC_CAP2_CORE_RUNTIME_PM capability is defined. Fix it by
calling mmc_rpm_hold before start of ioctl and mmc_rpm_release
at the end of ioctl.

Change-Id: If1ccebcde4f797722989963a7c69ce1cfb6484fd
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index b075435..5b7f08f 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -646,6 +646,7 @@
 
 	mrq.cmd = &cmd;
 
+	mmc_rpm_hold(card->host, &card->dev);
 	mmc_claim_host(card->host);
 
 	err = mmc_blk_part_switch(card, md);
@@ -695,6 +696,7 @@
 
 cmd_rel_host:
 	mmc_release_host(card->host);
+	mmc_rpm_release(card->host, &card->dev);
 
 cmd_done:
 	mmc_blk_put(md);
@@ -775,6 +777,7 @@
 		goto idata_free;
 	}
 
+	mmc_rpm_hold(card->host, &card->dev);
 	mmc_claim_host(card->host);
 
 	err = mmc_blk_part_switch(card, md);
@@ -871,6 +874,7 @@
 
 cmd_rel_host:
 	mmc_release_host(card->host);
+	mmc_rpm_release(card->host, &card->dev);
 
 idata_free:
 	for (i = 0; i < MMC_IOC_MAX_RPMB_CMD; i++) {