Skip to contentSkip to conversation

tmio_mmc: Allow 2 byte requests in 4-bit mode

PATCH In review Yusuke Goda 4 participants 7 messages Jul 20, 2010 – Aug 20, 2010

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

PATCH 1/1 tmio_mmc: Allow 2 byte requests in 4-bit mode

Adjust the tmio_mmc block size check to accept 2-byte requests in 4-bit mode. Tested with the SDHI hardware block included in sh7724.

---
 drivers/mmc/host/tmio_mmc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/tmio_mmc.c +2 -2
index ee7d0a5..f49d945 100644
@@ -660,8 +660,8 @@ static int tmio_mmc_start_data(struct tmio_mmc_host *host,
 	pr_debug("setup data transfer: blocksize %08x  nr_blocks %d\n",
 		 data->blksz, data->blocks);
 
-	/* Hardware cannot perform 1 and 2 byte requests in 4 bit mode */
-	if (data->blksz < 4 && host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) {
+	/* Hardware cannot perform 1 byte requests in 4 bit mode */
+	if (data->blksz < 2 && host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) {
 		pr_err("%s: %d byte block unsupported in 4 bit mode\n",
 		       mmc_hostname(host->mmc), data->blksz);
 		return -EINVAL;
Signature · 1 line
1.7.0
Acked-by on v1 1/1
#1 lore raw

2010/7/20 Yusuke Goda <[email protected]>:

Quoted 4 lines

Adjust the tmio_mmc block size check to accept 2-byte requests in 4-bit mode. Tested with the SDHI hardware block included in sh7724.

With this patch applied I can use SDIO cards in polling mode with the tmio-mmc driver. Tested with the SDHI hardware block on sh7372 using the b43 driver and BCM4318 hardware and the unfortunately out-of-tree AR6002 "android" driver.

#2 lore raw

This change needs to be modified to test what hardware is present. this wont work on my hardware TTBOMK.

Signature · 3 lines
Ian Molton
Linux, Automotive, and other hacking:
http://www.mnementh.co.uk/
Quoted 13 lines · Magnus Damm

2010/7/20 Yusuke Goda <[email protected]>:

Quoted 4 lines

Adjust the tmio_mmc block size check to accept 2-byte requests in 4-bit mode. Tested with the SDHI hardware block included in sh7724.

With this patch applied I can use SDIO cards in polling mode with the tmio-mmc driver. Tested with the SDHI hardware block on sh7372 using the b43 driver and BCM4318 hardware and the unfortunately out-of-tree AR6002 "android" driver.

#3 lore raw
Quoted 7 lines · Magnus Damm
Quoted 6 lines

2010/7/20 Yusuke Goda <[email protected]>:

Quoted 4 lines

Adjust the tmio_mmc block size check to accept 2-byte requests in 4-bit mode. Tested with the SDHI hardware block included in sh7724.

Quoted 7 lines
Quoted 7 lines

With this patch applied I can use SDIO cards in polling mode with the tmio-mmc driver. Tested with the SDHI hardware block on sh7372 using the b43 driver and BCM4318 hardware and the unfortunately out-of-tree AR6002 "android" driver.

Hi Ian,

Thanks for your feedback!

Quoted 2 lines · Ian Molton

This change needs to be modified to test what hardware is present. this wont work on my hardware TTBOMK.

Ok, just curious, on which platform did you test it?

On SDHI hardware the 2-byte access works just fine in 4-bit mode.

Thanks,

/ magnus

#4 lore raw
In reply to Magnus Damm
Quoted 15 lines · Magnus Damm
Quoted 7 lines · Magnus Damm
Quoted 6 lines

2010/7/20 Yusuke Goda <[email protected]>:

Quoted 4 lines

Adjust the tmio_mmc block size check to accept 2-byte requests in 4-bit mode. Tested with the SDHI hardware block included in sh7724.

Quoted 7 lines
Quoted 7 lines

With this patch applied I can use SDIO cards in polling mode with the tmio-mmc driver. Tested with the SDHI hardware block on sh7372 using the b43 driver and BCM4318 hardware and the unfortunately out-of-tree AR6002 "android" driver.

Quoted 7 lines
Quoted 2 lines · Ian Molton

This change needs to be modified to test what hardware is present. this wont work on my hardware TTBOMK.

Ok, just curious, on which platform did you test it?

On SDHI hardware the 2-byte access works just fine in 4-bit mode.

Hi Ian,

Any update on this? I'd like to see this patch upstream since it unbreaks SDIO support for platforms with SDHI controllers.

I have a BCM4318-based SDIO card that I can send with snail mail from Japan if anyone is interested in testing on non-SDHI platforms.

Thanks,

/ magnus

#6 lore raw
In reply to Arnd Hannemann
Quoted 9 lines · Arnd Hannemann

Am 20.07.2010 09:52, schrieb Yusuke Goda:

Quoted 4 lines

Adjust the tmio_mmc block size check to accept 2-byte requests in 4-bit mode. Tested with the SDHI hardware block included in sh7724.

Tested on AP4EVB (sh7372) with SDHC and MMC cards - no regression.

Hi Arnd,

With both you, Goda-san and me testing it certainly looks like this one also is ok on platforms with SDHI.

Thanks a lot!

/ magnus