Skip to content
Commit 97fce126 authored by Avri Altman's avatar Avri Altman Committed by Ulf Hansson
Browse files

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: 1e8e55b6

 (mmc: block: Add CQE support)
Cc: stable@vger.kernel.org
Reported-by: default avatarBrendan Peter <bpeter@lytx.com>
Signed-off-by: default avatarAvri Altman <avri.altman@wdc.com>
Tested-by: default avatarBrendan Peter <bpeter@lytx.com>
Acked-by: default avatarAdrian 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: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 2f156712
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment