All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Branden <sbranden@broadcom.com>
To: Brian Norris <computersforpeace@gmail.com>,
	<linux-mtd@lists.infradead.org>
Cc: cdoban@broadcom.com, rjui@broadcom.com
Subject: Re: [PATCH 2/3] mtd: nand: added nand_shutdown
Date: Fri, 5 Dec 2014 09:47:07 -0800	[thread overview]
Message-ID: <5481EF9B.8070601@broadcom.com> (raw)
In-Reply-To: <1417746968-28747-2-git-send-email-computersforpeace@gmail.com>

On 14-12-04 06:36 PM, Brian Norris wrote:
> From: Scott Branden <sbranden@broadcom.com>
>
> Add nand_shutdown to wait for current nand operations to finish and prevent
> further operations by changing the nand flash state to FL_SHUTDOWN.
>
> This is addressing a problem observed during reboot tests using UBIFS
> root file system: NAND erase operations that are in progress during
> system reboot/shutdown are causing partial erased blocks. Although UBI should
> be able to detect and recover from this error, this change will avoid
> the creation of partial erased blocks on reboot in the middle of a NAND erase
> operation.
>
> Signed-off-by: Scott Branden <sbranden@broadcom.com>
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> ---
> Modified to use the new mtd->_reboot hook
>
> Not tested yet
Tested by: Scott Branden <sbranden@broadcom.com>
>
>   drivers/mtd/nand/nand_base.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
>
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 41585dfb206f..382354b5547b 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -2944,6 +2944,16 @@ static void nand_resume(struct mtd_info *mtd)
>   			__func__);
>   }
>
> +/**
> + * nand_shutdown - [MTD Interface] Finish the current NAND operation and
> + *                 prevent further operations
> + * @mtd: MTD device structure
> + */
> +static void nand_shutdown(struct mtd_info *mtd)
> +{
> +	nand_get_device(mtd, FL_SHUTDOWN);
> +}
> +
>   /* Set default functions */
>   static void nand_set_defaults(struct nand_chip *chip, int busw)
>   {
> @@ -4146,6 +4156,7 @@ int nand_scan_tail(struct mtd_info *mtd)
>   	mtd->_unlock = NULL;
>   	mtd->_suspend = nand_suspend;
>   	mtd->_resume = nand_resume;
> +	mtd->_reboot = nand_shutdown;
>   	mtd->_block_isreserved = nand_block_isreserved;
>   	mtd->_block_isbad = nand_block_isbad;
>   	mtd->_block_markbad = nand_block_markbad;
>

  reply	other threads:[~2014-12-05 17:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05  2:36 [PATCH 1/3] mtd: implement common reboot notifier boilerplate Brian Norris
2014-12-05  2:36 ` [PATCH 2/3] mtd: nand: added nand_shutdown Brian Norris
2014-12-05 17:47   ` Scott Branden [this message]
2014-12-05  2:36 ` [PATCH 3/3] mtd: cfi_cmdset_{0001, 0002}: use common MTD reboot boilerplate Brian Norris
2015-11-02 20:05   ` [3/3] " Guenter Roeck
2015-11-02 21:58     ` Brian Norris
2015-11-02 22:05       ` Brian Norris
2015-11-02 22:16       ` Guenter Roeck
2015-11-02 23:21         ` Brian Norris
2015-11-03  1:00           ` Guenter Roeck
2014-12-05  6:48 ` [PATCH 1/3] mtd: implement common reboot notifier boilerplate Scott Branden
2014-12-05 18:07   ` Brian Norris
2014-12-10  0:02     ` Scott Branden
2014-12-10  0:07       ` Richard Weinberger
2015-01-08  1:58 ` Brian Norris
2015-01-14  0:43   ` Scott Branden

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=5481EF9B.8070601@broadcom.com \
    --to=sbranden@broadcom.com \
    --cc=cdoban@broadcom.com \
    --cc=computersforpeace@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=rjui@broadcom.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 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.