From: Boris Brezillon <boris.brezillon@collabora.com>
To: Mason Yang <masonccyang@mxic.com.tw>
Cc: vigneshr@ti.com, bbrezillon@kernel.org, juliensu@mxic.com.tw,
richard@nod.at, s.hauer@pengutronix.de, yuehaibing@huawei.com,
linux-kernel@vger.kernel.org, stefan@agner.ch,
rfontana@redhat.com, linux-mtd@lists.infradead.org,
frieder.schrempf@kontron.de, miquel.raynal@bootlin.com,
tglx@linutronix.de, allison@lohutok.net
Subject: Re: [PATCH v3 1/4] mtd: rawnand: Add support manufacturer specific lock/unlock operation
Date: Tue, 10 Mar 2020 20:27:23 +0100 [thread overview]
Message-ID: <20200310202723.16b48f4b@collabora.com> (raw)
In-Reply-To: <1583220084-10890-2-git-send-email-masonccyang@mxic.com.tw>
On Tue, 3 Mar 2020 15:21:21 +0800
Mason Yang <masonccyang@mxic.com.tw> wrote:
> Add nand_lock() & nand_unlock() for manufacturer specific lock & unlock
> operation while the device supports Block Portection function.
>
> Signed-off-by: Mason Yang <masonccyang@mxic.com.tw>
> Reported-by: kbuild test robot <lkp@intel.com>
Reported-by on something that's not a fix doesn't make sense. I know
the 0day bot asked you to add this tag, but that should only be done if
you submit a separate patch, ideally with a Fixes tag. If the offending
patch has not been merged yet, you should just fix the commit and ignore
the Reported-by tag (you can mention who reported the problem in the
changelog though).
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
> drivers/mtd/nand/raw/nand_base.c | 36 ++++++++++++++++++++++++++++++++++--
> include/linux/mtd/rawnand.h | 5 +++++
> 2 files changed, 39 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
> index f64e3b6..769be81 100644
> --- a/drivers/mtd/nand/raw/nand_base.c
> +++ b/drivers/mtd/nand/raw/nand_base.c
> @@ -4360,6 +4360,38 @@ static void nand_shutdown(struct mtd_info *mtd)
> nand_suspend(mtd);
> }
>
> +/**
> + * nand_lock - [MTD Interface] Lock the NAND flash
> + * @mtd: MTD device structure
> + * @ofs: offset byte address
> + * @len: number of bytes to lock (must be a multiple of block/page size)
> + */
> +static int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
> +{
> + struct nand_chip *chip = mtd_to_nand(mtd);
> +
> + if (!chip->lock_area)
> + return -ENOTSUPP;
> +
> + return chip->lock_area(chip, ofs, len);
> +}
> +
> +/**
> + * nand_unlock - [MTD Interface] Unlock the NAND flash
> + * @mtd: MTD device structure
> + * @ofs: offset byte address
> + * @len: number of bytes to unlock (must be a multiple of block/page size)
> + */
> +static int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
> +{
> + struct nand_chip *chip = mtd_to_nand(mtd);
> +
> + if (!chip->unlock_area)
> + return -ENOTSUPP;
> +
> + return chip->unlock_area(chip, ofs, len);
> +}
> +
> /* Set default functions */
> static void nand_set_defaults(struct nand_chip *chip)
> {
> @@ -5786,8 +5818,8 @@ static int nand_scan_tail(struct nand_chip *chip)
> mtd->_read_oob = nand_read_oob;
> mtd->_write_oob = nand_write_oob;
> mtd->_sync = nand_sync;
> - mtd->_lock = NULL;
> - mtd->_unlock = NULL;
> + mtd->_lock = nand_lock;
> + mtd->_unlock = nand_unlock;
> mtd->_suspend = nand_suspend;
> mtd->_resume = nand_resume;
> mtd->_reboot = nand_shutdown;
> diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
> index 4ab9bcc..bc2fa3c 100644
> --- a/include/linux/mtd/rawnand.h
> +++ b/include/linux/mtd/rawnand.h
> @@ -1077,6 +1077,8 @@ struct nand_legacy {
> * @manufacturer: [INTERN] Contains manufacturer information
> * @manufacturer.desc: [INTERN] Contains manufacturer's description
> * @manufacturer.priv: [INTERN] Contains manufacturer private information
> + * @lock_area: [REPLACEABLE] specific NAND chip lock operation
> + * @unlock_area: [REPLACEABLE] specific NAND chip unlock operation
> */
>
> struct nand_chip {
> @@ -1136,6 +1138,9 @@ struct nand_chip {
> const struct nand_manufacturer *desc;
> void *priv;
> } manufacturer;
> +
> + int (*lock_area)(struct nand_chip *chip, loff_t ofs, uint64_t len);
> + int (*unlock_area)(struct nand_chip *chip, loff_t ofs, uint64_t len);
> };
>
> extern const struct mtd_ooblayout_ops nand_ooblayout_sp_ops;
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2020-03-10 19:27 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-03 7:21 [PATCH v3 0/4] mtd: rawnand: Add support Macronix Block Portection & Deep Power Down mode Mason Yang
2020-03-03 7:21 ` [PATCH v3 1/4] mtd: rawnand: Add support manufacturer specific lock/unlock operation Mason Yang
2020-03-10 18:30 ` Miquel Raynal
2020-03-10 19:27 ` Boris Brezillon [this message]
2020-03-11 2:40 ` masonccyang
2020-03-11 7:25 ` Miquel Raynal
2020-03-03 7:21 ` [PATCH v3 2/4] mtd: rawnand: Add support Macronix Block Protection function Mason Yang
2020-03-03 7:21 ` [PATCH v3 3/4] mtd: rawnand: Add support manufacturer specific suspend/resume operation Mason Yang
2020-03-10 18:30 ` Miquel Raynal
2020-03-10 19:33 ` Boris Brezillon
2020-03-11 5:40 ` masonccyang
2020-03-11 7:43 ` Miquel Raynal
2020-03-11 7:56 ` Boris Brezillon
2020-03-12 1:45 ` masonccyang
2020-03-10 19:39 ` Boris Brezillon
2020-03-10 19:41 ` Boris Brezillon
2020-03-11 6:13 ` masonccyang
2020-03-11 8:01 ` Boris Brezillon
2020-03-12 1:48 ` masonccyang
2020-03-03 7:21 ` [PATCH v3 4/4] mtd: rawnand: Add support Macronix deep power down mode Mason Yang
2020-03-09 13:14 ` [PATCH v3 0/4] mtd: rawnand: Add support Macronix Block Portection & Deep Power Down mode Miquel Raynal
2020-03-10 2:30 ` masonccyang
2020-03-10 7:44 ` 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=20200310202723.16b48f4b@collabora.com \
--to=boris.brezillon@collabora.com \
--cc=allison@lohutok.net \
--cc=bbrezillon@kernel.org \
--cc=frieder.schrempf@kontron.de \
--cc=juliensu@mxic.com.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=masonccyang@mxic.com.tw \
--cc=miquel.raynal@bootlin.com \
--cc=rfontana@redhat.com \
--cc=richard@nod.at \
--cc=s.hauer@pengutronix.de \
--cc=stefan@agner.ch \
--cc=tglx@linutronix.de \
--cc=vigneshr@ti.com \
--cc=yuehaibing@huawei.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).