All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/9] Misc timing changes
@ 2020-04-28  9:42 Miquel Raynal
  2020-04-28  9:42 ` [PATCH v3 1/9] mtd: rawnand: timings: Add mode information to the timings structure Miquel Raynal
                   ` (8 more replies)
  0 siblings, 9 replies; 22+ messages in thread
From: Miquel Raynal @ 2020-04-28  9:42 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

Hello,

While working on the early ->exec_op() initializations, I figured the
logic might need to be updated a little bit in order to support
"problematic" IPs like Arasan which do not leave a lot of latitude to
the core. While doing these changes in the logic, I also decided to
cleanup this portion a bit, which ended with the writing of a few
actual fixes.

Cheers,
Miquèl

Changes in v3:
* Fixed typos on tCCS and femtoseconds (Sergei).
* Add Fixes/Stable tags to the patch fixing the param page detection.
* Initialized the content of the srcbuf array (in the ONFI parameter
  page bitwise recovery logic) with a for loop to avoid hardcoring the
  number of parameter pages anywhere as suggested by Boris.
* Added Reviewed-by tags.

Changes in v2:
* Updated a bit the kernel doc as suggested by Boris.
* Updated/fixed typos in the commit logs following Boris and Sergey
  comments.
* Dropped the ONFI/JEDEC parameter page read simplification. Indeed
  they can cause troubles. I moved these two patches to another series
  which takes care about updating some of the core's operations for
  complex controllers.

Miquel Raynal (9):
  mtd: rawnand: timings: Add mode information to the timings structure
  mtd: rawnand: timings: Fix default tR_max and tCCS_min timings
  mtd: rawnand: onfi: Fix redundancy detection check
  mtd: rawnand: onfi: Use intermediate variables to improve readability
  mtd: rawnand: onfi: Define the number of parameter pages
  mtd: rawnand: onfi: Avoid doing a copy of the parameter page
  mtd: rawnand: onfi: Drop a useless parameter page read
  mtd: rawnand: jedec: Define the number of parameter pages
  mtd: rawnand: jedec: Use intermediate variables to improve readability

 drivers/mtd/nand/raw/nand_jedec.c   | 11 ++++---
 drivers/mtd/nand/raw/nand_onfi.c    | 51 ++++++++++++++++-------------
 drivers/mtd/nand/raw/nand_timings.c | 11 +++++--
 include/linux/mtd/rawnand.h         | 10 ++++--
 4 files changed, 50 insertions(+), 33 deletions(-)

-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 1/9] mtd: rawnand: timings: Add mode information to the timings structure
  2020-04-28  9:42 [PATCH v3 0/9] Misc timing changes Miquel Raynal
@ 2020-04-28  9:42 ` Miquel Raynal
  2020-05-10 20:05   ` Miquel Raynal
  2020-04-28  9:42 ` [PATCH v3 2/9] mtd: rawnand: timings: Fix default tR_max and tCCS_min timings Miquel Raynal
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 22+ messages in thread
From: Miquel Raynal @ 2020-04-28  9:42 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

Convert the timings union into a structure containing the mode and the
actual values. The values are still a union in prevision of the
addition of the NVDDR modes.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/nand_timings.c |  6 ++++++
 include/linux/mtd/rawnand.h         | 10 +++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/raw/nand_timings.c b/drivers/mtd/nand/raw/nand_timings.c
index f64b06a71dfa..0061cbaf931d 100644
--- a/drivers/mtd/nand/raw/nand_timings.c
+++ b/drivers/mtd/nand/raw/nand_timings.c
@@ -16,6 +16,7 @@ static const struct nand_data_interface onfi_sdr_timings[] = {
 	/* Mode 0 */
 	{
 		.type = NAND_SDR_IFACE,
+		.timings.mode = 0,
 		.timings.sdr = {
 			.tCCS_min = 500000,
 			.tR_max = 200000000,
@@ -58,6 +59,7 @@ static const struct nand_data_interface onfi_sdr_timings[] = {
 	/* Mode 1 */
 	{
 		.type = NAND_SDR_IFACE,
+		.timings.mode = 1,
 		.timings.sdr = {
 			.tCCS_min = 500000,
 			.tR_max = 200000000,
@@ -100,6 +102,7 @@ static const struct nand_data_interface onfi_sdr_timings[] = {
 	/* Mode 2 */
 	{
 		.type = NAND_SDR_IFACE,
+		.timings.mode = 2,
 		.timings.sdr = {
 			.tCCS_min = 500000,
 			.tR_max = 200000000,
@@ -142,6 +145,7 @@ static const struct nand_data_interface onfi_sdr_timings[] = {
 	/* Mode 3 */
 	{
 		.type = NAND_SDR_IFACE,
+		.timings.mode = 3,
 		.timings.sdr = {
 			.tCCS_min = 500000,
 			.tR_max = 200000000,
@@ -184,6 +188,7 @@ static const struct nand_data_interface onfi_sdr_timings[] = {
 	/* Mode 4 */
 	{
 		.type = NAND_SDR_IFACE,
+		.timings.mode = 4,
 		.timings.sdr = {
 			.tCCS_min = 500000,
 			.tR_max = 200000000,
@@ -226,6 +231,7 @@ static const struct nand_data_interface onfi_sdr_timings[] = {
 	/* Mode 5 */
 	{
 		.type = NAND_SDR_IFACE,
+		.timings.mode = 5,
 		.timings.sdr = {
 			.tCCS_min = 500000,
 			.tR_max = 200000000,
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index 1e76196f9829..21873168ba4d 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -491,13 +491,17 @@ enum nand_data_interface_type {
 /**
  * struct nand_data_interface - NAND interface timing
  * @type:	 type of the timing
- * @timings:	 The timing, type according to @type
+ * @timings:	 The timing information
+ * @timings.mode: Timing mode as defined in the specification
  * @timings.sdr: Use it when @type is %NAND_SDR_IFACE.
  */
 struct nand_data_interface {
 	enum nand_data_interface_type type;
-	union {
-		struct nand_sdr_timings sdr;
+	struct nand_timings {
+		unsigned int mode;
+		union {
+			struct nand_sdr_timings sdr;
+		};
 	} timings;
 };
 
-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 2/9] mtd: rawnand: timings: Fix default tR_max and tCCS_min timings
  2020-04-28  9:42 [PATCH v3 0/9] Misc timing changes Miquel Raynal
  2020-04-28  9:42 ` [PATCH v3 1/9] mtd: rawnand: timings: Add mode information to the timings structure Miquel Raynal
@ 2020-04-28  9:42 ` Miquel Raynal
  2020-05-10 20:05   ` Miquel Raynal
  2020-04-28  9:42   ` Miquel Raynal
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 22+ messages in thread
From: Miquel Raynal @ 2020-04-28  9:42 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

tR and tCCS are currently wrongly expressed in femtoseconds, while we
expect these values to be expressed in picoseconds. Set right
hardcoded values.

Fixes: 6a943386ee36 mtd: rawnand: add default values for dynamic timings
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/nand_timings.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/raw/nand_timings.c b/drivers/mtd/nand/raw/nand_timings.c
index 0061cbaf931d..36d21be3dfe5 100644
--- a/drivers/mtd/nand/raw/nand_timings.c
+++ b/drivers/mtd/nand/raw/nand_timings.c
@@ -320,10 +320,9 @@ int onfi_fill_data_interface(struct nand_chip *chip,
 		/* microseconds -> picoseconds */
 		timings->tPROG_max = 1000000ULL * ONFI_DYN_TIMING_MAX;
 		timings->tBERS_max = 1000000ULL * ONFI_DYN_TIMING_MAX;
-		timings->tR_max = 1000000ULL * 200000000ULL;
 
-		/* nanoseconds -> picoseconds */
-		timings->tCCS_min = 1000UL * 500000;
+		timings->tR_max = 200000000;
+		timings->tCCS_min = 500000;
 	}
 
 	return 0;
-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 3/9] mtd: rawnand: onfi: Fix redundancy detection check
  2020-04-28  9:42 [PATCH v3 0/9] Misc timing changes Miquel Raynal
@ 2020-04-28  9:42   ` Miquel Raynal
  2020-04-28  9:42 ` [PATCH v3 2/9] mtd: rawnand: timings: Fix default tR_max and tCCS_min timings Miquel Raynal
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 22+ messages in thread
From: Miquel Raynal @ 2020-04-28  9:42 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal, stable

During ONFI detection, the CRC derived from the parameter page and the
CRC supposed to be at the end of the parameter page are compared. If
they do not match, the second then the third copies of the page are
tried.

The current implementation compares the newly derived CRC with the CRC
contained in the first page only. So if this particular CRC area has
been corrupted, then the detection will fail for a wrong reason.

Fix this issue by checking the derived CRC against the right one.

Fixes: 39138c1f4a31 ("mtd: rawnand: use bit-wise majority to recover the ONFI param page")
Cc: stable@vger.kernel.org
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/nand_onfi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/nand_onfi.c b/drivers/mtd/nand/raw/nand_onfi.c
index 0b879bd0a68c..8fe8d7bdd203 100644
--- a/drivers/mtd/nand/raw/nand_onfi.c
+++ b/drivers/mtd/nand/raw/nand_onfi.c
@@ -173,7 +173,7 @@ int nand_onfi_detect(struct nand_chip *chip)
 		}
 
 		if (onfi_crc16(ONFI_CRC_BASE, (u8 *)&p[i], 254) ==
-				le16_to_cpu(p->crc)) {
+		    le16_to_cpu(p[i].crc)) {
 			if (i)
 				memcpy(p, &p[i], sizeof(*p));
 			break;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 3/9] mtd: rawnand: onfi: Fix redundancy detection check
@ 2020-04-28  9:42   ` Miquel Raynal
  0 siblings, 0 replies; 22+ messages in thread
From: Miquel Raynal @ 2020-04-28  9:42 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, stable, Thomas Petazzoni, Miquel Raynal

During ONFI detection, the CRC derived from the parameter page and the
CRC supposed to be at the end of the parameter page are compared. If
they do not match, the second then the third copies of the page are
tried.

The current implementation compares the newly derived CRC with the CRC
contained in the first page only. So if this particular CRC area has
been corrupted, then the detection will fail for a wrong reason.

Fix this issue by checking the derived CRC against the right one.

Fixes: 39138c1f4a31 ("mtd: rawnand: use bit-wise majority to recover the ONFI param page")
Cc: stable@vger.kernel.org
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/nand_onfi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/nand_onfi.c b/drivers/mtd/nand/raw/nand_onfi.c
index 0b879bd0a68c..8fe8d7bdd203 100644
--- a/drivers/mtd/nand/raw/nand_onfi.c
+++ b/drivers/mtd/nand/raw/nand_onfi.c
@@ -173,7 +173,7 @@ int nand_onfi_detect(struct nand_chip *chip)
 		}
 
 		if (onfi_crc16(ONFI_CRC_BASE, (u8 *)&p[i], 254) ==
-				le16_to_cpu(p->crc)) {
+		    le16_to_cpu(p[i].crc)) {
 			if (i)
 				memcpy(p, &p[i], sizeof(*p));
 			break;
-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 4/9] mtd: rawnand: onfi: Use intermediate variables to improve readability
  2020-04-28  9:42 [PATCH v3 0/9] Misc timing changes Miquel Raynal
                   ` (2 preceding siblings ...)
  2020-04-28  9:42   ` Miquel Raynal
@ 2020-04-28  9:42 ` Miquel Raynal
  2020-05-10 20:05   ` Miquel Raynal
  2020-04-28  9:42 ` [PATCH v3 5/9] mtd: rawnand: onfi: Define the number of parameter pages Miquel Raynal
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 22+ messages in thread
From: Miquel Raynal @ 2020-04-28  9:42 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

Before reworking a little bit the ONFI detection code, let's
clean the coding style of the if statements to improve readability.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/nand_onfi.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/raw/nand_onfi.c b/drivers/mtd/nand/raw/nand_onfi.c
index 8fe8d7bdd203..7d9a3130443a 100644
--- a/drivers/mtd/nand/raw/nand_onfi.c
+++ b/drivers/mtd/nand/raw/nand_onfi.c
@@ -146,6 +146,7 @@ int nand_onfi_detect(struct nand_chip *chip)
 	int onfi_version = 0;
 	char id[4];
 	int i, ret, val;
+	u16 crc;
 
 	memorg = nanddev_get_memorg(&chip->base);
 
@@ -172,8 +173,8 @@ int nand_onfi_detect(struct nand_chip *chip)
 			goto free_onfi_param_page;
 		}
 
-		if (onfi_crc16(ONFI_CRC_BASE, (u8 *)&p[i], 254) ==
-		    le16_to_cpu(p[i].crc)) {
+		crc = onfi_crc16(ONFI_CRC_BASE, (u8 *)&p[i], 254);
+		if (crc == le16_to_cpu(p[i].crc)) {
 			if (i)
 				memcpy(p, &p[i], sizeof(*p));
 			break;
@@ -187,8 +188,8 @@ int nand_onfi_detect(struct nand_chip *chip)
 		nand_bit_wise_majority(srcbufs, ARRAY_SIZE(srcbufs), p,
 				       sizeof(*p));
 
-		if (onfi_crc16(ONFI_CRC_BASE, (u8 *)p, 254) !=
-				le16_to_cpu(p->crc)) {
+		crc = onfi_crc16(ONFI_CRC_BASE, (u8 *)p, 254);
+		if (crc != le16_to_cpu(p->crc)) {
 			pr_err("ONFI parameter recovery failed, aborting\n");
 			goto free_onfi_param_page;
 		}
-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 5/9] mtd: rawnand: onfi: Define the number of parameter pages
  2020-04-28  9:42 [PATCH v3 0/9] Misc timing changes Miquel Raynal
                   ` (3 preceding siblings ...)
  2020-04-28  9:42 ` [PATCH v3 4/9] mtd: rawnand: onfi: Use intermediate variables to improve readability Miquel Raynal
@ 2020-04-28  9:42 ` Miquel Raynal
  2020-05-10 20:05   ` Miquel Raynal
  2020-04-28  9:42 ` [PATCH v3 6/9] mtd: rawnand: onfi: Avoid doing a copy of the parameter page Miquel Raynal
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 22+ messages in thread
From: Miquel Raynal @ 2020-04-28  9:42 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

Use a macro to define the number of parameter page instead of
hardcoding it everywhere.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/nand_onfi.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/raw/nand_onfi.c b/drivers/mtd/nand/raw/nand_onfi.c
index 7d9a3130443a..7286c014620b 100644
--- a/drivers/mtd/nand/raw/nand_onfi.c
+++ b/drivers/mtd/nand/raw/nand_onfi.c
@@ -16,6 +16,8 @@
 
 #include "internals.h"
 
+#define ONFI_PARAM_PAGES 3
+
 u16 onfi_crc16(u16 crc, u8 const *p, size_t len)
 {
 	int i;
@@ -156,7 +158,7 @@ int nand_onfi_detect(struct nand_chip *chip)
 		return 0;
 
 	/* ONFI chip: allocate a buffer to hold its parameter page */
-	p = kzalloc((sizeof(*p) * 3), GFP_KERNEL);
+	p = kzalloc((sizeof(*p) * ONFI_PARAM_PAGES), GFP_KERNEL);
 	if (!p)
 		return -ENOMEM;
 
@@ -166,7 +168,7 @@ int nand_onfi_detect(struct nand_chip *chip)
 		goto free_onfi_param_page;
 	}
 
-	for (i = 0; i < 3; i++) {
+	for (i = 0; i < ONFI_PARAM_PAGES; i++) {
 		ret = nand_read_data_op(chip, &p[i], sizeof(*p), true);
 		if (ret) {
 			ret = 0;
@@ -181,11 +183,15 @@ int nand_onfi_detect(struct nand_chip *chip)
 		}
 	}
 
-	if (i == 3) {
-		const void *srcbufs[3] = {p, p + 1, p + 2};
+	if (i == ONFI_PARAM_PAGES) {
+		const void *srcbufs[ONFI_PARAM_PAGES];
+		unsigned int j;
+
+		for (j = 0; j < ONFI_PARAM_PAGES; j++)
+			srcbufs[j] = p + j;
 
 		pr_warn("Could not find a valid ONFI parameter page, trying bit-wise majority to recover it\n");
-		nand_bit_wise_majority(srcbufs, ARRAY_SIZE(srcbufs), p,
+		nand_bit_wise_majority(srcbufs, ONFI_PARAM_PAGES, p,
 				       sizeof(*p));
 
 		crc = onfi_crc16(ONFI_CRC_BASE, (u8 *)p, 254);
-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 6/9] mtd: rawnand: onfi: Avoid doing a copy of the parameter page
  2020-04-28  9:42 [PATCH v3 0/9] Misc timing changes Miquel Raynal
                   ` (4 preceding siblings ...)
  2020-04-28  9:42 ` [PATCH v3 5/9] mtd: rawnand: onfi: Define the number of parameter pages Miquel Raynal
@ 2020-04-28  9:42 ` Miquel Raynal
  2020-05-10 20:05   ` Miquel Raynal
  2020-04-28  9:43 ` [PATCH v3 7/9] mtd: rawnand: onfi: Drop a useless parameter page read Miquel Raynal
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 22+ messages in thread
From: Miquel Raynal @ 2020-04-28  9:42 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

There is no need for copying the parameter page, playing with
pointers does the trick.

There is not functional change.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/nand_onfi.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/mtd/nand/raw/nand_onfi.c b/drivers/mtd/nand/raw/nand_onfi.c
index 7286c014620b..0f3fb9fe4d1d 100644
--- a/drivers/mtd/nand/raw/nand_onfi.c
+++ b/drivers/mtd/nand/raw/nand_onfi.c
@@ -143,7 +143,7 @@ int nand_onfi_detect(struct nand_chip *chip)
 {
 	struct mtd_info *mtd = nand_to_mtd(chip);
 	struct nand_memory_organization *memorg;
-	struct nand_onfi_params *p;
+	struct nand_onfi_params *p = NULL, *pbuf;
 	struct onfi_params *onfi;
 	int onfi_version = 0;
 	char id[4];
@@ -158,8 +158,8 @@ int nand_onfi_detect(struct nand_chip *chip)
 		return 0;
 
 	/* ONFI chip: allocate a buffer to hold its parameter page */
-	p = kzalloc((sizeof(*p) * ONFI_PARAM_PAGES), GFP_KERNEL);
-	if (!p)
+	pbuf = kzalloc((sizeof(*pbuf) * ONFI_PARAM_PAGES), GFP_KERNEL);
+	if (!pbuf)
 		return -ENOMEM;
 
 	ret = nand_read_param_page_op(chip, 0, NULL, 0);
@@ -169,16 +169,15 @@ int nand_onfi_detect(struct nand_chip *chip)
 	}
 
 	for (i = 0; i < ONFI_PARAM_PAGES; i++) {
-		ret = nand_read_data_op(chip, &p[i], sizeof(*p), true);
+		ret = nand_read_data_op(chip, &pbuf[i], sizeof(*pbuf), true);
 		if (ret) {
 			ret = 0;
 			goto free_onfi_param_page;
 		}
 
-		crc = onfi_crc16(ONFI_CRC_BASE, (u8 *)&p[i], 254);
-		if (crc == le16_to_cpu(p[i].crc)) {
-			if (i)
-				memcpy(p, &p[i], sizeof(*p));
+		crc = onfi_crc16(ONFI_CRC_BASE, (u8 *)&pbuf[i], 254);
+		if (crc == le16_to_cpu(pbuf[i].crc)) {
+			p = &pbuf[i];
 			break;
 		}
 	}
@@ -188,17 +187,18 @@ int nand_onfi_detect(struct nand_chip *chip)
 		unsigned int j;
 
 		for (j = 0; j < ONFI_PARAM_PAGES; j++)
-			srcbufs[j] = p + j;
+			srcbufs[j] = pbuf + j;
 
 		pr_warn("Could not find a valid ONFI parameter page, trying bit-wise majority to recover it\n");
-		nand_bit_wise_majority(srcbufs, ONFI_PARAM_PAGES, p,
-				       sizeof(*p));
+		nand_bit_wise_majority(srcbufs, ONFI_PARAM_PAGES, pbuf,
+				       sizeof(*pbuf));
 
-		crc = onfi_crc16(ONFI_CRC_BASE, (u8 *)p, 254);
-		if (crc != le16_to_cpu(p->crc)) {
+		crc = onfi_crc16(ONFI_CRC_BASE, (u8 *)pbuf, 254);
+		if (crc != le16_to_cpu(pbuf->crc)) {
 			pr_err("ONFI parameter recovery failed, aborting\n");
 			goto free_onfi_param_page;
 		}
+		p = pbuf;
 	}
 
 	if (chip->manufacturer.desc && chip->manufacturer.desc->ops &&
@@ -306,14 +306,14 @@ int nand_onfi_detect(struct nand_chip *chip)
 	chip->parameters.onfi = onfi;
 
 	/* Identification done, free the full ONFI parameter page and exit */
-	kfree(p);
+	kfree(pbuf);
 
 	return 1;
 
 free_model:
 	kfree(chip->parameters.model);
 free_onfi_param_page:
-	kfree(p);
+	kfree(pbuf);
 
 	return ret;
 }
-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 7/9] mtd: rawnand: onfi: Drop a useless parameter page read
  2020-04-28  9:42 [PATCH v3 0/9] Misc timing changes Miquel Raynal
                   ` (5 preceding siblings ...)
  2020-04-28  9:42 ` [PATCH v3 6/9] mtd: rawnand: onfi: Avoid doing a copy of the parameter page Miquel Raynal
@ 2020-04-28  9:43 ` Miquel Raynal
  2020-05-10 20:05   ` Miquel Raynal
  2020-04-28  9:43 ` [PATCH v3 8/9] mtd: rawnand: jedec: Define the number of parameter pages Miquel Raynal
  2020-04-28  9:43 ` [PATCH v3 9/9] mtd: rawnand: jedec: Use intermediate variables to improve readability Miquel Raynal
  8 siblings, 1 reply; 22+ messages in thread
From: Miquel Raynal @ 2020-04-28  9:43 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

During detection the logic on the NAND bus is:

    /* Regular ONFI detection */
    1/ read the three NAND parameter pages

    /* Extended parameter page detection */
    2/ send "read the NAND parameter page" commands without reading
       actual data
    3/ move the column pointer to the extended page and read it

If fact, as long as there is nothing happening on the NAND bus between
1/ and 3/, the operation 2/ is redundant so remove it.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/nand_onfi.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/raw/nand_onfi.c b/drivers/mtd/nand/raw/nand_onfi.c
index 0f3fb9fe4d1d..ee0f2c2549c1 100644
--- a/drivers/mtd/nand/raw/nand_onfi.c
+++ b/drivers/mtd/nand/raw/nand_onfi.c
@@ -47,12 +47,10 @@ static int nand_flash_detect_ext_param_page(struct nand_chip *chip,
 	if (!ep)
 		return -ENOMEM;
 
-	/* Send our own NAND_CMD_PARAM. */
-	ret = nand_read_param_page_op(chip, 0, NULL, 0);
-	if (ret)
-		goto ext_out;
-
-	/* Use the Change Read Column command to skip the ONFI param pages. */
+	/*
+	 * Use the Change Read Column command to skip the ONFI param pages and
+	 * ensure we read at the right location.
+	 */
 	ret = nand_change_read_column_op(chip,
 					 sizeof(*p) * p->num_of_param_pages,
 					 ep, len, true);
-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 8/9] mtd: rawnand: jedec: Define the number of parameter pages
  2020-04-28  9:42 [PATCH v3 0/9] Misc timing changes Miquel Raynal
                   ` (6 preceding siblings ...)
  2020-04-28  9:43 ` [PATCH v3 7/9] mtd: rawnand: onfi: Drop a useless parameter page read Miquel Raynal
@ 2020-04-28  9:43 ` Miquel Raynal
  2020-05-10 20:05   ` Miquel Raynal
  2020-04-28  9:43 ` [PATCH v3 9/9] mtd: rawnand: jedec: Use intermediate variables to improve readability Miquel Raynal
  8 siblings, 1 reply; 22+ messages in thread
From: Miquel Raynal @ 2020-04-28  9:43 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

Use a macro to define the number of parameter page instead of
hardcoding it everywhere.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/nand_jedec.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/nand_jedec.c b/drivers/mtd/nand/raw/nand_jedec.c
index 9b540e76f84f..0cd322a8be24 100644
--- a/drivers/mtd/nand/raw/nand_jedec.c
+++ b/drivers/mtd/nand/raw/nand_jedec.c
@@ -16,6 +16,8 @@
 
 #include "internals.h"
 
+#define JEDEC_PARAM_PAGES 3
+
 /*
  * Check if the NAND chip is JEDEC compliant, returns 1 if it is, 0 otherwise.
  */
@@ -47,7 +49,7 @@ int nand_jedec_detect(struct nand_chip *chip)
 		goto free_jedec_param_page;
 	}
 
-	for (i = 0; i < 3; i++) {
+	for (i = 0; i < JEDEC_PARAM_PAGES; i++) {
 		ret = nand_read_data_op(chip, p, sizeof(*p), true);
 		if (ret) {
 			ret = 0;
@@ -59,7 +61,7 @@ int nand_jedec_detect(struct nand_chip *chip)
 			break;
 	}
 
-	if (i == 3) {
+	if (i == JEDEC_PARAM_PAGES) {
 		pr_err("Could not find valid JEDEC parameter page; aborting\n");
 		goto free_jedec_param_page;
 	}
-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 9/9] mtd: rawnand: jedec: Use intermediate variables to improve readability
  2020-04-28  9:42 [PATCH v3 0/9] Misc timing changes Miquel Raynal
                   ` (7 preceding siblings ...)
  2020-04-28  9:43 ` [PATCH v3 8/9] mtd: rawnand: jedec: Define the number of parameter pages Miquel Raynal
@ 2020-04-28  9:43 ` Miquel Raynal
  2020-05-10 20:04   ` Miquel Raynal
  8 siblings, 1 reply; 22+ messages in thread
From: Miquel Raynal @ 2020-04-28  9:43 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

Before reworking a little bit the JEDEC detection code, let's
clean the coding style of an if statement to improve readability.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/nand_jedec.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/nand_jedec.c b/drivers/mtd/nand/raw/nand_jedec.c
index 0cd322a8be24..15937e02c64f 100644
--- a/drivers/mtd/nand/raw/nand_jedec.c
+++ b/drivers/mtd/nand/raw/nand_jedec.c
@@ -30,6 +30,7 @@ int nand_jedec_detect(struct nand_chip *chip)
 	int jedec_version = 0;
 	char id[5];
 	int i, val, ret;
+	u16 crc;
 
 	memorg = nanddev_get_memorg(&chip->base);
 
@@ -56,8 +57,8 @@ int nand_jedec_detect(struct nand_chip *chip)
 			goto free_jedec_param_page;
 		}
 
-		if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 510) ==
-				le16_to_cpu(p->crc))
+		crc = onfi_crc16(ONFI_CRC_BASE, (u8 *)p, 510);
+		if (crc == le16_to_cpu(p->crc))
 			break;
 	}
 
