aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/sdio_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/core/sdio_io.c')
-rw-r--r--drivers/mmc/core/sdio_io.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c
index 8f6f5ac131fc..78cb4d5d9d58 100644
--- a/drivers/mmc/core/sdio_io.c
+++ b/drivers/mmc/core/sdio_io.c
@@ -188,8 +188,7 @@ EXPORT_SYMBOL_GPL(sdio_set_block_size);
188 */ 188 */
189static inline unsigned int sdio_max_byte_size(struct sdio_func *func) 189static inline unsigned int sdio_max_byte_size(struct sdio_func *func)
190{ 190{
191 unsigned mval = min(func->card->host->max_seg_size, 191 unsigned mval = func->card->host->max_blk_size;
192 func->card->host->max_blk_size);
193 192
194 if (mmc_blksz_for_byte_mode(func->card)) 193 if (mmc_blksz_for_byte_mode(func->card))
195 mval = min(mval, func->cur_blksize); 194 mval = min(mval, func->cur_blksize);
@@ -311,11 +310,8 @@ static int sdio_io_rw_ext_helper(struct sdio_func *func, int write,
311 /* Do the bulk of the transfer using block mode (if supported). */ 310 /* Do the bulk of the transfer using block mode (if supported). */
312 if (func->card->cccr.multi_block && (size > sdio_max_byte_size(func))) { 311 if (func->card->cccr.multi_block && (size > sdio_max_byte_size(func))) {
313 /* Blocks per command is limited by host count, host transfer 312 /* Blocks per command is limited by host count, host transfer
314 * size (we only use a single sg entry) and the maximum for 313 * size and the maximum for IO_RW_EXTENDED of 511 blocks. */
315 * IO_RW_EXTENDED of 511 blocks. */ 314 max_blocks = min(func->card->host->max_blk_count, 511u);
316 max_blocks = min(func->card->host->max_blk_count,
317 func->card->host->max_seg_size / func->cur_blksize);
318 max_blocks = min(max_blocks, 511u);
319 315
320 while (remainder >= func->cur_blksize) { 316 while (remainder >= func->cur_blksize) {
321 unsigned blocks; 317 unsigned blocks;