From: Boris Brezillon <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org
Cc: srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
bayi.cheng-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
rogercc.lin-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH v2] mtd: nand: mtk: use nand_reset() to reset NAND devices in resume function
Date: Thu, 30 Nov 2017 22:16:02 +0100 [thread overview]
Message-ID: <20171130221602.25497316@bbrezillon> (raw)
In-Reply-To: <1509588307-38511-1-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
On Thu, 2 Nov 2017 10:05:07 +0800
<xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> wrote:
> From: Xiaolei Li <xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
>
> Previously, we only select chips and then send reset command to a NAND
> device during resuming nand driver. There is a lack of deselecting chips.
> It is advised to reset and initialize a NAND device using nand_reset().
>
Applied.
Thanks,
Boris
> Signed-off-by: Xiaolei Li <xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> ---
> drivers/mtd/nand/mtk_nand.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mtd/nand/mtk_nand.c b/drivers/mtd/nand/mtk_nand.c
> index d86a7d1..6d0101e 100644
> --- a/drivers/mtd/nand/mtk_nand.c
> +++ b/drivers/mtd/nand/mtk_nand.c
> @@ -1540,7 +1540,6 @@ static int mtk_nfc_resume(struct device *dev)
> struct mtk_nfc *nfc = dev_get_drvdata(dev);
> struct mtk_nfc_nand_chip *chip;
> struct nand_chip *nand;
> - struct mtd_info *mtd;
> int ret;
> u32 i;
>
> @@ -1553,11 +1552,8 @@ static int mtk_nfc_resume(struct device *dev)
> /* reset NAND chip if VCC was powered off */
> list_for_each_entry(chip, &nfc->chips, node) {
> nand = &chip->nand;
> - mtd = nand_to_mtd(nand);
> - for (i = 0; i < chip->nsels; i++) {
> - nand->select_chip(mtd, i);
> - nand->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);
> - }
> + for (i = 0; i < chip->nsels; i++)
> + nand_reset(nand, i);
> }
>
> return 0;
prev parent reply other threads:[~2017-11-30 21:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-02 2:05 [PATCH v2] mtd: nand: mtk: use nand_reset() to reset NAND devices in resume function xiaolei.li-NuS5LvNUpcJWk0Htik3J/w
[not found] ` <1509588307-38511-1-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2017-11-02 11:41 ` Matthias Brugger
2017-11-30 21:16 ` Boris Brezillon [this message]
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=20171130221602.25497316@bbrezillon \
--to=boris.brezillon-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
--cc=bayi.cheng-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=rogercc.lin-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
/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