-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 3/9] mtd: rawnand: onfi: Fix redundancy detection check
  2020-04-28  9:42   ` Miquel Raynal
  (?)
@ 2020-05-01  2:55   ` Sasha Levin
  -1 siblings, 0 replies; 22+ messages in thread
From: Sasha Levin @ 2020-05-01  2:55 UTC (permalink / raw)
  To: Sasha Levin, Miquel Raynal, Richard Weinberger
  Cc: Boris Brezillon, stable, stable

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: 39138c1f4a31 ("mtd: rawnand: use bit-wise majority to recover the ONFI param page").

The bot has tested the following trees: v5.6.7, v5.4.35, v4.19.118.

v5.6.7: Build OK!
v5.4.35: Build OK!
v4.19.118: Failed to apply! Possible dependencies:
    0f808c1602bc ("mtd: rawnand: Pass a nand_chip object to chip->cmd_ctrl()")
    1c325cc5077a ("mtd: rawnand: Move ONFI code to nand_onfi.c")
    348d56a8c606 ("mtd: rawnand: Keep all internal stuff private")
    3d4af7c19585 ("mtd: rawnand: Move legacy code to nand_legacy.c")
    45240367939b ("mtd: rawnand: Deprecate ->{set,get}_features() hooks")
    47bd59e538d4 ("mtd: rawnand: plat_nand: Pass a nand_chip object to all platform_nand_ctrl hooks")
    716bbbabcc68 ("mtd: rawnand: Deprecate ->{read, write}_{byte, buf}() hooks")
    7e534323c416 ("mtd: rawnand: Pass a nand_chip object to chip->read_xxx() hooks")
    82fc5099744e ("mtd: rawnand: Create a legacy struct and move ->IO_ADDR_{R, W} there")
    c0739d85723a ("mtd: rawnand: Pass a nand_chip object to chip->write_xxx() hooks")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 9/9] mtd: rawnand: jedec: Use intermediate variables to improve readability
  2020-04-28  9:43 ` [PATCH v3 9/9] mtd: rawnand: jedec: Use intermediate variables to improve readability Miquel Raynal
@ 2020-05-10 20:04   ` Miquel Raynal
  0 siblings, 0 replies; 22+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:04 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni

