Commit 44d41bf6 authored by Linus Walleij's avatar Linus Walleij Committed by Ulf Hansson

mmc: sdhci-esdhc-mcf: Flag the sg_miter as atomic

The sg_miter used to loop over the returned sglist from a
transfer in the esdhc subdriver for SDHCI can be called
from atomic context so the miter needs to be atomic.

sdhci_request_done() is always called from process context,
either as a work or as part of the threaded interrupt handler,
but the one case when we are actually calling .request_done()
from an atomic context is in sdhci_irq().

Fix this by flagging the miter atomic so we always use
kmap_atomic().

Fixes: e8a167b8 ("mmc: sdhci-esdhc-mcf: Use sg_miter for swapping")
Reported-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20240228-fix-sdhci-esdhc-mcf-2-v2-1-4ebb3fd691ea@linaro.orgSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 6f3d5688
......@@ -313,7 +313,7 @@ static void esdhc_mcf_request_done(struct sdhci_host *host,
* transfer endiannes. A swap after the transfer is needed.
*/
sg_miter_start(&sgm, mrq->data->sg, mrq->data->sg_len,
SG_MITER_TO_SG | SG_MITER_FROM_SG);
SG_MITER_ATOMIC | SG_MITER_TO_SG | SG_MITER_FROM_SG);
while (sg_miter_next(&sgm)) {
buffer = sgm.addr;
esdhc_mcf_buffer_swap32(buffer, sgm.length);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment