On Wed, Feb 21, 2024 at 10:23 PM Linus Walleij <linus.walleij@xxxxxxxxxx> wrote: > The introduction of sg_miter was a bit sloppy as it didn't > exactly mimic the semantics of the old code on multiblock reads > and writes: these like you to: > > - Advance to the first sglist entry *before* starting to read > any blocks from the card. > > - Advance and check availability of the next entry *right after* > processing one block. > > Not checking if we have more sglist entries right after > reading a block will lead to this not being checked until we > return to the callback to read out more blocks, i.e. until the > next interrupt arrives. Since the last block is the last one > (no more data will arrive) there will not be a next interrupt, > and we will be waiting forever resulting in a timeout for > command 18 when reading multiple blocks. > > The same bug was fixed also in the writing of multiple blocks. > > Reported-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> > Fixes: 27b57277d9ba ("mmc: sh_mmcif: Use sg_miter for PIO") > Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx> Thanks, eMMC works again (tested on APE6EVM and KZM9-GT-Dual). Tested-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds