From: Rickard X Andersson <Rickard.Andersson@axis.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
Boris Brezillon <bbrezillon@kernel.org>
Subject: SV: [PATCH 2/2] mtd: rawnand: Add timings for Kioxia TH58NVG2S3HBAI4
Date: Wed, 20 May 2020 14:42:31 +0000 [thread overview]
Message-ID: <1589985750394.77181@axis.com> (raw)
In-Reply-To: <20200520162936.6eb499fb@xps13>
> > 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.
> 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).
Thanks! Now I understand, will fix this on monday.
BR
Rickard
________________________________________
Från: Miquel Raynal <miquel.raynal@bootlin.com>
Skickat: den 20 maj 2020 16:29
Till: Rickard X Andersson
Kopia: linux-mtd@lists.infradead.org; Boris Brezillon
Ämne: Re: [PATCH 2/2] mtd: rawnand: Add timings for Kioxia TH58NVG2S3HBAI4
Hi Rickard,
Rickard X Andersson <Rickard.Andersson@axis.com> wrote on Wed, 20 May
2020 14:16:57 +0000:
> > > I have created a new patchset that I will send shortly. This patchset does however not use onfi_find_equivalent_sdr_mode(..), that could be a future improvment. My patchset falls back to mode 0 if the specialized timings does not work for the controller.
> >
> > Thanks for updating!
> >
> > Actually I wrote it because of a previous discussion with Boris who
> > told me that this mode field would be badly understood and he actually
> > got it right as in your previous submission this field was set to 0
> > while, IIRC, you told me it was close to mode 3. This is important to
> > controllers that cannot tweak the parameters but just pick an ONFI
> > mode. So the timings they choose must fit the slowest mins and fastest
> > maxs of your new set of timings. Hence the use of the helper which
> > seems needed. It is actually pretty straightforward so I don't
> > understand your choice of not making use of it?
> >
> > As this is the primary contribution of this type, I would like to get
> > it right so that other contributors can refer to it :)
>
> 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.
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).
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2020-05-20 14:42 UTC|newest]
Thread overview: 10+ 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 ` Rickard X Andersson [this message]
2020-05-20 14:50 ` Boris Brezillon
2020-05-20 15:12 ` Miquel Raynal
2020-05-20 15:26 ` Boris Brezillon
2020-05-20 20:43 ` Miquel Raynal
2020-05-20 20:57 ` Boris Brezillon
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=1589985750394.77181@axis.com \
--to=rickard.andersson@axis.com \
--cc=bbrezillon@kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.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).