mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-16 06:48:13 +07:00
04566831a7
This patch modifies the MMC core code to optionally call the set_ios() operation on the driver with the clock frequency set to 0 (gate) after a grace period of at least 8 MCLK cycles, then restore it (ungate) before any new request. This gives the driver the option to shut down the MCI clock to the MMC/SD card when the clock frequency is 0, i.e. the core has stated that the MCI clock does not need to be generated. It is inspired by existing clock gating code found in the OMAP and Atmel drivers and brings this up to the host abstraction. Gating is performed before and after any MMC request. This patchset implements this for the MMCI/PL180 MMC/SD host controller, but it should be simple to switch OMAP/Atmel over to using this instead. mmc_set_{gated,ungated}() add variable protection to the state holders for the clock gating code. This is particularly important when ordinary .set_ios() calls would race with the .set_ios() call resulting from a delayed gate operation. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Reviewed-by: Chris Ball <cjb@laptop.org> Tested-by: Chris Ball <cjb@laptop.org> Signed-off-by: Chris Ball <cjb@laptop.org>
30 lines
1015 B
Plaintext
30 lines
1015 B
Plaintext
#
|
|
# MMC core configuration
|
|
#
|
|
|
|
config MMC_UNSAFE_RESUME
|
|
bool "Assume MMC/SD cards are non-removable (DANGEROUS)"
|
|
help
|
|
If you say Y here, the MMC layer will assume that all cards
|
|
stayed in their respective slots during the suspend. The
|
|
normal behaviour is to remove them at suspend and
|
|
redetecting them at resume. Breaking this assumption will
|
|
in most cases result in data corruption.
|
|
|
|
This option is usually just for embedded systems which use
|
|
a MMC/SD card for rootfs. Most people should say N here.
|
|
|
|
This option sets a default which can be overridden by the
|
|
module parameter "removable=0" or "removable=1".
|
|
|
|
config MMC_CLKGATE
|
|
bool "MMC host clock gating (EXPERIMENTAL)"
|
|
depends on EXPERIMENTAL
|
|
help
|
|
This will attempt to aggressively gate the clock to the MMC card.
|
|
This is done to save power due to gating off the logic and bus
|
|
noise when the MMC card is not in use. Your host driver has to
|
|
support handling this in order for it to be of any use.
|
|
|
|
If unsure, say N.
|