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: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
Subject: Re: [PATCH] mtd: nand: Support 'EXIT GET STATUS' command in nand_command_lp()
Date: Mon, 29 May 2017 20:50:37 +0200	[thread overview]
Message-ID: <20170529205037.7a3f7cb2@bbrezillon> (raw)
In-Reply-To: <1494952545-5089-1-git-send-email-boris.brezillon@free-electrons.com>

On Tue, 16 May 2017 18:35:45 +0200
Boris Brezillon <boris.brezillon@free-electrons.com> wrote:

> READ0 is sometimes used to exit GET STATUS mode. When this is the case
> no address cycles are requested, and we can use this information to
> detect that READSTART should not be issued after READ0 or that we
> shouldn't wait for the chip to be ready.
> 

Applied to nand/next.

> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> ---
>  drivers/mtd/nand/nand_base.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 08ff98c47e1f..fe87bd3513fa 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -753,6 +753,16 @@ static void nand_command(struct mtd_info *mtd, unsigned int command,
>  		return;
>  
>  		/* This applies to read commands */
> +	case NAND_CMD_READ0:
> +		/*
> +		 * READ0 is sometimes used to exit GET STATUS mode. When this
> +		 * is the case no address cycles are requested, and we can use
> +		 * this information to detect that we should not wait for the
> +		 * device to be ready.
> +		 */
> +		if (column == -1 && page_addr == -1)
> +			return;
> +
>  	default:
>  		/*
>  		 * If we don't have access to the busy pin, we apply the given
> @@ -887,6 +897,15 @@ static void nand_command_lp(struct mtd_info *mtd, unsigned int command,
>  		return;
>  
>  	case NAND_CMD_READ0:
> +		/*
> +		 * READ0 is sometimes used to exit GET STATUS mode. When this
> +		 * is the case no address cycles are requested, and we can use
> +		 * this information to detect that READSTART should not be
> +		 * issued.
> +		 */
> +		if (column == -1 && page_addr == -1)
> +			return;
> +
>  		chip->cmd_ctrl(mtd, NAND_CMD_READSTART,
>  			       NAND_NCE | NAND_CLE | NAND_CTRL_CHANGE);
>  		chip->cmd_ctrl(mtd, NAND_CMD_NONE,

      parent reply	other threads:[~2017-05-29 18:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 16:35 [PATCH] mtd: nand: Support 'EXIT GET STATUS' command in nand_command_lp() Boris Brezillon
2017-05-17 16:02 ` Thomas Petazzoni
2017-05-29 18:50 ` 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=20170529205037.7a3f7cb2@bbrezillon \
    --to=boris.brezillon@free-electrons.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=richard@nod.at \
    --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