Skip to contentSkip to conversation

mmc: meson-gx: work around broken SDIO with certain WiFi chips

PATCH New Heiner Kallweit 2 participants 2 messages Jun 10, 2017 – Jun 12, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mmc: meson-gx: work around broken SDIO with certain WiFi chips

There have been reports about SDIO failing with certain WiFi chips in descriptor chain mode. SD / eMMC are working fine.

So let's fall back to bounce buffer mode for command SD_IO_RW_EXTENDED. This was reported to fix the error.

Fixes 79ed05e329c3 "mmc: meson-gx: add support for descriptor chain mode"
Cc <[email protected]> # 4.12.x

---
v2:
- fixed affected WiFi chip: actually it is AP6255
- added tested-by

---
 drivers/mmc/host/meson-gx-mmc.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/mmc/host/meson-gx-mmc.c +9 -0
index 1842ed34..4cdbe3c0 100644
@@ -210,6 +210,15 @@ static void meson_mmc_get_transfer_mode(struct mmc_host *mmc,
 	int i;
 	bool use_desc_chain_mode = true;
 
+	/*
+	 * Broken SDIO with AP6255-based WiFi on Khadas VIM Pro has been
+	 * reported. For some strange reason this occurs in descriptor
+	 * chain mode only. So let's fall back to bounce buffer mode
+	 * for command SD_IO_RW_EXTENDED.
+	 */
+	if (mrq->cmd->opcode == SD_IO_RW_EXTENDED)
+		return;
+
 	for_each_sg(data->sg, sg, data->sg_len, i)
 		/* check for 8 byte alignment */
 		if (sg->offset & 7) {
Signature · 1 line
2.13.0
Applied
#1 lore raw

PATCH v2 1/1 mmc: meson-gx: work around broken SDIO with certain WiFi chips

Quoted 10 lines · Heiner Kallweit

There have been reports about SDIO failing with certain WiFi chips in descriptor chain mode. SD / eMMC are working fine.

So let's fall back to bounce buffer mode for command SD_IO_RW_EXTENDED. This was reported to fix the error.

Fixes 79ed05e329c3 "mmc: meson-gx: add support for descriptor chain mode"
Cc <[email protected]> # 4.12.x

Thanks, applied for fixes!

Kind regards
Uffe

Quoted 31 lines

---
v2:
- fixed affected WiFi chip: actually it is AP6255
- added tested-by

---
 drivers/mmc/host/meson-gx-mmc.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/mmc/host/meson-gx-mmc.c +9 -1
index 1842ed34..4cdbe3c0 100644
@@ -210,6 +210,15 @@ static void meson_mmc_get_transfer_mode(struct mmc_host *mmc,
        int i;
        bool use_desc_chain_mode = true;
 
+       /*
+        * Broken SDIO with AP6255-based WiFi on Khadas VIM Pro has been
+        * reported. For some strange reason this occurs in descriptor
+        * chain mode only. So let's fall back to bounce buffer mode
+        * for command SD_IO_RW_EXTENDED.
+        */
+       if (mrq->cmd->opcode == SD_IO_RW_EXTENDED)
+               return;
+
        for_each_sg(data->sg, sg, data->sg_len, i)
                /* check for 8 byte alignment */
                if (sg->offset & 7) {
--

2.13.0