public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Boris Brezillon <boris.brezillon@free-electrons.com>,
	Richard Weinberger <richard@nod.at>,
	linux-mtd@lists.infradead.org
Cc: David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
	Alexander Dahl <ada@thorsis.com>,
	Miquel Raynal <miquel.raynal@free-electrons.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] mtd: nand: Fix timing setup for NANDs that do not support SET FEATURES
Date: Mon, 31 Jul 2017 18:28:26 +0200	[thread overview]
Message-ID: <20170731182826.7c2a45a6@bbrezillon> (raw)
In-Reply-To: <1501489796-7264-1-git-send-email-boris.brezillon@free-electrons.com>

On Mon, 31 Jul 2017 10:29:56 +0200
Boris Brezillon <boris.brezillon@free-electrons.com> wrote:

> Some ONFI NANDs do not support the SET/GET FEATURES commands, which,
> according to the spec, is perfectly valid.
> 
> On these NANDs we can't set a specific timing mode using the "timing
> mode" feature, and we should assume the NAND does not require any setup
> to enter a specific timing mode.

Applied to nand/fixes.

> 
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> Fixes: d8e725dd8311 ("mtd: nand: automate NAND timings selection")
> Reported-by: Alexander Dahl <ada@thorsis.com>
> Cc: <stable@vger.kernel.org>
> ---
>  drivers/mtd/nand/nand_base.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 7b3826b42447..f2bd2c00a8a1 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -1131,7 +1131,9 @@ static int nand_setup_data_interface(struct nand_chip *chip, int chipnr)
>  	 * Ensure the timing mode has been changed on the chip side
>  	 * before changing timings on the controller side.
>  	 */
> -	if (chip->onfi_version) {
> +	if (chip->onfi_version &&
> +	    (le16_to_cpu(chip->onfi_params.opt_cmd) &
> +	     ONFI_OPT_CMD_SET_GET_FEATURES)) {
>  		u8 tmode_param[ONFI_SUBFEATURE_PARAM_LEN] = {
>  			chip->onfi_timing_mode_default,
>  		};

      parent reply	other threads:[~2017-07-31 16:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-31  8:29 [PATCH] mtd: nand: Fix timing setup for NANDs that do not support SET FEATURES Boris Brezillon
2017-07-31 11:52 ` Alexander Dahl
2017-07-31 16:28 ` Boris Brezillon [this message]

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=20170731182826.7c2a45a6@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=ada@thorsis.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=miquel.raynal@free-electrons.com \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.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