linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Rickard X Andersson <Rickard.Andersson@axis.com>
Subject: Re: [PATCH 2/2] mtd: rawnand: Add timings for Kioxia TH58NVG2S3HBAI4
Date: Wed, 20 May 2020 17:12:46 +0200	[thread overview]
Message-ID: <20200520171246.538823eb@xps13> (raw)
In-Reply-To: <20200520165022.1e241604@collabora.com>

Hi Boris,

Boris Brezillon <boris.brezillon@collabora.com> wrote on Wed, 20 May
2020 16:50:22 +0200:

> On Wed, 20 May 2020 14:42:31 +0000
> Rickard X Andersson <Rickard.Andersson@axis.com> wrote:
> 
> > > > If I understand you correctly you want me to use onfi_find_equivalent_sdr_mode in order to find the corresponding onfi mode. Then you want me to use onfi_fill_data_interface and loop towards mode 0 checking which mode the controller accepts? I just thought it was a "messy" to duplicate this code in all vendor drivers.
> > > > Or do you mean that I should just use onfi_find_equivalent_sdr_mode to set ."timings.mode" and let nand_base to do the looping in case error is returned from th58nvg2s3hbai4_choose_data_interface (i.e specialized timings not accepted by the controller).    
> > >
> > > Sorry for the misunderstanding. What I think you should try is:
> > > 1/ call onfi_find_equivalent_sdr_mode() to set the timings.mode field.
> > > 2/ call nand_controller_supports_data_interface()
> > > 3/ if the controller supports the timings, set
> > > chip->default_timing_mode accordingly and return 0.  
> 
> Why do we have to set the default_timing_mode field? Can't we just set
> timings.mode directly?
> 
> > > 4/ if the controller does not support the timings, you may want to
> > > propose other standard timings to test by setting
> > > chip->default_timing_mode anyway but returning an error which means
> > > "best interface has not been found yet" so the rest of the
> > > choose_data_interface() helper will try the remaining ONFI modes
> > > automatically (fallbacks to 0 anyway).  
> 
> Again, I don't see why setting chip->default_timing_mode is needed here,
> and I'm not sure trying remaining ONFI modes is useful, I guess we can
> just fall back on mode 0 in that case.

It is needed because of the logic in nand_reset() which does not apply
the data interface after a reset if this field is null.

Otherwise I also wondered if falling back to regular ONFI mode was
useful. If this is not, we can just return after the call to
chip->ops.choose_data_interface().

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2020-05-20 15:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20 13:32 SV: [PATCH 2/2] mtd: rawnand: Add timings for Kioxia TH58NVG2S3HBAI4 Rickard X Andersson
2020-05-20 13:43 ` Miquel Raynal
2020-05-20 14:16   ` SV: " Rickard X Andersson
2020-05-20 14:29     ` Miquel Raynal
2020-05-20 14:42       ` SV: " Rickard X Andersson
2020-05-20 14:50         ` Boris Brezillon
2020-05-20 15:12           ` Miquel Raynal [this message]
2020-05-20 15:26             ` Boris Brezillon
2020-05-20 20:43               ` Miquel Raynal
2020-05-20 20:57                 ` Boris Brezillon
     [not found] <richard@nod.at;>
2020-05-14  9:13 ` [PATCH 1/2] mtd: rawnand: Use the ->init_data_interface() hook Rickard Andersson
2020-05-14  9:13   ` [PATCH 2/2] mtd: rawnand: Add timings for Kioxia TH58NVG2S3HBAI4 Rickard Andersson
2020-05-19 12:08     ` Miquel Raynal

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=20200520171246.538823eb@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=Rickard.Andersson@axis.com \
    --cc=bbrezillon@kernel.org \
    --cc=boris.brezillon@collabora.com \
    --cc=linux-mtd@lists.infradead.org \
    /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).