public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Richard Weinberger <richard@nod.at>,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Cyrille Pitchen <cyrille.pitchen@atmel.com>,
	linux-mtd@lists.infradead.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Stefan Roese <sr@denx.de>
Subject: Re: [PATCH 02/13] mtd: nand: fsmc: rework fsmc_nand_setup() to use ->setup_data_interface()
Date: Wed, 22 Mar 2017 23:23:33 +0100	[thread overview]
Message-ID: <20170322232333.23ae18ab@bbrezillon> (raw)
In-Reply-To: <20170322230553.5daf0562@free-electrons.com>

On Wed, 22 Mar 2017 23:05:53 +0100
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:

> Hello,
> 
> On Wed, 22 Mar 2017 22:56:17 +0100, Boris Brezillon wrote:
> 
> > I'm not sure this is such a good idea to move default and DT timings
> > setting in the ->setup_data_interface() hook.
> > 
> > ONFI NANDs are changing an internal parameter to switch to a specific
> > timing mode. If you let the core think that you configured the
> > controller to support this timing mode, while you actually configured
> > it with the default or DT timings it might not work as expected.  
> 
> So what do you suggest to keep the compatibility with the existing DT
> binding for this NAND controller?

We have 2 choices here:
1/ drop the old/static timings config and only rely on the dynamic
   config. This is a bit risky, because we've only tested the new
   timing conversion logic on one board.
2/ keep both solutions around until all boards have switched to the new
   solution. In this case, you'll only set the ->setup_data_interface()
   hook if timings are not defined in the DT

> 
> We also need to take into account that the timings need to be
> reconfigured upon ->resume().

Yes, I know, and I also know how painful it is to add extra code for
backward compat, but I think abusing ->setup_data_interface() is even
worse.

To sum-up, if we go for solution #2, in your resume you'll have to
conditionally call the legacy timing setup logic (only if timings are
defined in the DT) in addition to the nand_reset() call.

  reply	other threads:[~2017-03-22 22:24 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 10:03 [PATCH 00/13] mtd: nand: fsmc: fixes, improvements and cleanups Thomas Petazzoni
2017-03-21 10:03 ` [PATCH 01/13] mtd: nand: fsmc: fix NAND width handling Thomas Petazzoni
2017-03-22 21:42   ` Boris Brezillon
2017-03-22 22:06     ` Thomas Petazzoni
2017-03-23  9:53   ` Linus Walleij
2017-03-21 10:03 ` [PATCH 02/13] mtd: nand: fsmc: rework fsmc_nand_setup() to use ->setup_data_interface() Thomas Petazzoni
2017-03-22 21:56   ` Boris Brezillon
2017-03-22 22:05     ` Thomas Petazzoni
2017-03-22 22:23       ` Boris Brezillon [this message]
2017-03-22 22:39         ` Thomas Petazzoni
2017-03-22 22:53           ` Boris Brezillon
2017-03-23  9:57   ` Linus Walleij
2017-03-21 10:03 ` [PATCH 03/13] mtd: nand: fsmc: add support to use NAND timings Thomas Petazzoni
2017-03-23  9:59   ` Linus Walleij
2017-03-21 10:03 ` [PATCH 04/13] mtd: nand: fsmc: move fsmc_nand_data definition Thomas Petazzoni
2017-03-23 10:00   ` Linus Walleij
2017-03-21 10:03 ` [PATCH 05/13] mtd: nand: fsmc: remove ->select_bank() from fsmc_nand_platform_data Thomas Petazzoni
2017-03-23 10:00   ` Linus Walleij
2017-03-21 10:03 ` [PATCH 06/13] mtd: nand: fsmc: remove fsmc_select_chip() Thomas Petazzoni
2017-03-23 10:01   ` Linus Walleij
2017-03-21 10:03 ` [PATCH 07/13] mtd: nand: fmsc: kill {read, write}_dma_priv from fsmc_nand_platform_data Thomas Petazzoni
2017-03-23 10:02   ` Linus Walleij
2017-03-21 10:04 ` [PATCH 08/13] mtd: nand: fsmc: kill {nr_, }partitions structure fields Thomas Petazzoni
2017-03-23 10:03   ` Linus Walleij
2017-03-21 10:04 ` [PATCH 09/13] mtd: nand: fsmc: remove duplicate nand_set_flash_node() Thomas Petazzoni
2017-03-23 10:04   ` Linus Walleij
2017-03-21 10:04 ` [PATCH 10/13] mtd: nand: fsmc: finally remove fsmc_nand_platform_data Thomas Petazzoni
2017-03-23 10:05   ` Linus Walleij
2017-03-21 10:04 ` [PATCH 11/13] mtd: nand: fsmc: use devm_clk_get() Thomas Petazzoni
2017-03-23 10:05   ` Linus Walleij
2017-03-21 10:04 ` [PATCH 12/13] mtd: nand: fsmc: remove unused definitions Thomas Petazzoni
2017-03-23 10:06   ` Linus Walleij
2017-03-21 10:04 ` [PATCH 13/13] mtd: nand: fsmc: remove CONFIG_OF conditional Thomas Petazzoni
2017-03-22 22:01   ` Boris Brezillon
2017-03-23 10:07   ` Linus Walleij
2017-03-23  9:50 ` [PATCH 00/13] mtd: nand: fsmc: fixes, improvements and cleanups Linus Walleij
2017-03-23  9:52   ` Thomas Petazzoni
2017-03-24  8:26 ` 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=20170322232333.23ae18ab@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@atmel.com \
    --cc=dwmw2@infradead.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=richard@nod.at \
    --cc=sr@denx.de \
    --cc=thomas.petazzoni@free-electrons.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