mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dominique Martinet <dominique.martinet@atmark-techno.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] mtd: spinand: winbond: enable continuous read for W25N04LW
Date: Wed, 26 Aug 2026 18:03:19 +0900	[thread overview]
Message-ID: <ao6r15CbIMQZZWTB@atmark-techno.com> (raw)
In-Reply-To: <871pbmk1ma.fsf@bootlin.com>

Miquel Raynal wrote on Tue, Aug 25, 2026 at 11:09:33AM +0200:
> > Unfortunately on my system (i.MX 8ULP LPSPI) the first time continuous
> > read is used spinand_read_from_cache_op() falls into this if and
> > disables continuous read, so this didn't go any further:
> 
> Ah, too bad :-)

Yeah, I'll try to take some time to dig into the SPI driver to see if
that can be fixed in software but I'm afraid it'll take a while
longer...

> > Fun fact:
> > nanddump -C is about 9% faster than nanddump on large data (tried 10MB)
> > even if continuous read is not supported.
> 
> That is strange. Is this really reproducible? Can you disable CPU PM and
> try again? There should be no impact if continuous read is disabled.

This system has no knob that I'm aware of (no cpufreq in
/sys/devices/system/cpu at least), but I've shoved the IRQs aside except
for the spi ones and it appears pretty stable (mtd1 is a 8MB partition)

------
localhost:/mnt/mtd-utils# taskset -c 1 hyperfine --warmup 3 -r 20  './nanddump -f /dev/null /dev/mtd1' './nanddump -C -
f /dev/null /dev/mtd1'
Benchmark 1: ./nanddump -f /dev/null /dev/mtd1
  Time (mean ± σ):     511.1 ms ±   0.5 ms    [User: 7.8 ms, System: 419.8 ms]
  Range (min … max):   510.4 ms … 512.0 ms    20 runs
 
Benchmark 2: ./nanddump -C -f /dev/null /dev/mtd1
  Time (mean ± σ):     480.9 ms ±   0.9 ms    [User: 0.5 ms, System: 399.6 ms]
  Range (min … max):   480.1 ms … 483.3 ms    20 runs
 
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
 
Summary
  ./nanddump -C -f /dev/null /dev/mtd1 ran
    1.06 ± 0.00 times faster than ./nanddump -f /dev/null /dev/mtd1
------
(this is on our 6.12 tree and not on the 7.2-rc I was on earlier, so
ymmv, but iirc the 9% figure was taken on 7.2 with hyperfine so this
should be reproducible with the latest and greatest)


I have much more important things to do so I obviously had to look
further into this mystery :-), but I didn't see anything obvious...

For some reason the contiguous read variant seems to spend less time in
spinand_wait() between the load page and read from cache op (looking at
a flamegraph), but dumping the actual ops used I see very similar
sequences of load page (0x13), poll status (0xf), dirmap_read (0xeb),
so that doesn't explain the difference...

The main difference I see is that nanddump -C passes a much larger
buffer to read (observable with strace -c), so loops for reading inside
the kernel, and without -C loops in userspace: I do not see the syscall
overhead in my perf record flamegraph but perhaps that changes the
timing just enough for the nand to behave differently or something like
that?

Definitely curious, but I'm not sure if there's anything to act on
here..

Cheers,
-- 
Dominique

  reply	other threads:[~2026-08-26  9:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14  8:15 Dominique Martinet
2026-08-25  9:09 ` Miquel Raynal
2026-08-26  9:03   ` Dominique Martinet [this message]
2026-08-26 13:08     ` Miquel Raynal

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=ao6r15CbIMQZZWTB@atmark-techno.com \
    --to=dominique.martinet@atmark-techno.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.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®