mmc: block: Enable runtime pm for mmc blkdevice
Once the mmc blkdevice is being probed, runtime pm will be enabled. By using runtime autosuspend, the power save operations can be done when request inactivity occurs for a certain time. Right now the selected timeout value is set to 3 s. Obviously this value will likely need to be configurable somehow since it needs to be trimmed depending on the power save algorithm. For SD-combo cards, we are still leaving the enablement of runtime PM to the SDIO init sequence since it depends on the capabilities of the SDIO func driver. Moreover, when the blk device is being suspended, we make sure the device will be runtime resumed. The reason for doing this is that we want the host suspend sequence to be unaware of any runtime power save operations done for the card in this phase. Thus it can just handle the suspend as the card is fully powered from a runtime perspective. Finally, this patch prepares to make it possible to move BKOPS handling into the runtime callbacks for the mmc bus_ops. Thus IDLE BKOPS can be accomplished. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
This commit is contained in:
@@ -258,13 +258,13 @@ static int mmc_dbg_card_status_get(void *data, u64 *val)
|
||||
u32 status;
|
||||
int ret;
|
||||
|
||||
mmc_claim_host(card->host);
|
||||
mmc_get_card(card);
|
||||
|
||||
ret = mmc_send_status(data, &status);
|
||||
if (!ret)
|
||||
*val = status;
|
||||
|
||||
mmc_release_host(card->host);
|
||||
mmc_put_card(card);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -291,9 +291,9 @@ static int mmc_ext_csd_open(struct inode *inode, struct file *filp)
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
mmc_claim_host(card->host);
|
||||
mmc_get_card(card);
|
||||
err = mmc_send_ext_csd(card, ext_csd);
|
||||
mmc_release_host(card->host);
|
||||
mmc_put_card(card);
|
||||
if (err)
|
||||
goto out_free;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user