Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: mmc_spi: multiple block read remove read crc ack

For multiple block read, the current implementation, transfer packet
includes cmd53 + cmd53 response + block nums*(1byte token +
block length bytes payload + 2bytes CRC + 1byte transfer), the last
1byte transfer of every block is not needed, so remove it.

Why doesn't multiple block read need CRC ack?
For read operation, host side get the payload and CRC value, then
will only check the CRC value to confirm if the data is correct or
not, but not send CRC ack to card. If the data is correct, save it,
or discard it and retransmit if data is error, so the last 1byte
transfer of every block make no sense.

What's the side effect of this 1byte transfer?
As the SPI is full duplex, if add this redundant 1byte transfer, SDIO
card side take it as the token of next block, then all the next sub
blocks sequence distort.

Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250728082230.1037917-3-rex.chen_1@nxp.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Rex Chen and committed by
Ulf Hansson
fef12d9f fec40f44

+1 -1
+1 -1
drivers/mmc/host/mmc_spi.c
··· 563 563 * the next token (next data block, or STOP_TRAN). We can try to 564 564 * minimize I/O ops by using a single read to collect end-of-busy. 565 565 */ 566 - if (multiple || write) { 566 + if (write) { 567 567 t = &host->early_status; 568 568 memset(t, 0, sizeof(*t)); 569 569 t->len = write ? sizeof(scratch->status) : 1;