difos/target/linux/bcm27xx/patches-6.12/950-0754-mmc-bcm2835-sdhost-Observe-SWIOTLB-memory-limit.patch
Álvaro Fernández Rojas 8f9e91ad03 bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-05-21 11:32:18 +02:00

29 lines
980 B
Diff

From 7a943644cc71cd4381cb8b503eef53ef18672855 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Fri, 10 Jan 2025 16:33:13 +0000
Subject: [PATCH] mmc: bcm2835-sdhost Observe SWIOTLB memory limit
Make sure the sdhost driver doesn't use requests bigger than SWIOTLB
can handle.
Copied from [1].
Link: https://github.com/raspberrypi/linux/issues/6589
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
[1] d4dd9bccf485 ("mmc: bcm2835: Take SWIOTLB memory size limitation
into account")
---
drivers/mmc/host/bcm2835-sdhost.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/mmc/host/bcm2835-sdhost.c
+++ b/drivers/mmc/host/bcm2835-sdhost.c
@@ -1971,7 +1971,7 @@ static int bcm2835_sdhost_add_host(struc
}
mmc->max_segs = 128;
- mmc->max_req_size = 524288;
+ mmc->max_req_size = min_t(size_t, 524288, dma_max_mapping_size(&pdev->dev));
mmc->max_seg_size = mmc->max_req_size;
mmc->max_blk_size = 512;
mmc->max_blk_count = 65535;