From: Miquel Raynal <miquel.raynal@bootlin.com>
To: "Måns Rullgård" <mans@mansr.com>
Cc: Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Tudor Ambarus <Tudor.Ambarus@microchip.com>,
Pratyush Yadav <pratyush@kernel.org>,
Michael Walle <michael@walle.cc>, <linux-mtd@lists.infradead.org>,
Julien Su <juliensu@mxic.com.tw>,
Jaime Liao <jaimeliao@mxic.com.tw>,
Alvin Zhou <alvinzhou@mxic.com.tw>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
JaimeLiao <jaimeliao.tw@gmail.com>,
Alexander Shiyan <eagle.alexander923@gmail.com>,
Domenico Punzo <dpunzo@micron.com>, Bean Huo <beanhuo@micron.com>
Subject: Re: [PATCH v2 3/3] mtd: rawnand: Support for sequential cache reads
Date: Mon, 17 Jul 2023 09:19:00 +0200 [thread overview]
Message-ID: <20230717091900.52ed815a@xps-13> (raw)
In-Reply-To: <yw1x7cqzzr4d.fsf@mansr.com>
Hi Måns & Alexander,
mans@mansr.com wrote on Sun, 16 Jul 2023 18:46:26 +0100:
> Miquel Raynal <miquel.raynal@bootlin.com> writes:
>
> > Hello all,
> >
> > So here is a summary of the situation:
> > - we have two bug reports regarding the use of sequential page reads
> > - both are on TI OMAP platforms: AM33XX and AM3517. I believe both are
> > using the same omap2.c driver
> > - they use a Micron and a Samsung NAND chip
> >
> > All these information gives me the hint that it is related to the
> > controller driver which does something silly during the exec_op phase.
> >
> > Alexander and Måns, can you please tell me:
> > - Are you using a gpio for the waitrdy thing or do you leverage
> > nand_soft_waitrdy()? If you are using the gpio, can you both try with
> > the soft implementation and see if it changes something?
>
> There's no gpio specified in the devicetree, so I guess it must be using
> nand_soft_waitrdy().
>
> > - Are you using any POLL or DMA prefetch mode? Can you please force the
> > default in and out helpers by using only omap_nand_data_in() and
> > omap_nand_data_out() to see if it changes something?
>
> It was using the default PREFETCH_POLLED mode. Switching it to POLLED
> (and thus omap_nand_data_in/out()) doesn't change anything.
>
> > I believe there is something wrong in the timings, while properly
> > implemented in theory there might be some cases where we miss a barrier
> > or something like that. I would like to try the following two hacks,
> > and see if we can find what is the timing that is not observed, despite
> > the lack of probing. The first one is a real hack, the second one might
> > actually look like a real fix. Please let me know, both of you, if you
> > see different behaviors.
> >
> > *** HACK #1 ***
> >
> > --- a/drivers/mtd/nand/raw/omap2.c
> > +++ b/drivers/mtd/nand/raw/omap2.c
> > @@ -2113,6 +2113,9 @@ static int omap_nand_exec_instr(struct nand_chip *chip,
> > case NAND_OP_CMD_INSTR:
> > iowrite8(instr->ctx.cmd.opcode,
> > info->reg.gpmc_nand_command);
> > + if (instr->ctx.cmd.opcode == NAND_CMD_READCACHESEQ ||
> > + instr->ctx.cmd.opcode == NAND_CMD_READCACHEEND)
> > + udelay(50);
> > break;
> >
> > case NAND_OP_ADDR_INSTR:
> >
> > *** HACK #2 ***
> >
> > --- a/drivers/mtd/nand/raw/omap2.c
> > +++ b/drivers/mtd/nand/raw/omap2.c
> > @@ -2143,8 +2146,10 @@ static int omap_nand_exec_instr(struct nand_chip *chip,
> > break;
> > }
> >
> > - if (instr->delay_ns)
> > + if (instr->delay_ns) {
> > + mb();
> > ndelay(instr->delay_ns);
> > + }
> >
> > return 0;
> > }
>
> Neither of these help.
I am also pasting Alexander's answer here:
> We are using GPIO for waitrdy. However, even when switching to soft
> implementation,
> the system still behaves incorrectly.
> We are using prefetch-dma mode for xfer. Changing to the default implementation
> does not result in any improvements.
>
> Both patches don't help :(
Thanks a lot to both of you for testing.
So, I should have done that earlier but, could you please slow the
whole operation down, just to see if there is something wrong with the
timings or if we should look in another direction.
Maybe you could add a boolean to flag if the last CMD was a
READCACHESEQ, READCACHESTART or READCACHEEND, and if the flag is
true, please get the jiffies before and after each waitrdy and
delay_ns. Finally, please print the expected delay and the actual one
and compare to see if something was too fast compared to what we
expected.
In a second test, you could simply add a udelay(50); at the end of
omap_nand_exec_instr().
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2023-07-17 7:19 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-12 9:36 [PATCH v2 0/3] mtd: rawnand: Sequential page reads Miquel Raynal
2023-01-12 9:36 ` [PATCH v2 1/3] mtd: rawnand: Check the data only read pattern only once Miquel Raynal
2023-01-13 16:37 ` Miquel Raynal
2023-01-12 9:36 ` [PATCH v2 2/3] mtd: rawnand: Prepare the late addition of supported operation checks Miquel Raynal
2023-01-13 16:36 ` Miquel Raynal
2023-01-12 9:36 ` [PATCH v2 3/3] mtd: rawnand: Support for sequential cache reads Miquel Raynal
2023-01-13 8:46 ` liao jaime
2023-01-13 16:36 ` Miquel Raynal
2023-03-03 12:26 ` Zhihao Cheng
2023-06-22 14:59 ` Måns Rullgård
2023-06-22 21:12 ` Miquel Raynal
2023-06-23 11:27 ` Måns Rullgård
2023-06-23 14:07 ` Miquel Raynal
2023-06-26 9:43 ` [EXT] " Bean Huo
2023-07-16 15:49 ` Miquel Raynal
2023-07-16 17:46 ` Måns Rullgård
2023-07-17 7:19 ` Miquel Raynal [this message]
2023-07-17 13:11 ` Måns Rullgård
2023-07-17 16:36 ` Miquel Raynal
2023-07-18 14:03 ` Måns Rullgård
2023-07-19 8:21 ` Miquel Raynal
2023-07-19 9:26 ` Måns Rullgård
2023-07-19 11:44 ` Miquel Raynal
2023-07-19 13:15 ` Måns Rullgård
2023-07-20 6:20 ` Miquel Raynal
2023-07-20 11:42 ` Måns Rullgård
2023-07-17 5:33 ` Alexander Shiyan
2023-09-08 12:25 ` Martin Hundebøll
2023-09-12 15:59 ` Miquel Raynal
2023-09-15 11:20 ` Martin Hundebøll
2023-09-22 9:20 ` 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=20230717091900.52ed815a@xps-13 \
--to=miquel.raynal@bootlin.com \
--cc=Tudor.Ambarus@microchip.com \
--cc=alvinzhou@mxic.com.tw \
--cc=beanhuo@micron.com \
--cc=dpunzo@micron.com \
--cc=eagle.alexander923@gmail.com \
--cc=jaimeliao.tw@gmail.com \
--cc=jaimeliao@mxic.com.tw \
--cc=juliensu@mxic.com.tw \
--cc=linux-mtd@lists.infradead.org \
--cc=mans@mansr.com \
--cc=michael@walle.cc \
--cc=pratyush@kernel.org \
--cc=richard@nod.at \
--cc=thomas.petazzoni@bootlin.com \
--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