]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: sdhci: Avoid swiotlb buffer being full
authorUlf Hansson <ulf.hansson@linaro.org>
Mon, 27 Nov 2017 10:28:50 +0000 (11:28 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 28 Nov 2017 19:29:24 +0000 (20:29 +0100)
commit4a94ec8b41b7b1443cb0a9310364d17fb1059fc8
tree90e2000350bc5b5e217853fe44425ca05addf9ad
parent7eb0e5ca4b4e0f657227ce3cf6e81513e8a47b16
mmc: sdhci: Avoid swiotlb buffer being full

The commit 60f55f3d4c32 ("mmc: Delete bounce buffer handling") deletes the
bounce buffer handling, but also causes the max_req_size for sdhci to be
increased, in case when max_segs == 1. This causes errors for sdhci-pci
Ricoh variant, about the swiotlb buffer to become full.

Fix the issue, by taking IO_TLB_SEGSIZE and IO_TLB_SHIFT into account when
deciding the max_req_size for sdhci.

Reported-by: Jiri Slaby <jslaby@suse.cz>
Fixes: 60f55f3d4c32 ("mmc: Delete bounce buffer handling")
Cc: <stable@vger.kernel.org> # v4.14+
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
drivers/mmc/host/sdhci.c