All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
To: Zhiqiang Hou <Zhiqiang.Hou@nxp.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	computersforpeace@gmail.com, dwmw2@infradead.org,
	boris.brezillon@free-electrons.com, marek.vasut@gmail.com,
	richard@nod.at
Subject: Re: [PATCHv3 2/2] mtd: m25p80: restore the status of SPI flash when exiting
Date: Tue, 12 Dec 2017 14:19:31 +0100	[thread overview]
Message-ID: <f5eb3dfe-0b3e-4224-8bf2-9567918d30cc@wedev4u.fr> (raw)
In-Reply-To: <20171206025342.7266-3-Zhiqiang.Hou@nxp.com>

Le 06/12/2017 à 03:53, Zhiqiang Hou a écrit :
> From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
> 
> Restore the status to be compatible with legacy devices.
> Take Freescale eSPI boot for example, it copies (in 3 Byte
> addressing mode) the RCW and bootloader images from SPI flash
> without firing a reset signal previously, so the reboot command
> will fail without reseting the addressing mode of SPI flash.
resetting

> This patch implement .shutdown function to restore the status
implements
> in reboot process, and add the same operation to the .remove
> function.
> 
> Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>

Applied to the spi-nor/next branch of l2-mtd

Thanks!

(corrected few mistakes in the commit message)
> ---
> V3:
>  - Modified the commit to make this patch specific.
> 
>  drivers/mtd/devices/m25p80.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index dbe6a1de2bb8..a4e18f6aaa33 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -307,10 +307,18 @@ static int m25p_remove(struct spi_device *spi)
>  {
>  	struct m25p	*flash = spi_get_drvdata(spi);
>  
> +	spi_nor_restore(&flash->spi_nor);
> +
>  	/* Clean up MTD stuff. */
>  	return mtd_device_unregister(&flash->spi_nor.mtd);
>  }
>  
> +static void m25p_shutdown(struct spi_device *spi)
> +{
> +	struct m25p *flash = spi_get_drvdata(spi);
> +
> +	spi_nor_restore(&flash->spi_nor);
> +}
>  /*
>   * Do NOT add to this array without reading the following:
>   *
> @@ -386,6 +394,7 @@ static struct spi_driver m25p80_driver = {
>  	.id_table	= m25p_ids,
>  	.probe	= m25p_probe,
>  	.remove	= m25p_remove,
> +	.shutdown	= m25p_shutdown,
>  
>  	/* REVISIT: many of these chips have deep power-down modes, which
>  	 * should clearly be entered on suspend() to minimize power use.
> 

  reply	other threads:[~2017-12-12 13:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06  2:53 [PATCHv3 0/2] mtd: m25p80: restore the addressing mode when exiting Zhiqiang Hou
2017-12-06  2:53 ` [PATCHv3 1/2] mtd: spi-nor: add an API to restore the status of SPI flash chip Zhiqiang Hou
2017-12-12 13:12   ` Cyrille Pitchen
2017-12-06  2:53 ` [PATCHv3 2/2] mtd: m25p80: restore the status of SPI flash when exiting Zhiqiang Hou
2017-12-12 13:19   ` Cyrille Pitchen [this message]
2018-07-23 18:13   ` Brian Norris
2018-07-23 20:10     ` Boris Brezillon
2018-07-23 22:06       ` Brian Norris
2018-07-23 22:46         ` NeilBrown
2018-07-23 23:22           ` Boris Brezillon
2018-07-24  1:51             ` NeilBrown
2018-07-24 19:41               ` Brian Norris
2018-07-24 21:48                 ` NeilBrown
2018-07-25 23:24                   ` Brian Norris
2018-07-23 23:18         ` Boris Brezillon
2018-07-24 19:52           ` Brian Norris
2018-07-24 19:59             ` 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=f5eb3dfe-0b3e-4224-8bf2-9567918d30cc@wedev4u.fr \
    --to=cyrille.pitchen@wedev4u.fr \
    --cc=Zhiqiang.Hou@nxp.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.