diff options
author | Vijay Viswanath <vviswana@codeaurora.org> | 2018-04-10 13:01:16 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-06-22 10:55:19 -0700 |
commit | 4753be8c453e48dd9094a9a6865d7a34fbcd0a7b (patch) | |
tree | af874636c19ceb5a193ba945fd8dd2c53ee740d5 /include/linux/mmc/host.h | |
parent | 318dc882ca4897e15d59abe29a45d567821f554a (diff) |
mmc: core: hibernation support for mmc cards
eMMC is the storage device for hibernation image. As such it needs
to be working when hibernation image is created and written. Also for
loading hibernation image after reboot, eMMC driver needs to be
probed and running.
During reboot, kernel comes up and does its own eMMC probe and sets
speed for eMMC. A late system call then checks for hibernation image.
If there is a hibernation image, the current kernel will stay only
temporarily.
Once the hibernation image is found and loaded, the temporary kernel
suspends the eMMC device and then gives control to kernel in
hibernation image.
The hibernation image then restores the eMMC device based on the eMMC
driver state saved just before creating hibernation image.
This gives rise to a possible missmatch between the HW state of eMMC
(Specifically the bus speed) when temporary kernel suspends it and the
state driver restores after hibernation restore.
So a synchornization has been done by making the eMMC run in max speed
during:
1. Just before hibernation image is created (So the driver state
in hibernation image will be for max speed mode).
2. After reboot, just before temporary kernel loads image and
suspends (so the mmc driver in temporary kernel will put the
eMMC in suspend while HW state is in highest speed mode.
This ensures that the HW state, mmc_resume post the hibernation
expects, will be same as the HW state actually present in the eMMC
at the point of hibernation restore.
This also ensures we save the hibernation image in max performance and
we restore the hibernation image also in max performance.
Change-Id: Ia9deceacade97ac89e4f25b40ce074d75bbb2bbc
Signed-off-by: Vijay Viswanath <vviswana@codeaurora.org>
Diffstat (limited to 'include/linux/mmc/host.h')
-rw-r--r-- | include/linux/mmc/host.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index f564303a28f9..89e19dd4b144 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -419,6 +419,7 @@ struct mmc_host { #define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */ u32 caps2; /* More host capabilities */ + u32 cached_caps2; #define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ #define MMC_CAP2_FULL_PWR_CYCLE (1 << 2) /* Can do full power cycle */ |