* [PATCH v2] mtd: nand: mtk: use nand_reset() to reset NAND devices in resume function
@ 2017-11-02 2:05 xiaolei.li
2017-11-02 11:41 ` Matthias Brugger
2017-11-30 21:16 ` Boris Brezillon
0 siblings, 2 replies; 3+ messages in thread
From: xiaolei.li @ 2017-11-02 2:05 UTC (permalink / raw)
To: boris.brezillon, computersforpeace
Cc: dwmw2, linux-mtd, linux-mediatek, rogercc.lin, srv_heupstream,
xiaolei.li, bayi.cheng
From: Xiaolei Li <xiaolei.li@mediatek.com>
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().
Signed-off-by: Xiaolei Li <xiaolei.li@mediatek.com>
---
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;
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] mtd: nand: mtk: use nand_reset() to reset NAND devices in resume function
2017-11-02 2:05 [PATCH v2] mtd: nand: mtk: use nand_reset() to reset NAND devices in resume function xiaolei.li
@ 2017-11-02 11:41 ` Matthias Brugger
2017-11-30 21:16 ` Boris Brezillon
1 sibling, 0 replies; 3+ messages in thread
From: Matthias Brugger @ 2017-11-02 11:41 UTC (permalink / raw)
To: xiaolei.li, boris.brezillon, computersforpeace
Cc: srv_heupstream, bayi.cheng, linux-mtd, linux-mediatek, dwmw2,
rogercc.lin
On 11/02/2017 03:05 AM, xiaolei.li@mediatek.com wrote:
> From: Xiaolei Li <xiaolei.li@mediatek.com>
>
> 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().
>
> Signed-off-by: Xiaolei Li <xiaolei.li@mediatek.com>
> ---
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> 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;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] mtd: nand: mtk: use nand_reset() to reset NAND devices in resume function
2017-11-02 2:05 [PATCH v2] mtd: nand: mtk: use nand_reset() to reset NAND devices in resume function xiaolei.li
2017-11-02 11:41 ` Matthias Brugger
@ 2017-11-30 21:16 ` Boris Brezillon
1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2017-11-30 21:16 UTC (permalink / raw)
To: xiaolei.li
Cc: computersforpeace, dwmw2, linux-mtd, linux-mediatek, rogercc.lin,
srv_heupstream, bayi.cheng
On Thu, 2 Nov 2017 10:05:07 +0800
<xiaolei.li@mediatek.com> wrote:
> From: Xiaolei Li <xiaolei.li@mediatek.com>
>
> 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@mediatek.com>
> ---
> 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;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-11-30 21:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-02 2:05 [PATCH v2] mtd: nand: mtk: use nand_reset() to reset NAND devices in resume function xiaolei.li
2017-11-02 11:41 ` Matthias Brugger
2017-11-30 21:16 ` Boris Brezillon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox