mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Linus Walleij" <linusw@kernel.org>,
	"Arnd Bergmann" <arnd@kernel.org>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>
Cc: "Wolfram Sang" <wsa+renesas@sang-engineering.com>,
	"Ulf Hansson" <ulfh@kernel.org>, "Frank Li" <Frank.Li@nxp.com>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"linux-mmc @ vger . kernel . org" <linux-mmc@vger.kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mmc: sh_mmcif: rework sg_miter handling
Date: Wed, 18 Nov 2026 18:50:20 +0100	[thread overview]
Message-ID: <bf5fcc4b-05cb-4f11-8f6c-0f94fafd65b9@app.fastmail.com> (raw)
In-Reply-To: <CAD++jLnMxxtrtDMm6rYxB1_5jn-FpnrO3Jrb0=SmBmFWFkCTdA@mail.gmail.com>

On Wed, Nov 18, 2026, at 18:47, Linus Walleij wrote:
> Hi Arnd,
>
> On Wed, Nov 18, 2026 at 2:45 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> This driver is the only one that uses sg_miter_next() to get a persistent
>> mapping across interrupts, which prevents us from converting the internal
>> kmap() to a local mapping using SG_MITER_LOCAL flag.
>>
>> Linus previously attempted to use atomic mappings here, which failed
>> for the same reason. I gave it another try, with a mapping that is only
>> active during a single sh_mmcif_mread_block()/sh_mmcif_mwrite_block() call.
>>
>> This is mainly a revert of the patch that fixed the command 18 timeout,
>> but tries to solve the problem by updating and checking data->bytes_xfered
>> to keep track of when the transfer is finished.
>>
>> Instead of calling sg_miter_stop() on error or completion, this now
>> always stops the iterator after the data transfer and restarts it during
>> the following interrupt.
>>
>> Cc: Linus Walleij <linusw@kernel.org>
>> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
>> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
>> Fixes: 4d4a2c71b862 ("mmc: sh_mmcif: Advance sg_miter before reading blocks")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> FWIW:
> Acked-by: Linus Walleij <linusw@kernel.org>

Thanks!

>> Hi Wolfram and Linus,
>>
>> Could you have a look at this? I'm not familiar with this driver,
>> so there is a chance I got this completely wrong. If the change
>> does make sense, maybe you can try testing it on one of the
>> highmem-enabled boards.
>
> I don't have this hardware, but Geert does (he helped me with the
> previous patches to this driver), so it'd be great if he
> could give it a spin!

I'll post a v2 tomorrow with the bugs addressed that Sashiko found,
no point testing this version. Maybe Wolfram can still take a look.

      Arnd

  reply	other threads:[~2026-11-18 17:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 12:57 Arnd Bergmann
2026-11-18 17:47 ` Linus Walleij
2026-11-18 17:50   ` Arnd Bergmann [this message]
2026-11-18 20:17     ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf5fcc4b-05cb-4f11-8f6c-0f94fafd65b9@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=Frank.Li@nxp.com \
    --cc=adrian.hunter@intel.com \
    --cc=arnd@kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=linusw@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulfh@kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®