linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Mason Yang <masonccyang@mxic.com.tw>
Cc: richard@nod.at, marek.vasut@gmail.com, dwmw2@infradead.org,
	bbrezillon@kernel.org, computersforpeace@gmail.com,
	vigneshr@ti.com, juliensu@mxic.com.tw,
	linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org
Subject: Re: [PATCH v2 3/4] mtd: rawnand: Add support manufacturer specific suspend/resume operation
Date: Thu, 9 Jan 2020 17:53:18 +0100	[thread overview]
Message-ID: <20200109175318.73ab8bd7@xps13> (raw)
In-Reply-To: <1572256527-5074-4-git-send-email-masonccyang@mxic.com.tw>

Hi Mason,

Mason Yang <masonccyang@mxic.com.tw> wrote on Mon, 28 Oct 2019 17:55:26
+0800:

> Patch nand_suspend() & nand_resume() for manufacturer specific
> suspend/resume operation.
> 
> Signed-off-by: Mason Yang <masonccyang@mxic.com.tw>
> ---
>  drivers/mtd/nand/raw/nand_base.c | 9 +++++++--
>  include/linux/mtd/rawnand.h      | 2 ++
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
> index 5e318ff..2a9c5bb 100644
> --- a/drivers/mtd/nand/raw/nand_base.c
> +++ b/drivers/mtd/nand/raw/nand_base.c
> @@ -4323,6 +4323,8 @@ static int nand_suspend(struct mtd_info *mtd)
>  	struct nand_chip *chip = mtd_to_nand(mtd);
>  
>  	mutex_lock(&chip->lock);
> +	if (chip->_suspend)
> +		chip->_suspend(chip);

Return value should be checked!

>  	chip->suspended = 1;
>  	mutex_unlock(&chip->lock);
>  
> @@ -4338,11 +4340,14 @@ static void nand_resume(struct mtd_info *mtd)
>  	struct nand_chip *chip = mtd_to_nand(mtd);
>  
>  	mutex_lock(&chip->lock);
> -	if (chip->suspended)
> +	if (chip->suspended) {
> +		if (chip->_resume)
> +			chip->_resume(chip);
>  		chip->suspended = 0;
> -	else
> +	} else {
>  		pr_err("%s called for a chip which is not in suspended state\n",
>  			__func__);
> +	}
>  	mutex_unlock(&chip->lock);
>  }
>  
> diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
> index 2430ecd..6b14041 100644
> --- a/include/linux/mtd/rawnand.h
> +++ b/include/linux/mtd/rawnand.h
> @@ -1117,6 +1117,8 @@ struct nand_chip {
>  
>  	struct mutex lock;
>  	unsigned int suspended : 1;
> +	int (*_suspend)(struct nand_chip *chip);
> +	void (*_resume)(struct nand_chip *chip);

Please don't forget the kdoc!

>  
>  	uint8_t *oob_poi;
>  	struct nand_controller *controller;

With this fixed,
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


Thanks,
Miquèl

  parent reply	other threads:[~2020-01-09 16:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-28  9:55 [PATCH v2 0/4] mtd: rawnand: Add support Macronix Block Protection & deep power down mode Mason Yang
2019-10-28  9:55 ` [PATCH v2 1/4] mtd: rawnand: Add support manufacturer specific lock/unlock operatoin Mason Yang
2019-10-30  3:22   ` kbuild test robot
2020-01-09 16:41   ` Miquel Raynal
2020-02-17  8:05     ` masonccyang
2020-01-09 19:30   ` Boris Brezillon
2020-02-17  8:14     ` masonccyang
2020-02-17  9:01       ` Miquel Raynal
2020-02-17  9:22         ` Boris Brezillon
2020-02-18  3:13         ` masonccyang
2019-10-28  9:55 ` [PATCH v2 2/4] mtd: rawnand: Add support Macronix Block Protection function Mason Yang
2020-01-09 16:47   ` Miquel Raynal
2020-02-17  8:24     ` masonccyang
2019-10-28  9:55 ` [PATCH v2 3/4] mtd: rawnand: Add support manufacturer specific suspend/resume operation Mason Yang
2019-10-30  5:56   ` kbuild test robot
2020-01-09 16:53   ` Miquel Raynal [this message]
2019-10-28  9:55 ` [PATCH v2 4/4] mtd: rawnand: Add support Macronix deep power down mode Mason Yang
2019-10-31  7:36   ` kbuild test robot
2019-10-31  7:36   ` [RFC PATCH] mtd: rawnand: nand_power_down_op() can be static kbuild test robot
2020-01-09 17:01   ` [PATCH v2 4/4] mtd: rawnand: Add support Macronix deep power down mode Miquel Raynal
2020-02-21  2:44     ` masonccyang

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=20200109175318.73ab8bd7@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=bbrezillon@kernel.org \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=juliensu@mxic.com.tw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=masonccyang@mxic.com.tw \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.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;
as well as URLs for NNTP newsgroup(s).