From 3fb7fb4a01d09f81d1daaf65e52d929734bd691f Mon Sep 17 00:00:00 2001 From: Bing Zhao Date: Fri, 5 Mar 2010 13:43:25 -0800 Subject: sdio: add quirk to clamp byte mode transfer Some SDIO cards expect byte transfers not to exceed the configured block transfer size. Add a quirk to that effect. Patches to make use of this quirk will be sent separately. Signed-off-by: Bing Zhao Signed-off-by: Nicolas Pitre Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/mmc/core/sdio_io.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'drivers/mmc') diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c index f9aa8a7deff..87c618904ee 100644 --- a/drivers/mmc/core/sdio_io.c +++ b/drivers/mmc/core/sdio_io.c @@ -189,7 +189,12 @@ static inline unsigned int sdio_max_byte_size(struct sdio_func *func) { unsigned mval = min(func->card->host->max_seg_size, func->card->host->max_blk_size); - mval = min(mval, func->max_blksize); + + if (mmc_blksz_for_byte_mode(func->card)) + mval = min(mval, func->cur_blksize); + else + mval = min(mval, func->max_blksize); + return min(mval, 512u); /* maximum size for byte mode */ } -- cgit v1.2.3