WSL2-Linux-Kernel/drivers/mmc/core
Avri Altman 97fce126e2 mmc: block: Issue a cache flush only when it's enabled
In command queueing mode, the cache isn't flushed via the mmc_flush_cache()
function, but instead by issuing a CMDQ_TASK_MGMT (CMD48) with a
FLUSH_CACHE opcode. In this path, we need to check if cache has been
enabled, before deciding to flush the cache, along the lines of what's
being done in mmc_flush_cache().

To fix this problem, let's add a new bus ops callback ->cache_enabled() and
implement it for the mmc bus type. In this way, the mmc block device driver
can call it to know whether cache flushing should be done.

Fixes: 1e8e55b670 (mmc: block: Add CQE support)
Cc: stable@vger.kernel.org
Reported-by: Brendan Peter <bpeter@lytx.com>
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Tested-by: Brendan Peter <bpeter@lytx.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20210425060207.2591-2-avri.altman@wdc.com
Link: https://lore.kernel.org/r/20210425060207.2591-3-avri.altman@wdc.com
[Ulf: Squashed the two patches and made some minor updates]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2021-04-26 11:37:23 +02:00
..
Kconfig
Makefile
block.c mmc: block: Issue a cache flush only when it's enabled 2021-04-26 11:37:23 +02:00
block.h
bus.c
bus.h
card.h
core.c mmc: core: Fix hanging on I/O during system suspend for removable cards 2021-03-30 11:42:03 +02:00
core.h mmc: block: Issue a cache flush only when it's enabled 2021-04-26 11:37:23 +02:00
crypto.c
crypto.h
debugfs.c
host.c mmc: core: Convert mmc_of_parse_voltage() to use device property API 2021-04-23 09:29:49 +02:00
host.h
mmc.c mmc: block: Issue a cache flush only when it's enabled 2021-04-26 11:37:23 +02:00
mmc_ops.c mmc: block: Issue a cache flush only when it's enabled 2021-04-26 11:37:23 +02:00
mmc_ops.h mmc: core: Add a retries parameter to __mmc_switch function 2021-04-15 13:43:17 +02:00
mmc_test.c
pwrseq.c
pwrseq.h
pwrseq_emmc.c
pwrseq_sd8787.c
pwrseq_simple.c
queue.c mmc: core: Remove mq->use_cqe from the struct mmc_queue 2021-03-30 11:42:02 +02:00
queue.h mmc: core: Remove mq->use_cqe from the struct mmc_queue 2021-03-30 11:42:02 +02:00
quirks.h
regulator.c
sd.c mmc: core: Set read only for SD cards with permanent write protect bit 2021-03-30 11:41:59 +02:00
sd.h
sd_ops.c
sd_ops.h
sdio.c mmc: core: Fix hanging on I/O during system suspend for removable cards 2021-03-30 11:42:03 +02:00
sdio_bus.c
sdio_bus.h
sdio_cis.c
sdio_cis.h
sdio_io.c
sdio_irq.c
sdio_ops.c
sdio_ops.h
sdio_uart.c
slot-gpio.c
slot-gpio.h