On Tue, 2020-04-28 at 09:43:02 UTC, Miquel Raynal wrote:
> Before reworking a little bit the JEDEC detection code, let's
> clean the coding style of an if statement to improve readability.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 8/9] mtd: rawnand: jedec: Define the number of parameter pages
  2020-04-28  9:43 ` [PATCH v3 8/9] mtd: rawnand: jedec: Define the number of parameter pages Miquel Raynal
@ 2020-05-10 20:05   ` Miquel Raynal
  0 siblings, 0 replies; 22+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:05 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni

On Tue, 2020-04-28 at 09:43:01 UTC, Miquel Raynal wrote:
> Use a macro to define the number of parameter page instead of
> hardcoding it everywhere.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 7/9] mtd: rawnand: onfi: Drop a useless parameter page read
  2020-04-28  9:43 ` [PATCH v3 7/9] mtd: rawnand: onfi: Drop a useless parameter page read Miquel Raynal
@ 2020-05-10 20:05   ` Miquel Raynal
  0 siblings, 0 replies; 22+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:05 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni

On Tue, 2020-04-28 at 09:43:00 UTC, Miquel Raynal wrote:
> During detection the logic on the NAND bus is:
> 
>     /* Regular ONFI detection */
>     1/ read the three NAND parameter pages
> 
>     /* Extended parameter page detection */
>     2/ send "read the NAND parameter page" commands without reading
>        actual data
>     3/ move the column pointer to the extended page and read it
> 
> If fact, as long as there is nothing happening on the NAND bus between
> 1/ and 3/, the operation 2/ is redundant so remove it.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 6/9] mtd: rawnand: onfi: Avoid doing a copy of the parameter page
  2020-04-28  9:42 ` [PATCH v3 6/9] mtd: rawnand: onfi: Avoid doing a copy of the parameter page Miquel Raynal
@ 2020-05-10 20:05   ` Miquel Raynal
  0 siblings, 0 replies; 22+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:05 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni

On Tue, 2020-04-28 at 09:42:59 UTC, Miquel Raynal wrote:
> There is no need for copying the parameter page, playing with
> pointers does the trick.
> 
> There is not functional change.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 5/9] mtd: rawnand: onfi: Define the number of parameter pages
  2020-04-28  9:42 ` [PATCH v3 5/9] mtd: rawnand: onfi: Define the number of parameter pages Miquel Raynal
@ 2020-05-10 20:05   ` Miquel Raynal
  0 siblings, 0 replies; 22+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:05 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni

On Tue, 2020-04-28 at 09:42:58 UTC, Miquel Raynal wrote:
> Use a macro to define the number of parameter page instead of
> hardcoding it everywhere.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 4/9] mtd: rawnand: onfi: Use intermediate variables to improve readability
  2020-04-28  9:42 ` [PATCH v3 4/9] mtd: rawnand: onfi: Use intermediate variables to improve readability Miquel Raynal
@ 2020-05-10 20:05   ` Miquel Raynal
  0 siblings, 0 replies; 22+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:05 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni

On Tue, 2020-04-28 at 09:42:57 UTC, Miquel Raynal wrote:
> Before reworking a little bit the ONFI detection code, let's
> clean the coding style of the if statements to improve readability.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 3/9] mtd: rawnand: onfi: Fix redundancy detection check
  2020-04-28  9:42   ` Miquel Raynal
@ 2020-05-10 20:05     ` Miquel Raynal
  -1 siblings, 0 replies; 22+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:05 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, stable, Thomas Petazzoni

