Skip to content

Commit c26339f

Browse files
groeckstorulf
authored andcommitted
mmc: core: Only set maximum DMA segment size if DMA is supported
Since upstream commit 334304a ("dma-mapping: don't return errors from dma_set_max_seg_size") calling dma_set_max_seg_size() on a device not supporting DMA results in a warning traceback. This is seen when booting the sifive_u machine from SD. The underlying SPI controller (sifive,spi0 compatible) explicitly sets dma_mask to NULL. Avoid the backtrace by only calling dma_set_max_seg_size() if DMA is supported. Signed-off-by: Guenter Roeck <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> Fixes: 334304a ("dma-mapping: don't return errors from dma_set_max_seg_size") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 9852d85 commit c26339f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/mmc/core/queue.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ static struct gendisk *mmc_alloc_disk(struct mmc_queue *mq,
388388

389389
blk_queue_rq_timeout(mq->queue, 60 * HZ);
390390

391-
dma_set_max_seg_size(mmc_dev(host), queue_max_segment_size(mq->queue));
391+
if (mmc_dev(host)->dma_parms)
392+
dma_set_max_seg_size(mmc_dev(host), queue_max_segment_size(mq->queue));
392393

393394
INIT_WORK(&mq->recovery_work, mmc_mq_recovery_handler);
394395
INIT_WORK(&mq->complete_work, mmc_blk_mq_complete_work);

0 commit comments

Comments
 (0)