Skip to contentSkip to conversation

[PATCH v2 0/2]

PATCH Superseded Rex Chen 2 participants 4 messages Jul 4, 2025

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Rex Chen

author
#0 lore raw

v2 cover [PATCH v2 0/2]

[patch 1/2]
Update based on reviewer comments
[patch 2/2]
No change for patch 2

Rex Chen (2):
mmc: core: SPI mode remove cmd7
mmc: mmc_spi: multiple block read remove read crc ack

 drivers/mmc/core/sdio.c    | 6 +++++-
 drivers/mmc/host/mmc_spi.c | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH v2 1/2 mmc: core: SPI mode remove cmd7

SPI mode doesn't support cmd7, so remove it in mmc_sdio_alive() and confirm if sdio is active by checking CCCR register value is available or not.

---
 drivers/mmc/core/sdio.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/mmc/core/sdio.c +5 -1
index 0f753367aec1..83085e76486a 100644
@@ -945,7 +945,11 @@ static void mmc_sdio_remove(struct mmc_host *host)
  */
 static int mmc_sdio_alive(struct mmc_host *host)
 {
-	return mmc_select_card(host->card);
+	if (!mmc_host_is_spi(host))
+		return mmc_select_card(host->card);
+	else
+		return mmc_io_rw_direct(host->card, 0, 0, SDIO_CCCR_CCCR, 0,
+					NULL);
 }
 
 /*
Signature · 1 line
2.25.1
author
#2 lore raw

PATCH v2 2/2 mmc: mmc_spi: multiple block read remove read crc ack

In reply to Rex Chen

Multiple block read doesn't need to read crc ack, so remove it.

---
 drivers/mmc/host/mmc_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/mmc_spi.c +1 -1
index 47443fb5eb33..f42d5f9c48c1 100644
@@ -563,7 +563,7 @@ mmc_spi_setup_data_message(struct mmc_spi_host *host, bool multiple, bool write)
 	 * the next token (next data block, or STOP_TRAN).  We can try to
 	 * minimize I/O ops by using a single read to collect end-of-busy.
 	 */
-	if (multiple || write) {
+	if (write) {
 		t = &host->early_status;
 		memset(t, 0, sizeof(*t));
 		t->len = write ? sizeof(scratch->status) : 1;
Signature · 1 line
2.25.1
#3 lore raw

Re: [PATCH v2 2/2] mmc: mmc_spi: multiple block read remove read crc ack

Quoted 2 lines · Rex Chen

Multiple block read doesn't need to read crc ack, so remove it.

In v1 I asked for more information here, as this is just too vague.

Exactly *why* doesn't multiple block read need CRC ack? Please elaborate on that here, in the commit message.

Kind regards
Uffe

Quoted 22 lines
---
 drivers/mmc/host/mmc_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/mmc_spi.c +1 -2
index 47443fb5eb33..f42d5f9c48c1 100644
@@ -563,7 +563,7 @@ mmc_spi_setup_data_message(struct mmc_spi_host *host, bool multiple, bool write)
         * the next token (next data block, or STOP_TRAN).  We can try to
         * minimize I/O ops by using a single read to collect end-of-busy.
         */
-       if (multiple || write) {
+       if (write) {
                t = &host->early_status;
                memset(t, 0, sizeof(*t));
                t->len = write ? sizeof(scratch->status) : 1;
--

2.25.1