]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mmc: core: Add support for cache ctrl for SD cards
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 11 May 2021 10:13:59 +0000 (12:13 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 24 May 2021 13:12:31 +0000 (15:12 +0200)
commitec6198f88e00dfe325518b3838bfeff12aa2d427
tree0d0fdb713bc038443fc0585340013e593a104b50
parentd39f68b6e041eac4d26397cdb78237b6f6031d1f
mmc: core: Add support for cache ctrl for SD cards

In SD spec v6.x the SD function extension registers for performance
enhancements were introduced. As a part of this an optional internal cache
on the SD card, can be used to improve performance.

The let the SD card use the cache, the host needs to enable it and manage
flushing of the cache, so let's add support for this.

Note that for an SD card supporting the cache it's mandatory for it, to
also support the poweroff notification feature. According to the SD spec,
if the cache has been enabled and a poweroff notification is sent to the
card, that implicitly also means that the card should flush its internal
cache. Therefore, dealing with cache flushing for REQ_OP_FLUSH block
requests is sufficient.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20210511101359.83521-1-ulf.hansson@linaro.org
drivers/mmc/core/mmc_ops.c
drivers/mmc/core/mmc_ops.h
drivers/mmc/core/sd.c
include/linux/mmc/card.h