On Tue, 2020-04-28 at 09:42:56 UTC, Miquel Raynal wrote:
> During ONFI detection, the CRC derived from the parameter page and the
> CRC supposed to be at the end of the parameter page are compared. If
> they do not match, the second then the third copies of the page are
> tried.
> 
> The current implementation compares the newly derived CRC with the CRC
> contained in the first page only. So if this particular CRC area has
> been corrupted, then the detection will fail for a wrong reason.
> 
> Fix this issue by checking the derived CRC against the right one.
> 
> Fixes: 39138c1f4a31 ("mtd: rawnand: use bit-wise majority to recover the ONFI param page")
> Cc: stable@vger.kernel.org
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.

Miquel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 3/9] mtd: rawnand: onfi: Fix redundancy detection check
@ 2020-05-10 20:05     ` Miquel Raynal
  0 siblings, 0 replies; 22+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:05 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, stable

On Tue, 2020-04-28 at 09:42:56 UTC, Miquel Raynal wrote:
> During ONFI detection, the CRC derived from the parameter page and the
> CRC supposed to be at the end of the parameter page are compared. If
> they do not match, the second then the third copies of the page are
> tried.
> 
> The current implementation compares the newly derived CRC with the CRC
> contained in the first page only. So if this particular CRC area has
> been corrupted, then the detection will fail for a wrong reason.
> 
> Fix this issue by checking the derived CRC against the right one.
> 
> Fixes: 39138c1f4a31 ("mtd: rawnand: use bit-wise majority to recover the ONFI param page")
> Cc: stable@vger.kernel.org
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 2/9] mtd: rawnand: timings: Fix default tR_max and tCCS_min timings
  2020-04-28  9:42 ` [PATCH v3 2/9] mtd: rawnand: timings: Fix default tR_max and tCCS_min timings Miquel Raynal
@ 2020-05-10 20:05   ` Miquel Raynal
  0 siblings, 0 replies; 22+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:05 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni

On Tue, 2020-04-28 at 09:42:55 UTC, Miquel Raynal wrote:
> tR and tCCS are currently wrongly expressed in femtoseconds, while we
> expect these values to be expressed in picoseconds. Set right
> hardcoded values.
> 
> Fixes: 6a943386ee36 mtd: rawnand: add default values for dynamic timings
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 1/9] mtd: rawnand: timings: Add mode information to the timings structure
  2020-04-28  9:42 ` [PATCH v3 1/9] mtd: rawnand: timings: Add mode information to the timings structure Miquel Raynal
@ 2020-05-10 20:05   ` Miquel Raynal
  0 siblings, 0 replies; 22+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:05 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni

On Tue, 2020-04-28 at 09:42:54 UTC, Miquel Raynal wrote:
> Convert the timings union into a structure containing the mode and the
> actual values. The values are still a union in prevision of the
> addition of the NVDDR modes.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2020-05-10 20:11 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28  9:42 [PATCH v3 0/9] Misc timing changes Miquel Raynal
2020-04-28  9:42 ` [PATCH v3 1/9] mtd: rawnand: timings: Add mode information to the timings structure Miquel Raynal
2020-05-10 20:05   ` Miquel Raynal
2020-04-28  9:42 ` [PATCH v3 2/9] mtd: rawnand: timings: Fix default tR_max and tCCS_min timings Miquel Raynal
2020-05-10 20:05   ` Miquel Raynal
2020-04-28  9:42 ` [PATCH v3 3/9] mtd: rawnand: onfi: Fix redundancy detection check Miquel Raynal
2020-04-28  9:42   ` Miquel Raynal
2020-05-01  2:55   ` Sasha Levin
2020-05-10 20:05   ` Miquel Raynal
2020-05-10 20:05     ` Miquel Raynal
2020-04-28  9:42 ` [PATCH v3 4/9] mtd: rawnand: onfi: Use intermediate variables to improve readability Miquel Raynal
2020-05-10 20:05   ` Miquel Raynal
2020-04-28  9:42 ` [PATCH v3 5/9] mtd: rawnand: onfi: Define the number of parameter pages Miquel Raynal
2020-05-10 20:05   ` Miquel Raynal
2020-04-28  9:42 ` [PATCH v3 6/9] mtd: rawnand: onfi: Avoid doing a copy of the parameter page Miquel Raynal
2020-05-10 20:05   ` Miquel Raynal
2020-04-28  9:43 ` [PATCH v3 7/9] mtd: rawnand: onfi: Drop a useless parameter page read Miquel Raynal
2020-05-10 20:05   ` Miquel Raynal
2020-04-28  9:43 ` [PATCH v3 8/9] mtd: rawnand: jedec: Define the number of parameter pages Miquel Raynal
2020-05-10 20:05   ` Miquel Raynal
2020-04-28  9:43 ` [PATCH v3 9/9] mtd: rawnand: jedec: Use intermediate variables to improve readability Miquel Raynal
2020-05-10 20:04   ` Miquel Raynal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.