From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] mtd: nand: mxc_nand: implement exec_op
Date: Tue, 14 May 2024 12:16:02 +0200 [thread overview]
Message-ID: <20240514121602.273f788e@xps-13> (raw)
In-Reply-To: <ZkMsS1jj-ZTpZyE1@pengutronix.de>
Hi Sascha,
> > > > + case NAND_OP_WAITRDY_INSTR:
> > > > + /*
> > > > + * NFC handles R/B internally. Therefore, this function
> > > > + * always returns status as ready.
> > >
> > > This is no longer a standalone function, maybe:
> > >
> > > "The controller handles the R/B pin internally, therefore there is
> > > nothing to do here."
>
> Ok.
>
> >
> > And this is actually very wrong.
> >
> > You should call wait_op_done() instead.
>
> No, I don't think so. wait_op_done() is called to wait for the interrupt
> of the controller indicating a basic operation is done. A basic operation
> can be that a command is being sent or an address byte has been sent to
> the chip during an address cycle.
>
> With this arbitrary example:
>
> struct nand_op_instr instrs[] = {
> NAND_OP_CMD(NAND_CMD_READ0, 0),
> NAND_OP_ADDR(4, addrs, 0),
> NAND_OP_CMD(NAND_CMD_READSTART, NAND_COMMON_TIMING_NS(conf, tWB_max)),
> NAND_OP_WAIT_RDY(NAND_COMMON_TIMING_MS(conf, tR_max),
> NAND_COMMON_TIMING_NS(conf, tRR_min)),
> NAND_OP_DATA_IN(len, buf, 0),
> };
>
> I'll call wait_op_done() once for NAND_CMD_READ0, four times for the NAND_OP_ADDR,
> then once again for the NAND_CMD_READSTART command and four times (on i.MX27, once
> per subpage) for the NAND_OP_DATA_IN operation. Calling wait_op_done() for the
> NAND_OP_WAIT_RDY operation woul only timeout because there is no operation in flight
> currently.
Ah, ok, makes sense as well. If you want (this is not mandatory) you
may want to rename the function wait_instr_done() to fit the core's
naming: an operation being an aggregate of instructions/cycles.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] mtd: nand: mxc_nand: implement exec_op
Date: Tue, 14 May 2024 12:16:02 +0200 [thread overview]
Message-ID: <20240514121602.273f788e@xps-13> (raw)
In-Reply-To: <ZkMsS1jj-ZTpZyE1@pengutronix.de>
Hi Sascha,
> > > > + case NAND_OP_WAITRDY_INSTR:
> > > > + /*
> > > > + * NFC handles R/B internally. Therefore, this function
> > > > + * always returns status as ready.
> > >
> > > This is no longer a standalone function, maybe:
> > >
> > > "The controller handles the R/B pin internally, therefore there is
> > > nothing to do here."
>
> Ok.
>
> >
> > And this is actually very wrong.
> >
> > You should call wait_op_done() instead.
>
> No, I don't think so. wait_op_done() is called to wait for the interrupt
> of the controller indicating a basic operation is done. A basic operation
> can be that a command is being sent or an address byte has been sent to
> the chip during an address cycle.
>
> With this arbitrary example:
>
> struct nand_op_instr instrs[] = {
> NAND_OP_CMD(NAND_CMD_READ0, 0),
> NAND_OP_ADDR(4, addrs, 0),
> NAND_OP_CMD(NAND_CMD_READSTART, NAND_COMMON_TIMING_NS(conf, tWB_max)),
> NAND_OP_WAIT_RDY(NAND_COMMON_TIMING_MS(conf, tR_max),
> NAND_COMMON_TIMING_NS(conf, tRR_min)),
> NAND_OP_DATA_IN(len, buf, 0),
> };
>
> I'll call wait_op_done() once for NAND_CMD_READ0, four times for the NAND_OP_ADDR,
> then once again for the NAND_CMD_READSTART command and four times (on i.MX27, once
> per subpage) for the NAND_OP_DATA_IN operation. Calling wait_op_done() for the
> NAND_OP_WAIT_RDY operation woul only timeout because there is no operation in flight
> currently.
Ah, ok, makes sense as well. If you want (this is not mandatory) you
may want to rename the function wait_instr_done() to fit the core's
naming: an operation being an aggregate of instructions/cycles.
Thanks,
Miquèl
next prev parent reply other threads:[~2024-05-14 10:16 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-08 11:08 [PATCH v2 0/3] mtd: nand: mxc_nand: Convert to exec_op Sascha Hauer
2024-05-08 11:08 ` Sascha Hauer
2024-05-08 11:08 ` [PATCH v2 1/3] mtd: nand: mxc_nand: separate page read from ecc calc Sascha Hauer
2024-05-08 11:08 ` Sascha Hauer
2024-05-08 11:08 ` [PATCH v2 2/3] mtd: nand: mxc_nand: implement exec_op Sascha Hauer
2024-05-08 11:08 ` Sascha Hauer
2024-05-13 7:19 ` Miquel Raynal
2024-05-13 7:19 ` Miquel Raynal
2024-05-13 7:32 ` Miquel Raynal
2024-05-13 7:32 ` Miquel Raynal
2024-05-13 9:08 ` Sascha Hauer
2024-05-13 9:08 ` Sascha Hauer
2024-05-13 12:55 ` Miquel Raynal
2024-05-13 12:55 ` Miquel Raynal
2024-05-14 9:18 ` Sascha Hauer
2024-05-14 9:18 ` Sascha Hauer
2024-05-14 10:16 ` Miquel Raynal [this message]
2024-05-14 10:16 ` Miquel Raynal
2024-05-08 11:08 ` [PATCH v2 3/3] mtd: nand: mxc_nand: support software ECC Sascha Hauer
2024-05-08 11:08 ` Sascha Hauer
2024-05-13 7:42 ` Miquel Raynal
2024-05-13 7:42 ` Miquel Raynal
2024-05-13 9:19 ` Sascha Hauer
2024-05-13 9:19 ` Sascha Hauer
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=20240514121602.273f788e@xps-13 \
--to=miquel.raynal@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
--cc=s.hauer@pengutronix.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.