Skip to content

Commit 7559d61

Browse files
Christoph HellwigUlf Hansson
authored andcommitted
mmc: core: let the dma map ops handle bouncing
Just like we do for all other block drivers. Especially as the limit imposed at the moment might be way to pessimistic for iommus. This also means we are not going to set a bounce limit for the queue, in case we have a dma mask. On most architectures it was never needed, the major hold out was x86-32 with PAE, but that has been fixed by now. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 1cdca16 commit 7559d61

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎drivers/mmc/core/queue.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,18 +354,15 @@ static const struct blk_mq_ops mmc_mq_ops = {
354354
static void mmc_setup_queue(struct mmc_queue *mq, struct mmc_card *card)
355355
{
356356
struct mmc_host *host = card->host;
357-
u64 limit = BLK_BOUNCE_HIGH;
358357
unsigned block_size = 512;
359358

360-
if (mmc_dev(host)->dma_mask && *mmc_dev(host)->dma_mask)
361-
limit = (u64)dma_max_pfn(mmc_dev(host)) << PAGE_SHIFT;
362-
363359
blk_queue_flag_set(QUEUE_FLAG_NONROT, mq->queue);
364360
blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, mq->queue);
365361
if (mmc_can_erase(card))
366362
mmc_queue_setup_discard(mq->queue, card);
367363

368-
blk_queue_bounce_limit(mq->queue, limit);
364+
if (!mmc_dev(host)->dma_mask || !*mmc_dev(host)->dma_mask)
365+
blk_queue_bounce_limit(mq->queue, BLK_BOUNCE_HIGH);
369366
blk_queue_max_hw_sectors(mq->queue,
370367
min(host->max_blk_count, host->max_req_size / 512));
371368
blk_queue_max_segments(mq->queue, host->max_segs);

0 commit comments

Comments
 (0)