From: Stefan Agner <stefan@agner.ch>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: boris.brezillon@bootlin.com, marcel.ziswiler@toradex.com,
richard@nod.at, bpringle@sympatico.ca, marek.vasut@gmail.com,
linux-mtd@lists.infradead.org, cyrille.pitchen@wedev4u.fr,
computersforpeace@gmail.com, dwmw2@infradead.org
Subject: Re: [RFC PATCH v2] mtd: nand: vf610_nfc: make use of ->exec_op()
Date: Thu, 08 Feb 2018 22:45:55 +0100 [thread overview]
Message-ID: <afe80e5ddc694cd88a29d1128618589e@agner.ch> (raw)
In-Reply-To: <20180208192347.692a2d93@xps13>
On 08.02.2018 19:23, Miquel Raynal wrote:
>> > +}
>> >
>> > - switch (command) {
>> > - case NAND_CMD_SEQIN:
>> > - /* Use valid column/page from preread... */
>> > - vf610_nfc_addr_cycle(nfc, column, page);
>> > - nfc->buf_offset = 0;
>> > +static int vf610_nfc_exec_op(struct nand_chip *chip,
>> > + const struct nand_operation *op,
>> > + bool check_only)
>>
>> The soul of ->exec_op() is here :) However this implementation looks
>> very specific to the kind of tasks you are used to do with one specific
>> chip. What if someone wants to support a new command that implies
>> several command/address/data cycles interleaved? Maybe one solution
>> would be to rework a bit by using a case statement in a for loop. If
>> the indentation level is too high, you may use helpers to do small
>> tasks like sending a command or addresse cycle. What do you think?
The controller mandates the sequence. If another sequence is required,
then multiple controller level command executions need to be issues.
>
> Actually, instead of writing your own implementation, maybe you should
> just write the helpers I mentioned above and fill a parser patterns
> array to give to the NAND core's parser, simplifying again the
> implementation.
I actually worked on a v3 just yesterday which implements Boris
suggetion. It also should be easier to review due two independent
patches for adding exec_op and removing the old callbacks. I hope we can
carry on the discussion there.
--
Stefan
prev parent reply other threads:[~2018-02-08 21:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-14 22:00 [RFC PATCH v2] mtd: nand: vf610_nfc: make use of ->exec_op() Stefan Agner
2018-01-15 10:06 ` Boris Brezillon
2018-01-15 22:07 ` Boris Brezillon
2018-02-08 18:07 ` Miquel Raynal
2018-02-08 18:23 ` Miquel Raynal
2018-02-08 21:45 ` Stefan Agner [this message]
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=afe80e5ddc694cd88a29d1128618589e@agner.ch \
--to=stefan@agner.ch \
--cc=boris.brezillon@bootlin.com \
--cc=bpringle@sympatico.ca \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@wedev4u.fr \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marcel.ziswiler@toradex.com \
--cc=marek.vasut@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
/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