Skip to content

Commit 2714b19

Browse files
P33Mpopcornmix
authored andcommitted
mmc: sd: halt CQHCI before issuing a cache flush command
SD cards perform cache flushes by a CMD49 extension register write - which needs to be started from the SDHCI command/argument registers and not a CQHCI slot. Host access to SD/CQ registers should be exclusive to one or the other, so issue a halt before doing the command. Signed-off-by: Jonathan Bell <[email protected]>
1 parent 9625b18 commit 2714b19

File tree

1 file changed

+8
-0
lines changed
  • drivers/mmc/core

1 file changed

+8
-0
lines changed

drivers/mmc/core/sd.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,14 @@ static int sd_flush_cache(struct mmc_host *host)
12641264

12651265
reg_buf = card->ext_reg_buf;
12661266

1267+
/*
1268+
* Flushing requires sending CMD49 (adtc), which can't be done as a DCMD
1269+
* and conflicts with CQHCI - temporarily turn CQE off to use the SDHCI
1270+
* command/argument registers.
1271+
*/
1272+
if (host->cqe_on)
1273+
host->cqe_ops->cqe_off(host);
1274+
12671275
/*
12681276
* Set Flush Cache at bit 0 in the performance enhancement register at
12691277
* 261 bytes offset.

0 commit comments

Comments
 (0)