]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: tmio: fix swiotlb buffer is full
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Fri, 20 Oct 2017 03:12:41 +0000 (12:12 +0900)
committerUlf Hansson <ulf.hansson@linaro.org>
Fri, 20 Oct 2017 09:24:58 +0000 (11:24 +0200)
commit3e3c9f791af093bad6039e96860bd00a11da2792
treefc0d836ca8f159fb9972d8bb9276688c0ab9d011
parentd609c34ccd0cf91eb0bf761657f028a36668adb2
mmc: tmio: fix swiotlb buffer is full

Since the commit 60f55f3d4c32 ("mmc: Delete bounce buffer handling")
deletes the bounce buffer handling, a request data size will be referred
to max_{req,seg}_size instead of MMC_QUEUE_BOUNCESZ (64k bytes).

In other hand, renesas_sdhi_internal_dmac.c will set very big value of
max_{req,seg}_size because the max_blk_count is set to 0xffffffff.
And then, "swiotlb buffer is full" happens because swiotlb can handle
a memory size up to 256k bytes only (IO_TLB_SEGSIZE = 128 and
IO_TLB_SHIFT = 11).

So, as a workaround, this patch avoids the issue by setting
the max_{req,seg}_size up to 256k bytes if swiotlb is running.

Reported-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/tmio_mmc_core.c