* [PATCH v1] mtd: rawnand: meson: fix ready/busy command
@ 2023-06-05 6:10 Arseniy Krasnov
2023-06-05 6:39 ` Arseniy Krasnov
2023-06-05 7:05 ` Greg KH
0 siblings, 2 replies; 7+ messages in thread
From: Arseniy Krasnov @ 2023-06-05 6:10 UTC (permalink / raw)
To: Liang Yang, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Yixun Lan, Jianxin Pan
Cc: oxffffaa, kernel, Arseniy Krasnov, stable, linux-mtd,
linux-arm-kernel, linux-amlogic, linux-kernel
Fix the ready/busy command value.
Fixes: 8fae856c5350 ("mtd: rawnand: meson: add support for Amlogic NAND flash controller")
Cc: stable@vger.kernel.org
Suggested-by: Liang Yang <liang.yang@amlogic.com>
Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
---
drivers/mtd/nand/raw/meson_nand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
index 074e14225c06..9dd4a676497b 100644
--- a/drivers/mtd/nand/raw/meson_nand.c
+++ b/drivers/mtd/nand/raw/meson_nand.c
@@ -37,7 +37,7 @@
#define NFC_CMD_SCRAMBLER_ENABLE BIT(19)
#define NFC_CMD_SCRAMBLER_DISABLE 0
#define NFC_CMD_SHORTMODE_DISABLE 0
-#define NFC_CMD_RB_INT BIT(14)
+#define NFC_CMD_RB_INT ((0xb << 10) | BIT(18) | BIT(16))
#define NFC_CMD_GET_SIZE(x) (((x) >> 22) & GENMASK(4, 0))
--
2.35.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v1] mtd: rawnand: meson: fix ready/busy command 2023-06-05 6:10 [PATCH v1] mtd: rawnand: meson: fix ready/busy command Arseniy Krasnov @ 2023-06-05 6:39 ` Arseniy Krasnov 2023-06-05 8:17 ` Miquel Raynal 2023-06-05 7:05 ` Greg KH 1 sibling, 1 reply; 7+ messages in thread From: Arseniy Krasnov @ 2023-06-05 6:39 UTC (permalink / raw) To: Miquel Raynal Cc: oxffffaa, kernel, stable, linux-mtd, linux-arm-kernel, linux-amlogic, linux-kernel, Liang Yang, Richard Weinberger, Vignesh Raghavendra, Neil Armstrong, Jerome Brunet, Martin Blumenstingl, Kevin Hilman, Jianxin Pan Hello Miquel! I exclude this patch from the recent Meson patchset, as it is fix and not related to another patches. Also I think that I can split Meson patchset (from links below) in the following way: 1) Patch/patchset for OOB layout 2) Patchset for "nand-rb" logic (meson_nand.c + DT bindings) These two can also go independently: 3) https://lore.kernel.org/linux-mtd/20230601061850.3907800-6-AVKrasnov@sberdevices.ru/ 4) https://lore.kernel.org/linux-mtd/20230601061850.3907800-7-AVKrasnov@sberdevices.ru/ What do You think? Thanks, Arseniy On 05.06.2023 09:10, Arseniy Krasnov wrote: > Fix the ready/busy command value. > > Fixes: 8fae856c5350 ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") > Cc: stable@vger.kernel.org > Suggested-by: Liang Yang <liang.yang@amlogic.com> > Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> > --- > drivers/mtd/nand/raw/meson_nand.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index 074e14225c06..9dd4a676497b 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -37,7 +37,7 @@ > #define NFC_CMD_SCRAMBLER_ENABLE BIT(19) > #define NFC_CMD_SCRAMBLER_DISABLE 0 > #define NFC_CMD_SHORTMODE_DISABLE 0 > -#define NFC_CMD_RB_INT BIT(14) > +#define NFC_CMD_RB_INT ((0xb << 10) | BIT(18) | BIT(16)) > > #define NFC_CMD_GET_SIZE(x) (((x) >> 22) & GENMASK(4, 0)) > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] mtd: rawnand: meson: fix ready/busy command 2023-06-05 6:39 ` Arseniy Krasnov @ 2023-06-05 8:17 ` Miquel Raynal 2023-06-05 8:27 ` Arseniy Krasnov 0 siblings, 1 reply; 7+ messages in thread From: Miquel Raynal @ 2023-06-05 8:17 UTC (permalink / raw) To: Arseniy Krasnov Cc: oxffffaa, kernel, stable, linux-mtd, linux-arm-kernel, linux-amlogic, linux-kernel, Liang Yang, Richard Weinberger, Vignesh Raghavendra, Neil Armstrong, Jerome Brunet, Martin Blumenstingl, Kevin Hilman, Jianxin Pan Hi Arseniy, avkrasnov@sberdevices.ru wrote on Mon, 5 Jun 2023 09:39:40 +0300: > Hello Miquel! > > I exclude this patch from the recent Meson patchset, as it is fix and not related to another patches. > Also I think that I can split Meson patchset (from links below) in the following way: > 1) Patch/patchset for OOB layout > 2) Patchset for "nand-rb" logic (meson_nand.c + DT bindings) > These two can also go independently: > 3) https://lore.kernel.org/linux-mtd/20230601061850.3907800-6-AVKrasnov@sberdevices.ru/ > 4) https://lore.kernel.org/linux-mtd/20230601061850.3907800-7-AVKrasnov@sberdevices.ru/ LGTM. > > What do You think? > > Thanks, Arseniy > > On 05.06.2023 09:10, Arseniy Krasnov wrote: > > Fix the ready/busy command value. > > > > Fixes: 8fae856c5350 ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") > > Cc: stable@vger.kernel.org > > Suggested-by: Liang Yang <liang.yang@amlogic.com> > > Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> > > --- > > drivers/mtd/nand/raw/meson_nand.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > > index 074e14225c06..9dd4a676497b 100644 > > --- a/drivers/mtd/nand/raw/meson_nand.c > > +++ b/drivers/mtd/nand/raw/meson_nand.c > > @@ -37,7 +37,7 @@ > > #define NFC_CMD_SCRAMBLER_ENABLE BIT(19) > > #define NFC_CMD_SCRAMBLER_DISABLE 0 > > #define NFC_CMD_SHORTMODE_DISABLE 0 > > -#define NFC_CMD_RB_INT BIT(14) > > +#define NFC_CMD_RB_INT ((0xb << 10) | BIT(18) | BIT(16)) > > > > #define NFC_CMD_GET_SIZE(x) (((x) >> 22) & GENMASK(4, 0)) > > Thanks, Miquèl _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] mtd: rawnand: meson: fix ready/busy command 2023-06-05 8:17 ` Miquel Raynal @ 2023-06-05 8:27 ` Arseniy Krasnov 2023-06-05 9:50 ` Miquel Raynal 0 siblings, 1 reply; 7+ messages in thread From: Arseniy Krasnov @ 2023-06-05 8:27 UTC (permalink / raw) To: Miquel Raynal Cc: oxffffaa, kernel, stable, linux-mtd, linux-arm-kernel, linux-amlogic, linux-kernel, Liang Yang, Richard Weinberger, Vignesh Raghavendra, Neil Armstrong, Jerome Brunet, Martin Blumenstingl, Kevin Hilman, Jianxin Pan On 05.06.2023 11:17, Miquel Raynal wrote: > Hi Arseniy, > > avkrasnov@sberdevices.ru wrote on Mon, 5 Jun 2023 09:39:40 +0300: > >> Hello Miquel! >> >> I exclude this patch from the recent Meson patchset, as it is fix and not related to another patches. >> Also I think that I can split Meson patchset (from links below) in the following way: >> 1) Patch/patchset for OOB layout >> 2) Patchset for "nand-rb" logic (meson_nand.c + DT bindings) >> These two can also go independently: >> 3) https://lore.kernel.org/linux-mtd/20230601061850.3907800-6-AVKrasnov@sberdevices.ru/ >> 4) https://lore.kernel.org/linux-mtd/20230601061850.3907800-7-AVKrasnov@sberdevices.ru/ > > LGTM. I think we don't need this patch with new RB_INT value. I dive into conversations with Liang Yang - author of this driver. He said, that this define is "special" polling mode. Now I'm a little bit more experienced in NAND area, so IIUC we have two basic waiting modes: 1) Software, by sending status command, then polling reply from controller, and then finally send READ0 to exit status reading mode (nand_soft_waitrdy()). 2) By RB pin and interrupt - in this mode we send vendor specific command to the controller and it triggers interrupt on RB pin update. In this case RB pin must be connected to the controller. This mode is already implemented by Liang Yang. Now, command with this new define works in the following way: we send status command, by instead of reading reply from it by software, controller itself checks RB pin and status ready bit in IO bus. Driver just waits on completion. After waiting we need to send READ0 command again to make controller leave status reading mode. I think this is like "intermediate" mode between software polling and hardware interrupt - there is no need to spin in loop, waiting for status ready bit, but still need to leave status mode by sending READ0 command. I'm not sure that we need this as third mode of waiting for command is done. May be at least not in this work on Meson driver, so I guess to drop this patch at this moment and add 'nand_soft_waitrdy()' support. Thanks, Arseniy > >> >> What do You think? >> >> Thanks, Arseniy >> >> On 05.06.2023 09:10, Arseniy Krasnov wrote: >>> Fix the ready/busy command value. >>> >>> Fixes: 8fae856c5350 ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") >>> Cc: stable@vger.kernel.org >>> Suggested-by: Liang Yang <liang.yang@amlogic.com> >>> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> >>> --- >>> drivers/mtd/nand/raw/meson_nand.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c >>> index 074e14225c06..9dd4a676497b 100644 >>> --- a/drivers/mtd/nand/raw/meson_nand.c >>> +++ b/drivers/mtd/nand/raw/meson_nand.c >>> @@ -37,7 +37,7 @@ >>> #define NFC_CMD_SCRAMBLER_ENABLE BIT(19) >>> #define NFC_CMD_SCRAMBLER_DISABLE 0 >>> #define NFC_CMD_SHORTMODE_DISABLE 0 >>> -#define NFC_CMD_RB_INT BIT(14) >>> +#define NFC_CMD_RB_INT ((0xb << 10) | BIT(18) | BIT(16)) >>> >>> #define NFC_CMD_GET_SIZE(x) (((x) >> 22) & GENMASK(4, 0)) >>> > > > Thanks, > Miquèl _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] mtd: rawnand: meson: fix ready/busy command 2023-06-05 8:27 ` Arseniy Krasnov @ 2023-06-05 9:50 ` Miquel Raynal 0 siblings, 0 replies; 7+ messages in thread From: Miquel Raynal @ 2023-06-05 9:50 UTC (permalink / raw) To: Arseniy Krasnov Cc: oxffffaa, kernel, stable, linux-mtd, linux-arm-kernel, linux-amlogic, linux-kernel, Liang Yang, Richard Weinberger, Vignesh Raghavendra, Neil Armstrong, Jerome Brunet, Martin Blumenstingl, Kevin Hilman, Jianxin Pan Hi Arseniy, avkrasnov@sberdevices.ru wrote on Mon, 5 Jun 2023 11:27:34 +0300: > On 05.06.2023 11:17, Miquel Raynal wrote: > > Hi Arseniy, > > > > avkrasnov@sberdevices.ru wrote on Mon, 5 Jun 2023 09:39:40 +0300: > > > >> Hello Miquel! > >> > >> I exclude this patch from the recent Meson patchset, as it is fix and not related to another patches. > >> Also I think that I can split Meson patchset (from links below) in the following way: > >> 1) Patch/patchset for OOB layout > >> 2) Patchset for "nand-rb" logic (meson_nand.c + DT bindings) > >> These two can also go independently: > >> 3) https://lore.kernel.org/linux-mtd/20230601061850.3907800-6-AVKrasnov@sberdevices.ru/ > >> 4) https://lore.kernel.org/linux-mtd/20230601061850.3907800-7-AVKrasnov@sberdevices.ru/ > > > > LGTM. > > I think we don't need this patch with new RB_INT value. I dive into conversations with Liang Yang - author of this driver. He said, > that this define is "special" polling mode. Now I'm a little bit more experienced in NAND area, so IIUC we have two basic waiting modes: > 1) Software, by sending status command, then polling reply from controller, and then finally send READ0 to exit status reading mode (nand_soft_waitrdy()). This is useful... > 2) By RB pin and interrupt - in this mode we send vendor specific command to the controller and it triggers interrupt on RB pin update. > In this case RB pin must be connected to the controller. This mode is already implemented by Liang Yang. ...this is useful... > > Now, command with this new define works in the following way: we send status command, by instead of reading reply from it by software, > controller itself checks RB pin and status ready bit in IO bus. Driver just waits on completion. After waiting we need to send > READ0 command again to make controller leave status reading mode. I think this is like "intermediate" mode between software polling > and hardware interrupt - there is no need to spin in loop, waiting for status ready bit, but still need to leave status mode by sending > READ0 command. I'm not sure that we need this as third mode of waiting for command is done. May be at least not in this work on Meson driver, > so I guess to drop this patch at this moment and add 'nand_soft_waitrdy()' support. ...I agree we can skip this one. Thanks, Miquèl _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] mtd: rawnand: meson: fix ready/busy command 2023-06-05 6:10 [PATCH v1] mtd: rawnand: meson: fix ready/busy command Arseniy Krasnov 2023-06-05 6:39 ` Arseniy Krasnov @ 2023-06-05 7:05 ` Greg KH 2023-06-05 7:50 ` Arseniy Krasnov 1 sibling, 1 reply; 7+ messages in thread From: Greg KH @ 2023-06-05 7:05 UTC (permalink / raw) To: Arseniy Krasnov Cc: Liang Yang, Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Yixun Lan, Jianxin Pan, oxffffaa, kernel, stable, linux-mtd, linux-arm-kernel, linux-amlogic, linux-kernel On Mon, Jun 05, 2023 at 09:10:48AM +0300, Arseniy Krasnov wrote: > Fix the ready/busy command value. "Fix" it in what way? Please provide more information, this does not explain what is happening here at all. greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] mtd: rawnand: meson: fix ready/busy command 2023-06-05 7:05 ` Greg KH @ 2023-06-05 7:50 ` Arseniy Krasnov 0 siblings, 0 replies; 7+ messages in thread From: Arseniy Krasnov @ 2023-06-05 7:50 UTC (permalink / raw) To: Greg KH Cc: Liang Yang, Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Yixun Lan, Jianxin Pan, oxffffaa, kernel, stable, linux-mtd, linux-arm-kernel, linux-amlogic, linux-kernel Seems this fix is not full, pls ignore it Thanks, Arseniy On 05.06.2023 10:05, Greg KH wrote: > On Mon, Jun 05, 2023 at 09:10:48AM +0300, Arseniy Krasnov wrote: >> Fix the ready/busy command value. > > "Fix" it in what way? Please provide more information, this does not > explain what is happening here at all. > > greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-06-05 9:51 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-06-05 6:10 [PATCH v1] mtd: rawnand: meson: fix ready/busy command Arseniy Krasnov 2023-06-05 6:39 ` Arseniy Krasnov 2023-06-05 8:17 ` Miquel Raynal 2023-06-05 8:27 ` Arseniy Krasnov 2023-06-05 9:50 ` Miquel Raynal 2023-06-05 7:05 ` Greg KH 2023-06-05 7:50 ` Arseniy Krasnov
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).