Skip to content

Commit 727cba7

Browse files
linuswstorulf
authored andcommitted
mmc: sh_mmcif: sg_miter must not be atomic
All the sglist iterations happen in the *threaded* interrupt handler and that context is not atomic, so don't request an atomic sglist miter. Using an atomic miter results in "BUG: scheduling while atomic" splats. Reported-by: Geert Uytterhoeven <[email protected]> Fixes: 27b5727 ("mmc: sh_mmcif: Use sg_miter for PIO") Tested-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 44d41bf commit 727cba7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/mmc/host/sh_mmcif.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ static void sh_mmcif_single_read(struct sh_mmcif_host *host,
607607
BLOCK_SIZE_MASK) + 3;
608608

609609
sg_miter_start(&host->sg_miter, data->sg, data->sg_len,
610-
SG_MITER_ATOMIC | SG_MITER_TO_SG);
610+
SG_MITER_TO_SG);
611611

612612
host->wait_for = MMCIF_WAIT_FOR_READ;
613613

@@ -662,7 +662,7 @@ static void sh_mmcif_multi_read(struct sh_mmcif_host *host,
662662
BLOCK_SIZE_MASK;
663663

664664
sg_miter_start(&host->sg_miter, data->sg, data->sg_len,
665-
SG_MITER_ATOMIC | SG_MITER_TO_SG);
665+
SG_MITER_TO_SG);
666666

667667
host->wait_for = MMCIF_WAIT_FOR_MREAD;
668668

@@ -710,7 +710,7 @@ static void sh_mmcif_single_write(struct sh_mmcif_host *host,
710710
BLOCK_SIZE_MASK) + 3;
711711

712712
sg_miter_start(&host->sg_miter, data->sg, data->sg_len,
713-
SG_MITER_ATOMIC | SG_MITER_FROM_SG);
713+
SG_MITER_FROM_SG);
714714

715715
host->wait_for = MMCIF_WAIT_FOR_WRITE;
716716

@@ -765,7 +765,7 @@ static void sh_mmcif_multi_write(struct sh_mmcif_host *host,
765765
BLOCK_SIZE_MASK;
766766

767767
sg_miter_start(&host->sg_miter, data->sg, data->sg_len,
768-
SG_MITER_ATOMIC | SG_MITER_FROM_SG);
768+
SG_MITER_FROM_SG);
769769

770770
host->wait_for = MMCIF_WAIT_FOR_MWRITE;
771771

0 commit comments

Comments
 (0)