public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <bbrezillon@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Marek Vasut <marek.vasut@gmail.com>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	linux-mtd@lists.infradead.org,
	Richard Weinberger <richard@nod.at>
Subject: Re: [PATCH 1/2] mtd: rawnand: fsmc: Reset NAND timings on resume()
Date: Mon, 21 Jan 2019 09:20:33 +0100	[thread overview]
Message-ID: <20190121092033.68d5a2ed@bbrezillon> (raw)
In-Reply-To: <20190118210604.8231-1-linus.walleij@linaro.org>

On Fri, 18 Jan 2019 22:06:04 +0100
Linus Walleij <linus.walleij@linaro.org> wrote:

> When we go through a suspend/resume cycle the NAND
> timings may have been lost so reset the chip.

Actually, it's not only about resetting the timings (even if the side
effect of calling nand_reset() is that the core re-applies the
correct timings through ->setup_data_interface()). We need it to start
in a known working state.

> 
> This hardware will autonomously enable/disable the
> chip selects depending on what memory is accessed and
> chip selects are not software controlled, so we
> only lass chip select "0" for "all chips".

The FSMC driver only supports single CS chips which explain why you
only have to call nand_reset(chip, 0).

> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/mtd/nand/raw/fsmc_nand.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c
> index c9149a37f8f0..4050843dd35e 100644
> --- a/drivers/mtd/nand/raw/fsmc_nand.c
> +++ b/drivers/mtd/nand/raw/fsmc_nand.c
> @@ -1164,6 +1164,7 @@ static int fsmc_nand_resume(struct device *dev)
>  		clk_prepare_enable(host->clk);
>  		if (host->dev_timings)
>  			fsmc_nand_setup(host, host->dev_timings);
> +		nand_reset(&host->nand, 0);
>  	}
>  
>  	return 0;


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2019-01-21  8:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18 21:06 [PATCH 1/2] mtd: rawnand: fsmc: Reset NAND timings on resume() Linus Walleij
2019-01-21  8:20 ` Boris Brezillon [this message]
2019-01-25 13:07 ` Miquel Raynal

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=20190121092033.68d5a2ed@bbrezillon \
    --to=bbrezillon@kernel.org \
    --cc=computersforpeace@gmail.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 \
    /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