public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Ronak Desai <ronak.desai@rockwellcollins.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
	Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>,
	"linux-mtd @ lists . infradead . org"
	<linux-mtd@lists.infradead.org>
Subject: Re: [PATCH] Added set feature command in FSL IFC nand controller driver for ONFI nand
Date: Tue, 24 Apr 2018 19:37:58 +0200	[thread overview]
Message-ID: <20180424193758.57ae5547@bbrezillon> (raw)
In-Reply-To: <CADFuHZ5f4+jjVazc-0Q2qXmHWXnxXPSjdnmRtYue1-BvT02s4g@mail.gmail.com>

Hi Ronak,

I'm jumping on this discussion to clarify a few things.

On Tue, 24 Apr 2018 12:10:07 -0500
Ronak Desai <ronak.desai@rockwellcollins.com> wrote:

> >> >> >> +
> >> >> >> +     for (i = 0; i < ONFI_SUBFEATURE_PARAM_LEN; ++i)
> >> >> >> +             chip->write_byte(mtd, subfeature_param[i]);
> >> >> >> +
> >> >> >> +     chip->cmdfunc(mtd, NAND_CMD_SET_FEATURES, addr, 0);  
> >
> > And this implementation does the opposite :)  
> No, this is not opposite, I am just copying the data in the nand
> controller data buffer and not sending on the bus and when the
> NAND_CMD_SET_FEATURES is called, in that I tell nand controller to
> transfer 4 bytes from data buffer after sending the set feature
> command. So, on the bus the sequence will be same as depicted in the
> ONFI specification. I have tested this on two different target
> hardwares with processors having this nand controller.

The ->cmdfunc() semantic has been abused for too long by too many
drivers, let's stop this insanity. ->cmdfunc() has been designed to
send CMD and ADDR cycles on the NAND bus, not to trigger the actual
data transfer. You might think this is a bad design (and I partially
agree that things were not perfect), but that's how it is. This being
said, we now have a clean way for drivers to get all information at
once (CMD, ADDR and DATA cycles) and it's called ->exec_op().

If you don't want to patch the driver to support ->exec_op(), I can
consider accepting a temporary solution where the whole SET_FEATURES
handling is done in fsl_ifc_onfi_set_features() (that is, moving the
code you have in the 'case NAND_CMD_SET_FEATURES' in the
fsl_ifc_onfi_set_features() function so that you don't call ->cmdfunc()
at all), but I'd really prefer to have the driver converted to
->exec_op(), and I think we (Miquel and I) can help with that.

BTW, you implement ->set_features() but ->get_features() is not
supported??!! This sounds like a bad idea to me...

Regards,

Boris

  reply	other threads:[~2018-04-24 17:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 19:10 [PATCH] Added set feature command in FSL IFC nand controller driver for ONFI nand Ronak Desai
2018-04-22 17:07 ` Miquel Raynal
2018-04-23 19:55   ` Ronak Desai
2018-04-24  9:56     ` Miquel Raynal
2018-04-24 13:51       ` Ronak Desai
2018-04-24 14:00         ` Miquel Raynal
2018-04-24 17:10           ` Ronak Desai
2018-04-24 17:37             ` Boris Brezillon [this message]
2018-04-25 13:56               ` Ronak Desai

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=20180424193758.57ae5547@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=prabhakar.kushwaha@nxp.com \
    --cc=ronak.desai@rockwellcollins.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