From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Liang Yang <liang.yang@amlogic.com>
Cc: Yixun Lan <yixun.lan@amlogic.com>,
<linux-mtd@lists.infradead.org>, Rob Herring <robh@kernel.org>,
Neil Armstrong <narmstrong@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Richard Weinberger <richard@nod.at>,
<linux-kernel@vger.kernel.org>,
Marek Vasut <marek.vasut@gmail.com>,
Jian Hu <jian.hu@amlogic.com>,
Kevin Hilman <khilman@baylibre.com>,
Carlo Caione <carlo@caione.org>,
<linux-amlogic@lists.infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
<linux-arm-kernel@lists.infradead.org>,
Jerome Brunet <jbrunet@baylibre.com>
Subject: Re: [RFC PATCH v2 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller
Date: Tue, 28 Aug 2018 15:26:45 +0200 [thread overview]
Message-ID: <20180828152645.457dab5c@bbrezillon> (raw)
In-Reply-To: <fdea2d54-7a68-64ec-8bb4-4a94677a3293@amlogic.com>
On Tue, 28 Aug 2018 21:21:48 +0800
Liang Yang <liang.yang@amlogic.com> wrote:
> Hi Boris,
>
> On 8/24/2018 8:48 PM, Boris Brezillon wrote:
> > On Wed, 22 Aug 2018 22:08:42 +0800
> > Liang Yang <liang.yang@amlogic.com> wrote:
> >
> >>> You have to wait tWB, that's for sure.
> >>>
> >> we have a maximum 32 commands fifo. when command is written into
> >> NFC_REG_CMD, it doesn't mean that command is executing right now, maybe
> >> it is buffering on the queue.Assume one ERASE operation, when 2nd
> >> command(0xd0) is written into NFC_REG_CMD and then come into
> >> NAND_OP_WAITRDY_INSTR, if I read the RB status by register, it may be
> >> wrong because 0xd0 may not being executed. it is unusual unless
> >> buffering two many command.
> >
> > You should flush the queue and wait for it to empty at the end of
> > ->exec_op().
> >
> >> so it seems that i still need to use nand_soft_waitrdy or wait cmd is
> >> executed somewhere.
> >
> > Don't you have a WAIT_FOR_RB instruction? What is NFC_CMD_RB for? Also,
> > NFC_CMD_IDLE seems to allow you to add an arbitrary delay, and that's
> > probably what you should use for tWB.
> >
> > em, I can wait for RB by reading the status from register now. but when
> calling nand_soft_waitrdy, i really met a problem. One *jiffies* is
> about 4ms. When programming, it pass 1ms to
> instr->ctx.waitrdy.timeout_ms and nand_soft_waitrdy will be only one
> *jiffies* to reach timeout. And then calling nand_soft_waitrdy maybe at
> the tail of 4ms interval, it may only wait 100us and next jiffies
> arrive. Is it correct?
Hm, no. If you initialize the time you compare to (using time_before()
or time_after()) correctly it should not happen. Anyway, I keep thinking
this is not how it should be done. Did you try NFC_CMD_RB? Did you ask
HW designers what it was created for?
next prev parent reply other threads:[~2018-08-28 13:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-19 9:46 [RFC PATCH v2 0/2] mtd: rawnand: meson: add Amlogic NAND driver support Yixun Lan
2018-07-19 9:46 ` [RFC PATCH v2 1/2] dt-bindings: nand: meson: add Amlogic NAND controller driver Yixun Lan
2018-07-19 9:57 ` Boris Brezillon
2018-07-19 10:07 ` Yixun Lan
2018-07-19 9:46 ` [RFC PATCH v2 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller Yixun Lan
2018-08-01 21:50 ` Boris Brezillon
2018-08-02 14:04 ` Yixun Lan
2018-08-17 13:03 ` Liang Yang
2018-08-17 13:56 ` Boris Brezillon
2018-08-21 3:33 ` Liang Yang
2018-08-22 14:08 ` Liang Yang
2018-08-24 12:48 ` Boris Brezillon
2018-08-28 13:21 ` Liang Yang
2018-08-28 13:26 ` Boris Brezillon [this message]
2018-08-29 10:08 ` Liang Yang
2018-08-29 10:29 ` Liang Yang
2018-08-29 10:31 ` Boris Brezillon
2018-08-17 8:46 ` Boris Brezillon
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=20180828152645.457dab5c@bbrezillon \
--to=boris.brezillon@bootlin.com \
--cc=carlo@caione.org \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=jbrunet@baylibre.com \
--cc=jian.hu@amlogic.com \
--cc=khilman@baylibre.com \
--cc=liang.yang@amlogic.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=martin.blumenstingl@googlemail.com \
--cc=narmstrong@baylibre.com \
--cc=richard@nod.at \
--cc=robh@kernel.org \
--cc=yixun.lan@amlogic.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;
as well as URLs for NNTP newsgroup(s).