mmc: renesas_sdhi_internal_dmac: set scatter/gather max segment size
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Thu, 13 Sep 2018 14:47:08 +0000 (16:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Nov 2019 07:20:34 +0000 (08:20 +0100)
commita3a76b5d22f0685de55648aef99ca248b99f85c2
treedec68b3c3cf9c6ad0998db862ab02b2b8ab65c7b
parente8853ef02e2d9460d272a07ec6a7d4d5fcd3c825
mmc: renesas_sdhi_internal_dmac: set scatter/gather max segment size

[ Upstream commit 54541815b43f4e49c82628bf28bbb31d86d2f58a ]

Fix warning when running with CONFIG_DMA_API_DEBUG_SG=y by allocating a
device_dma_parameters structure and filling in the max segment size. The
size used is the result of a discussion with Renesas hardware engineers
and unfortunately not found in the datasheet.

  renesas_sdhi_internal_dmac ee140000.sd: DMA-API: mapping sg segment
  longer than device claims to support [len=126976] [max=65536]

Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
[wsa: simplified some logic after validating intended dma_parms life cycle
      and added comment]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mmc/host/renesas_sdhi_internal_dmac.c