From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Arnout Vandecappelle <arnout@mind.be>
Cc: Sam Lefebvre <sam.lefebvre@essensium.com>,
linux-mtd@lists.infradead.org, Han Xu <han.xu@nxp.com>,
Miquel Raynal <miquel.raynal@bootlin.com>
Subject: Re: [PATCH 11/18] mtd: rawnand: gpmi: instantiate cmdfunc
Date: Mon, 23 Apr 2018 12:05:35 +0200 [thread overview]
Message-ID: <20180423120535.70fdc6bb@bbrezillon> (raw)
In-Reply-To: <5965e578-a6bf-74b2-6cda-9ada6dae6285@mind.be>
Hi Arnout,
On Mon, 23 Apr 2018 09:43:48 +0200
Arnout Vandecappelle <arnout@mind.be> wrote:
> On 20-04-18 22:38, Boris Brezillon wrote:
> > Hi Sam, Arnout,
> >
> > On Fri, 20 Apr 2018 10:19:39 +0200
> > Sam Lefebvre <sam.lefebvre@essensium.com> wrote:
> >
> >> From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
> >>
> >> Later patches will optimize the command handling for gpmi. This
> >> requires a gpmmi-specific implementation of cmdfunc. As a first step,
> >> nand_command() is copied literally from nand_base.c (after merging
> >> nand_command() and nand_command_lp()).
> >
> > NACK. As said in my review of patch 10, we're trying to move a many
> > drivers as possible to the ->exec_op() approach in order to ease
> > maintenance of the NAND subsystem. What you're doing here is going in
> > the wrong direction.
> >
> > Please work on a solution based on ->exec_op().
>
> The problem is that exec_op() is a revolutionary change, because you need to
> change *all* operations at the same time. I personally believe in a step-by-step
> approach rather than rewriting everything from scratch. That's why patches 11,
> 12, 13, 14, 15 are all split out, to show for each step how and why it works.
Well, that's also one of the thing I don't like in this series. Copying
things from the core just to remove part of the logic afterwards is not
a good idea. But to be honest, that's not my biggest concern right now.
>
> In a step-by-step approach, I think that going through cmdfunc is a step
> towards exec_op. In terms of granularity, I think cmd_ctrl < cmdfunc < exec_op
> right?
No it's not. ->cmdfunc() is just a pain to maintain, because every time
we add a new operation in the core we have to patch all drivers that
implement ->cmdfunc() on their own. For me (as a NAND maintainer) it's:
cmdfunc < cmd_ctrl < exec_op
>
> It also doesn't help that there is not much documentation of exec_op.
This I agree with.
> There's
> Miquel's FOSDEM18 talk, there's the struct documentation, and there are just a
> few drivers that can serve as an example. In particular, I don't understand what
> happens when a pattern is not included in the nand_op_parser. It's also not
> clear to me how ECC is supposed to be integrated with it. For example, looking
> at the marvell driver, it seems the nand_base infra and exec_op are bypassed
> entirely for hwecc accesses.
Write and read path are where we care about optimizations, hence the
specific logic. If you want to optimize this path, maybe you should try
to overload the chip->ecc.read/write_page() functions.
>
> Finally, we are working on a budget that gets extended on a day-by-day basis,
> so we wanted to be able to push *something* within budget rather than not
> upstreaming anything at all.
Except getting from ->cmd_ctrl() to ->cmdfunc() is like going one step
back to me, so that's not something I'm willing to accept.
>
> That said, what should be the next steps? I guess continuing with patch 19, 20,
> 21 using the same approach doesn't make a lot of sense since you're not going to
> merge it in this form. We can of course repost patches 1-8 with a fix in patch
> 7. We could start working on exec_op conversion, but there's a big chance that
> nothing will be ready for submission when the budget dries up, and we probably
> won't get to the . Any other ideas?
If you don't want/can't invest time on ->exec_op(), I'd suggest
overloading ->read/write_page().
>
> If we do work on conversion to exec_op, what's the proper way to do this gradually?
Not sure what you mean by gradually, but you can have a look at how
miquel converted the FSMC driver from ->cmd_ctrl() to ->exec_op() [1].
Regards,
Boris
[1]https://patchwork.ozlabs.org/cover/874445/
next prev parent reply other threads:[~2018-04-23 10:06 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-20 8:19 Reducing the number of interrupts by page reads, part 1 Sam Lefebvre
2018-04-20 8:19 ` [PATCH 01/18] mtd: nand: gpmi: drop dma_ops_type Sam Lefebvre
2018-04-20 8:19 ` [PATCH 02/18] mtd: nand: gpmi: pass buffer and len around Sam Lefebvre
2018-04-20 8:19 ` [PATCH 03/18] mtd: nand: gpmi: put only once used functions inline Sam Lefebvre
2018-04-20 8:19 ` [PATCH 04/18] mtd: nand: gpmi: remove direct_dma_map_ok from driver data struct Sam Lefebvre
2018-04-20 8:19 ` [PATCH 05/18] mtd: nand: gpmi: return valid value from bch_set_geometry() Sam Lefebvre
2018-04-20 8:19 ` [PATCH 06/18] mtd: nand: gpmi: remove unnecessary variables Sam Lefebvre
2018-04-20 8:19 ` [PATCH 07/18] mtd: rawnand: gpmi: return generated errors in gpmi_ecc_read_oob() Sam Lefebvre
2018-04-20 22:40 ` Boris Brezillon
2018-04-20 8:19 ` [PATCH 08/18] mtd: rawnand: gpmi: set aggregate ready/busy signalling Sam Lefebvre
2018-04-20 8:19 ` [PATCH 09/18] mtd: rawnand: make nand_command() and nand_command_lp() more similar Sam Lefebvre
2018-04-20 8:19 ` [PATCH 10/18] mtd: rawnand: factor nand_command_lp() into nand_command() Sam Lefebvre
2018-04-20 20:34 ` Boris Brezillon
2018-04-23 7:16 ` Arnout Vandecappelle
2018-04-20 8:19 ` [PATCH 11/18] mtd: rawnand: gpmi: instantiate cmdfunc Sam Lefebvre
2018-04-20 20:38 ` Boris Brezillon
2018-04-23 7:43 ` Arnout Vandecappelle
2018-04-23 10:05 ` Boris Brezillon [this message]
2018-04-20 8:19 ` [PATCH 12/18] mtd: rawnand: gpmi: gpmi_ccs_delay() is not needed Sam Lefebvre
2018-04-20 8:19 ` [PATCH 13/18] mtd: rawnand: gpmi: explicit delays are " Sam Lefebvre
2018-04-20 8:19 ` [PATCH 14/18] mtd: rawnand: gpmi: no explicit wait is needed after sending a command Sam Lefebvre
2018-04-20 8:19 ` [PATCH 15/18] mtd: rawnand: gpmi: cmd_ctrl is no longer needed Sam Lefebvre
2018-04-20 8:19 ` [PATCH 16/18] mtd: rawnand: gpmi: inline gpmi_cmd_ctrl() Sam Lefebvre
2018-04-20 8:19 ` [PATCH 17/18] mtd: rawnand: gpmi: gpmi_nand_command(): use separate sgl for the two commands Sam Lefebvre
2018-04-20 8:19 ` [PATCH 18/18] mtd: rawnand: gpmi: issue two commands in a single DMA chain Sam Lefebvre
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=20180423120535.70fdc6bb@bbrezillon \
--to=boris.brezillon@bootlin.com \
--cc=arnout@mind.be \
--cc=han.xu@nxp.com \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=sam.lefebvre@essensium.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).