public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Miquel Raynal <miquel.raynal@free-electrons.com>
Cc: han.xu@nxp.com, richard@nod.at, linux-mtd@lists.infradead.org,
	dwmw2@infradead.org, computersforpeace@gmail.com,
	marek.vasut@gmail.com, cyrille.pitchen@wedev4u.fr,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: gpmi-nand: do not fail setting ONFI timing mode if available
Date: Thu, 13 Jul 2017 22:15:20 +0200	[thread overview]
Message-ID: <20170713221520.268bc554@bbrezillon> (raw)
In-Reply-To: <20170713192030.22177-1-miquel.raynal@free-electrons.com>

Hi Miquel,

Le Thu, 13 Jul 2017 21:20:30 +0200,
Miquel Raynal <miquel.raynal@free-electrons.com> a écrit :

> GPMI NFC driver fails to apply timing mode if the ->onfi_get_features()
> does not return the mode that was previously applied.
> 
> We can assume that a nand chip supports a timing as long as it is
> read from the ONFI parameter page. Reading back a different mode than
> the one previously applied does not mean the mode is unsupported but
> that the nand chip does not implement the ONFI feature because it
> probably does not need to.
> 
> The output of ->onfi_get_feature() is irrelevant so delete it.

Having the NAND part that is not supporting the get/set(timing_mode)
feature explicitly mentioned in the commit message would help reviewers
understand why this patch is needed.

Also mention that, even though the SET/GET_FEATURES(timing_mode) is
marked as required in the ONFI spec, this Macronix chip does not
support it which could be considered as a bug.

Regards,

Boris

> 
> Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
> ---
>  drivers/mtd/nand/gpmi-nand/gpmi-lib.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
> index 141bd70a49c2..4d137145439c 100644
> --- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
> @@ -939,13 +939,6 @@ static int enable_edo_mode(struct gpmi_nand_data *this, int mode)
>  	if (ret)
>  		goto err_out;
>  
> -	/* [2] send GET FEATURE command to double-check the timing mode */
> -	memset(feature, 0, ONFI_SUBFEATURE_PARAM_LEN);
> -	ret = nand->onfi_get_features(mtd, nand,
> -				ONFI_FEATURE_ADDR_TIMING_MODE, feature);
> -	if (ret || feature[0] != mode)
> -		goto err_out;
> -
>  	nand->select_chip(mtd, -1);
>  
>  	/* [3] set the main IO clock, 100MHz for mode 5, 80MHz for mode 4. */

  reply	other threads:[~2017-07-13 20:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 19:20 [PATCH] mtd: gpmi-nand: do not fail setting ONFI timing mode if available Miquel Raynal
2017-07-13 20:15 ` Boris Brezillon [this message]
2017-07-14 14:53   ` Han Xu
2017-07-14 17:31     ` Boris Brezillon
2017-07-15 10:52       ` Miquel RAYNAL
2017-07-15 12:47         ` 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=20170713221520.268bc554@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=dwmw2@infradead.org \
    --cc=han.xu@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=miquel.raynal@free-electrons.com \
    --cc=richard@nod.at \
    /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