mmc: sdhci: Fix ADMA for PAGE_SIZE >= 64KiB
authorAdrian Hunter <adrian.hunter@intel.com>
Mon, 15 Nov 2021 08:23:45 +0000 (10:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Dec 2021 08:19:01 +0000 (09:19 +0100)
commit14c3ce30ddbd70a0b025202249dd8d83c6072592
treed02f2b0343f61faa447a9a6d547779e0ff568fb4
parent63195705b334fc8bf4b17f0b8ef655c81c9e21ec
mmc: sdhci: Fix ADMA for PAGE_SIZE >= 64KiB

commit 3d7c194b7c9ad414264935ad4f943a6ce285ebb1 upstream.

The block layer forces a minimum segment size of PAGE_SIZE, so a segment
can be too big for the ADMA table, if PAGE_SIZE >= 64KiB. Fix by writing
multiple descriptors, noting that the ADMA table is sized for 4KiB chunks
anyway, so it will be big enough.

Reported-and-tested-by: Bough Chen <haibo.chen@nxp.com>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20211115082345.802238-1-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h