]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mmc: bcm2835: Take SWIOTLB memory size limitation into account
authorStefan Wahren <wahrenst@gmx.net>
Sat, 24 Aug 2019 06:31:04 +0000 (08:31 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 11 Sep 2019 13:58:39 +0000 (15:58 +0200)
Make sure the sdhost driver doesn't use requests bigger than SWIOTLB
can handle.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/bcm2835.c

index e1b7757c48fe1ec74be7d48914370e11c9c2008a..7c30d79a9fdd5c037246e70a766cb595020eebfe 100644 (file)
@@ -1314,7 +1314,7 @@ static int bcm2835_add_host(struct bcm2835_host *host)
        }
 
        mmc->max_segs = 128;
-       mmc->max_req_size = 524288;
+       mmc->max_req_size = min_t(size_t, 524288, dma_max_mapping_size(dev));
        mmc->max_seg_size = mmc->max_req_size;
        mmc->max_blk_size = 1024;
        mmc->max_blk_count =  65535;