stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
@ 2022-03-23 17:04 Tokunori Ikegami
  2022-03-23 17:04 ` [PATCH v7 1/4] mtd: cfi_cmdset_0002: Move and rename chip_check/chip_ready/chip_good_for_write Tokunori Ikegami
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Tokunori Ikegami @ 2022-03-23 17:04 UTC (permalink / raw)
  To: miquel.raynal; +Cc: richard, vigneshr, linux-mtd, Tokunori Ikegami, stable

Since commit dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to
check correct value") buffered writes fail on S29GL064N. This is
because, on S29GL064N, reads return 0xFF at the end of DQ polling for
write completion, where as, chip_good() check expects actual data
written to the last location to be returned post DQ polling completion.
Fix is to revert to using chip_good() for S29GL064N which only checks
for DQ lines to settle down to determine write completion.

Fixes: dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to check correct value")
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/b687c259-6413-26c9-d4c9-b3afa69ea124@pengutronix.de/

Tokunori Ikegami (4):
  mtd: cfi_cmdset_0002: Move and rename
    chip_check/chip_ready/chip_good_for_write
  mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
  mtd: cfi_cmdset_0002: Add S29GL064N ID definition
  mtd: cfi_cmdset_0002: Rename chip_ready variables

 drivers/mtd/chips/cfi_cmdset_0002.c | 112 ++++++++++++++--------------
 include/linux/mtd/cfi.h             |   1 +
 2 files changed, 55 insertions(+), 58 deletions(-)

-- 
2.32.0


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

* [PATCH v7 1/4] mtd: cfi_cmdset_0002: Move and rename chip_check/chip_ready/chip_good_for_write
  2022-03-23 17:04 [PATCH v7 0/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N Tokunori Ikegami
@ 2022-03-23 17:04 ` Tokunori Ikegami
  2022-04-28  8:18   ` Miquel Raynal
  2022-03-23 17:04 ` [PATCH v7 2/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N Tokunori Ikegami
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Tokunori Ikegami @ 2022-03-23 17:04 UTC (permalink / raw)
  To: miquel.raynal; +Cc: richard, vigneshr, linux-mtd, Tokunori Ikegami, stable

This is a preparation patch for the S29GL064N buffer writes fix. There
is no functional change.

Fixes: dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to check correct value")
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/b687c259-6413-26c9-d4c9-b3afa69ea124@pengutronix.de/
---
 drivers/mtd/chips/cfi_cmdset_0002.c | 95 ++++++++++-------------------
 1 file changed, 32 insertions(+), 63 deletions(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index a761134fd3be..9ccde90dc180 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -802,21 +802,25 @@ static struct mtd_info *cfi_amdstd_setup(struct mtd_info *mtd)
 }
 
 /*
- * Return true if the chip is ready.
+ * Return true if the chip is ready and has the correct value.
  *
  * Ready is one of: read mode, query mode, erase-suspend-read mode (in any
  * non-suspended sector) and is indicated by no toggle bits toggling.
  *
+ * Error are indicated by toggling bits or bits held with the wrong value,
+ * or with bits toggling.
+ *
  * Note that anything more complicated than checking if no bits are toggling
  * (including checking DQ5 for an error status) is tricky to get working
  * correctly and is therefore not done	(particularly with interleaved chips
  * as each chip must be checked independently of the others).
  */
 static int __xipram chip_ready(struct map_info *map, struct flchip *chip,
-			       unsigned long addr)
+			       unsigned long addr, map_word *expected)
 {
 	struct cfi_private *cfi = map->fldrv_priv;
 	map_word d, t;
+	int ret;
 
 	if (cfi_use_status_reg(cfi)) {
 		map_word ready = CMD(CFI_SR_DRB);
@@ -826,57 +830,20 @@ static int __xipram chip_ready(struct map_info *map, struct flchip *chip,
 		 */
 		cfi_send_gen_cmd(0x70, cfi->addr_unlock1, chip->start, map, cfi,
 				 cfi->device_type, NULL);
-		d = map_read(map, addr);
+		t = map_read(map, addr);
 
-		return map_word_andequal(map, d, ready, ready);
+		return map_word_andequal(map, t, ready, ready);
 	}
 
 	d = map_read(map, addr);
 	t = map_read(map, addr);
 
-	return map_word_equal(map, d, t);
-}
-
-/*
- * Return true if the chip is ready and has the correct value.
- *
- * Ready is one of: read mode, query mode, erase-suspend-read mode (in any
- * non-suspended sector) and it is indicated by no bits toggling.
- *
- * Error are indicated by toggling bits or bits held with the wrong value,
- * or with bits toggling.
- *
- * Note that anything more complicated than checking if no bits are toggling
- * (including checking DQ5 for an error status) is tricky to get working
- * correctly and is therefore not done	(particularly with interleaved chips
- * as each chip must be checked independently of the others).
- *
- */
-static int __xipram chip_good(struct map_info *map, struct flchip *chip,
-			      unsigned long addr, map_word expected)
-{
-	struct cfi_private *cfi = map->fldrv_priv;
-	map_word oldd, curd;
-
-	if (cfi_use_status_reg(cfi)) {
-		map_word ready = CMD(CFI_SR_DRB);
-
-		/*
-		 * For chips that support status register, check device
-		 * ready bit
-		 */
-		cfi_send_gen_cmd(0x70, cfi->addr_unlock1, chip->start, map, cfi,
-				 cfi->device_type, NULL);
-		curd = map_read(map, addr);
-
-		return map_word_andequal(map, curd, ready, ready);
-	}
+	ret = map_word_equal(map, d, t);
 
-	oldd = map_read(map, addr);
-	curd = map_read(map, addr);
+	if (!ret || !expected)
+		return ret;
 
-	return	map_word_equal(map, oldd, curd) &&
-		map_word_equal(map, curd, expected);
+	return map_word_equal(map, t, *expected);
 }
 
 static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr, int mode)
@@ -893,7 +860,7 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
 
 	case FL_STATUS:
 		for (;;) {
-			if (chip_ready(map, chip, adr))
+			if (chip_ready(map, chip, adr, NULL))
 				break;
 
 			if (time_after(jiffies, timeo)) {
@@ -932,7 +899,7 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
 		chip->state = FL_ERASE_SUSPENDING;
 		chip->erase_suspended = 1;
 		for (;;) {
-			if (chip_ready(map, chip, adr))
+			if (chip_ready(map, chip, adr, NULL))
 				break;
 
 			if (time_after(jiffies, timeo)) {
@@ -1463,7 +1430,7 @@ static int do_otp_lock(struct map_info *map, struct flchip *chip, loff_t adr,
 	/* wait for chip to become ready */
 	timeo = jiffies + msecs_to_jiffies(2);
 	for (;;) {
-		if (chip_ready(map, chip, adr))
+		if (chip_ready(map, chip, adr, NULL))
 			break;
 
 		if (time_after(jiffies, timeo)) {
@@ -1695,11 +1662,11 @@ static int __xipram do_write_oneword_once(struct map_info *map,
 		}
 
 		/*
-		 * We check "time_after" and "!chip_good" before checking
-		 * "chip_good" to avoid the failure due to scheduling.
+		 * We check "time_after" and "!chip_ready" before checking
+		 * "chip_ready" to avoid the failure due to scheduling.
 		 */
 		if (time_after(jiffies, timeo) &&
-		    !chip_good(map, chip, adr, datum)) {
+		    !chip_ready(map, chip, adr, &datum)) {
 			xip_enable(map, chip, adr);
 			printk(KERN_WARNING "MTD %s(): software timeout\n", __func__);
 			xip_disable(map, chip, adr);
@@ -1707,7 +1674,7 @@ static int __xipram do_write_oneword_once(struct map_info *map,
 			break;
 		}
 
-		if (chip_good(map, chip, adr, datum)) {
+		if (chip_ready(map, chip, adr, &datum)) {
 			if (cfi_check_err_status(map, chip, adr))
 				ret = -EIO;
 			break;
@@ -1975,18 +1942,18 @@ static int __xipram do_write_buffer_wait(struct map_info *map,
 		}
 
 		/*
-		 * We check "time_after" and "!chip_good" before checking
-		 * "chip_good" to avoid the failure due to scheduling.
+		 * We check "time_after" and "!chip_ready" before checking
+		 * "chip_ready" to avoid the failure due to scheduling.
 		 */
 		if (time_after(jiffies, timeo) &&
-		    !chip_good(map, chip, adr, datum)) {
+		    !chip_ready(map, chip, adr, &datum)) {
 			pr_err("MTD %s(): software timeout, address:0x%.8lx.\n",
 			       __func__, adr);
 			ret = -EIO;
 			break;
 		}
 
-		if (chip_good(map, chip, adr, datum)) {
+		if (chip_ready(map, chip, adr, &datum)) {
 			if (cfi_check_err_status(map, chip, adr))
 				ret = -EIO;
 			break;
@@ -2195,7 +2162,7 @@ static int cfi_amdstd_panic_wait(struct map_info *map, struct flchip *chip,
 	 * If the driver thinks the chip is idle, and no toggle bits
 	 * are changing, then the chip is actually idle for sure.
 	 */
-	if (chip->state == FL_READY && chip_ready(map, chip, adr))
+	if (chip->state == FL_READY && chip_ready(map, chip, adr, NULL))
 		return 0;
 
 	/*
@@ -2212,7 +2179,7 @@ static int cfi_amdstd_panic_wait(struct map_info *map, struct flchip *chip,
 
 		/* wait for the chip to become ready */
 		for (i = 0; i < jiffies_to_usecs(timeo); i++) {
-			if (chip_ready(map, chip, adr))
+			if (chip_ready(map, chip, adr, NULL))
 				return 0;
 
 			udelay(1);
@@ -2276,13 +2243,13 @@ static int do_panic_write_oneword(struct map_info *map, struct flchip *chip,
 	map_write(map, datum, adr);
 
 	for (i = 0; i < jiffies_to_usecs(uWriteTimeout); i++) {
-		if (chip_ready(map, chip, adr))
+		if (chip_ready(map, chip, adr, NULL))
 			break;
 
 		udelay(1);
 	}
 
-	if (!chip_good(map, chip, adr, datum) ||
+	if (!chip_ready(map, chip, adr, &datum) ||
 	    cfi_check_err_status(map, chip, adr)) {
 		/* reset on all failures. */
 		map_write(map, CMD(0xF0), chip->start);
@@ -2424,6 +2391,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
 	DECLARE_WAITQUEUE(wait, current);
 	int ret;
 	int retry_cnt = 0;
+	map_word datum = map_word_ff(map);
 
 	adr = cfi->addr_unlock1;
 
@@ -2478,7 +2446,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
 			chip->erase_suspended = 0;
 		}
 
-		if (chip_good(map, chip, adr, map_word_ff(map))) {
+		if (chip_ready(map, chip, adr, &datum)) {
 			if (cfi_check_err_status(map, chip, adr))
 				ret = -EIO;
 			break;
@@ -2523,6 +2491,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
 	DECLARE_WAITQUEUE(wait, current);
 	int ret;
 	int retry_cnt = 0;
+	map_word datum = map_word_ff(map);
 
 	adr += chip->start;
 
@@ -2577,7 +2546,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
 			chip->erase_suspended = 0;
 		}
 
-		if (chip_good(map, chip, adr, map_word_ff(map))) {
+		if (chip_ready(map, chip, adr, &datum)) {
 			if (cfi_check_err_status(map, chip, adr))
 				ret = -EIO;
 			break;
@@ -2771,7 +2740,7 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map,
 	 */
 	timeo = jiffies + msecs_to_jiffies(2000);	/* 2s max (un)locking */
 	for (;;) {
-		if (chip_ready(map, chip, adr))
+		if (chip_ready(map, chip, adr, NULL))
 			break;
 
 		if (time_after(jiffies, timeo)) {
-- 
2.32.0


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

* [PATCH v7 2/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
  2022-03-23 17:04 [PATCH v7 0/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N Tokunori Ikegami
  2022-03-23 17:04 ` [PATCH v7 1/4] mtd: cfi_cmdset_0002: Move and rename chip_check/chip_ready/chip_good_for_write Tokunori Ikegami
@ 2022-03-23 17:04 ` Tokunori Ikegami
  2022-04-28  8:18   ` Miquel Raynal
  2022-03-28 10:50 ` [PATCH v7 0/4] " Ahmad Fatoum
  2022-04-10  8:51 ` Thorsten Leemhuis
  3 siblings, 1 reply; 11+ messages in thread
From: Tokunori Ikegami @ 2022-03-23 17:04 UTC (permalink / raw)
  To: miquel.raynal; +Cc: richard, vigneshr, linux-mtd, Tokunori Ikegami, stable

Since commit dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to
check correct value") buffered writes fail on S29GL064N. This is
because, on S29GL064N, reads return 0xFF at the end of DQ polling for
write completion, where as, chip_good() check expects actual data
written to the last location to be returned post DQ polling completion.
Fix is to revert to using chip_good() for S29GL064N which only checks
for DQ lines to settle down to determine write completion.

Fixes: dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to check correct value")
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/b687c259-6413-26c9-d4c9-b3afa69ea124@pengutronix.de/
---
 drivers/mtd/chips/cfi_cmdset_0002.c | 42 +++++++++++++++++++++++------
 include/linux/mtd/cfi.h             |  1 +
 2 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 9ccde90dc180..59334530dd46 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -59,6 +59,10 @@
 #define CFI_SR_WBASB		BIT(3)
 #define CFI_SR_SLSB		BIT(1)
 
+enum cfi_quirks {
+	CFI_QUIRK_DQ_TRUE_DATA = BIT(0),
+};
+
 static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
 static int cfi_amdstd_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
 #if !FORCE_WORD_WRITE
@@ -436,6 +440,15 @@ static void fixup_s29ns512p_sectors(struct mtd_info *mtd)
 		mtd->name);
 }
 
+static void fixup_quirks(struct mtd_info *mtd)
+{
+	struct map_info *map = mtd->priv;
+	struct cfi_private *cfi = map->fldrv_priv;
+
+	if (cfi->mfr == CFI_MFR_AMD && cfi->id == 0x0c01)
+		cfi->quirks |= CFI_QUIRK_DQ_TRUE_DATA;
+}
+
 /* Used to fix CFI-Tables of chips without Extended Query Tables */
 static struct cfi_fixup cfi_nopri_fixup_table[] = {
 	{ CFI_MFR_SST, 0x234a, fixup_sst39vf }, /* SST39VF1602 */
@@ -474,6 +487,7 @@ static struct cfi_fixup cfi_fixup_table[] = {
 #if !FORCE_WORD_WRITE
 	{ CFI_MFR_ANY, CFI_ID_ANY, fixup_use_write_buffers },
 #endif
+	{ CFI_MFR_ANY, CFI_ID_ANY, fixup_quirks },
 	{ 0, 0, NULL }
 };
 static struct cfi_fixup jedec_fixup_table[] = {
@@ -846,6 +860,18 @@ static int __xipram chip_ready(struct map_info *map, struct flchip *chip,
 	return map_word_equal(map, t, *expected);
 }
 
+static int __xipram chip_good(struct map_info *map, struct flchip *chip,
+			      unsigned long addr, map_word *expected)
+{
+	struct cfi_private *cfi = map->fldrv_priv;
+	map_word *datum = expected;
+
+	if (cfi->quirks & CFI_QUIRK_DQ_TRUE_DATA)
+		datum = NULL;
+
+	return chip_ready(map, chip, addr, datum);
+}
+
 static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr, int mode)
 {
 	DECLARE_WAITQUEUE(wait, current);
@@ -1662,11 +1688,11 @@ static int __xipram do_write_oneword_once(struct map_info *map,
 		}
 
 		/*
-		 * We check "time_after" and "!chip_ready" before checking
-		 * "chip_ready" to avoid the failure due to scheduling.
+		 * We check "time_after" and "!chip_good" before checking
+		 * "chip_good" to avoid the failure due to scheduling.
 		 */
 		if (time_after(jiffies, timeo) &&
-		    !chip_ready(map, chip, adr, &datum)) {
+		    !chip_good(map, chip, adr, &datum)) {
 			xip_enable(map, chip, adr);
 			printk(KERN_WARNING "MTD %s(): software timeout\n", __func__);
 			xip_disable(map, chip, adr);
@@ -1674,7 +1700,7 @@ static int __xipram do_write_oneword_once(struct map_info *map,
 			break;
 		}
 
-		if (chip_ready(map, chip, adr, &datum)) {
+		if (chip_good(map, chip, adr, &datum)) {
 			if (cfi_check_err_status(map, chip, adr))
 				ret = -EIO;
 			break;
@@ -1942,18 +1968,18 @@ static int __xipram do_write_buffer_wait(struct map_info *map,
 		}
 
 		/*
-		 * We check "time_after" and "!chip_ready" before checking
-		 * "chip_ready" to avoid the failure due to scheduling.
+		 * We check "time_after" and "!chip_good" before checking
+		 * "chip_good" to avoid the failure due to scheduling.
 		 */
 		if (time_after(jiffies, timeo) &&
-		    !chip_ready(map, chip, adr, &datum)) {
+		    !chip_good(map, chip, adr, &datum)) {
 			pr_err("MTD %s(): software timeout, address:0x%.8lx.\n",
 			       __func__, adr);
 			ret = -EIO;
 			break;
 		}
 
-		if (chip_ready(map, chip, adr, &datum)) {
+		if (chip_good(map, chip, adr, &datum)) {
 			if (cfi_check_err_status(map, chip, adr))
 				ret = -EIO;
 			break;
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index fd1ecb821106..d88bb56c18e2 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -286,6 +286,7 @@ struct cfi_private {
 	map_word sector_erase_cmd;
 	unsigned long chipshift; /* Because they're of the same type */
 	const char *im_name;	 /* inter_module name for cmdset_setup */
+	unsigned long quirks;
 	struct flchip chips[];  /* per-chip data structure for each chip */
 };
 
-- 
2.32.0


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

* Re: [PATCH v7 0/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
  2022-03-23 17:04 [PATCH v7 0/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N Tokunori Ikegami
  2022-03-23 17:04 ` [PATCH v7 1/4] mtd: cfi_cmdset_0002: Move and rename chip_check/chip_ready/chip_good_for_write Tokunori Ikegami
  2022-03-23 17:04 ` [PATCH v7 2/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N Tokunori Ikegami
@ 2022-03-28 10:50 ` Ahmad Fatoum
  2022-03-28 15:31   ` Tokunori Ikegami
  2022-04-10  8:51 ` Thorsten Leemhuis
  3 siblings, 1 reply; 11+ messages in thread
From: Ahmad Fatoum @ 2022-03-28 10:50 UTC (permalink / raw)
  To: Tokunori Ikegami, miquel.raynal
  Cc: richard, vigneshr, linux-mtd, stable, Pengutronix Kernel Team

Hello Tokunori-san,

On 23.03.22 18:04, Tokunori Ikegami wrote:
> Since commit dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to
> check correct value") buffered writes fail on S29GL064N. This is
> because, on S29GL064N, reads return 0xFF at the end of DQ polling for
> write completion, where as, chip_good() check expects actual data
> written to the last location to be returned post DQ polling completion.
> Fix is to revert to using chip_good() for S29GL064N which only checks
> for DQ lines to settle down to determine write completion.
> 
> Fixes: dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to check correct value")
> Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
> Cc: stable@vger.kernel.org
> Link: https://lore.kernel.org/r/b687c259-6413-26c9-d4c9-b3afa69ea124@pengutronix.de/

For this series,

Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

Thanks a lot for taking care of this. Could you keep me Cc'd
on future revisions? Convention is via a Reported-by tag
in the regression fix.

Cheers,
Ahmad


> 
> Tokunori Ikegami (4):
>   mtd: cfi_cmdset_0002: Move and rename
>     chip_check/chip_ready/chip_good_for_write
>   mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
>   mtd: cfi_cmdset_0002: Add S29GL064N ID definition
>   mtd: cfi_cmdset_0002: Rename chip_ready variables
> 
>  drivers/mtd/chips/cfi_cmdset_0002.c | 112 ++++++++++++++--------------
>  include/linux/mtd/cfi.h             |   1 +
>  2 files changed, 55 insertions(+), 58 deletions(-)
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH v7 0/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
  2022-03-28 10:50 ` [PATCH v7 0/4] " Ahmad Fatoum
@ 2022-03-28 15:31   ` Tokunori Ikegami
  0 siblings, 0 replies; 11+ messages in thread
From: Tokunori Ikegami @ 2022-03-28 15:31 UTC (permalink / raw)
  To: Ahmad Fatoum, miquel.raynal
  Cc: richard, vigneshr, linux-mtd, stable, Pengutronix Kernel Team

Hi Ahmad-san,

On 2022/03/28 19:50, Ahmad Fatoum wrote:
> Hello Tokunori-san,
>
> On 23.03.22 18:04, Tokunori Ikegami wrote:
>> Since commit dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to
>> check correct value") buffered writes fail on S29GL064N. This is
>> because, on S29GL064N, reads return 0xFF at the end of DQ polling for
>> write completion, where as, chip_good() check expects actual data
>> written to the last location to be returned post DQ polling completion.
>> Fix is to revert to using chip_good() for S29GL064N which only checks
>> for DQ lines to settle down to determine write completion.
>>
>> Fixes: dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to check correct value")
>> Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
>> Cc: stable@vger.kernel.org
>> Link: https://lore.kernel.org/r/b687c259-6413-26c9-d4c9-b3afa69ea124@pengutronix.de/
> For this series,
>
> Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Thank you for your support.
>
> Thanks a lot for taking care of this. Could you keep me Cc'd
> on future revisions? Convention is via a Reported-by tag
> in the regression fix.

Sorry for this. Yes I will do cc on next time and also consider to add 
the Reported-by tag also.

Regards,
Ikegami

>
> Cheers,
> Ahmad
>
>
>> Tokunori Ikegami (4):
>>    mtd: cfi_cmdset_0002: Move and rename
>>      chip_check/chip_ready/chip_good_for_write
>>    mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
>>    mtd: cfi_cmdset_0002: Add S29GL064N ID definition
>>    mtd: cfi_cmdset_0002: Rename chip_ready variables
>>
>>   drivers/mtd/chips/cfi_cmdset_0002.c | 112 ++++++++++++++--------------
>>   include/linux/mtd/cfi.h             |   1 +
>>   2 files changed, 55 insertions(+), 58 deletions(-)
>>
>

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

* Re: [PATCH v7 0/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
  2022-03-23 17:04 [PATCH v7 0/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N Tokunori Ikegami
                   ` (2 preceding siblings ...)
  2022-03-28 10:50 ` [PATCH v7 0/4] " Ahmad Fatoum
@ 2022-04-10  8:51 ` Thorsten Leemhuis
  2022-04-11  7:40   ` Miquel Raynal
  3 siblings, 1 reply; 11+ messages in thread
From: Thorsten Leemhuis @ 2022-04-10  8:51 UTC (permalink / raw)
  To: Tokunori Ikegami, miquel.raynal; +Cc: richard, vigneshr, linux-mtd, stable

Hi, this is your Linux kernel regression tracker. Top-posting for once,
to make this easily accessible to everyone.

Miquel, Richard, Vignesh: what's up here? This patchset fixes a
regression. It's quite old, so it's not that urgent, but it looked like
nothing happened for two and a half week now. Or was progress made
somewhere?

Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)

P.S.: As the Linux kernel's regression tracker I'm getting a lot of
reports on my table. I can only look briefly into most of them and lack
knowledge about most of the areas they concern. I thus unfortunately
will sometimes get things wrong or miss something important. I hope
that's not the case here; if you think it is, don't hesitate to tell me
in a public reply, it's in everyone's interest to set the public record
straight.

#regzbot poke

On 23.03.22 18:04, Tokunori Ikegami wrote:
> Since commit dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to
> check correct value") buffered writes fail on S29GL064N. This is
> because, on S29GL064N, reads return 0xFF at the end of DQ polling for
> write completion, where as, chip_good() check expects actual data
> written to the last location to be returned post DQ polling completion.
> Fix is to revert to using chip_good() for S29GL064N which only checks
> for DQ lines to settle down to determine write completion.
> 
> Fixes: dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to check correct value")
> Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
> Cc: stable@vger.kernel.org
> Link: https://lore.kernel.org/r/b687c259-6413-26c9-d4c9-b3afa69ea124@pengutronix.de/
> 
> Tokunori Ikegami (4):
>   mtd: cfi_cmdset_0002: Move and rename
>     chip_check/chip_ready/chip_good_for_write
>   mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
>   mtd: cfi_cmdset_0002: Add S29GL064N ID definition
>   mtd: cfi_cmdset_0002: Rename chip_ready variables
> 
>  drivers/mtd/chips/cfi_cmdset_0002.c | 112 ++++++++++++++--------------
>  include/linux/mtd/cfi.h             |   1 +
>  2 files changed, 55 insertions(+), 58 deletions(-)
> 


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

* Re: [PATCH v7 0/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
  2022-04-10  8:51 ` Thorsten Leemhuis
@ 2022-04-11  7:40   ` Miquel Raynal
  2022-04-27  9:37     ` Miquel Raynal
  0 siblings, 1 reply; 11+ messages in thread
From: Miquel Raynal @ 2022-04-11  7:40 UTC (permalink / raw)
  To: Thorsten Leemhuis; +Cc: Tokunori Ikegami, richard, vigneshr, linux-mtd, stable

Hello,

regressions@leemhuis.info wrote on Sun, 10 Apr 2022 10:51:17 +0200:

> Hi, this is your Linux kernel regression tracker. Top-posting for once,
> to make this easily accessible to everyone.
> 
> Miquel, Richard, Vignesh: what's up here? This patchset fixes a
> regression. It's quite old, so it's not that urgent, but it looked like
> nothing happened for two and a half week now. Or was progress made
> somewhere?

Vignesh, I'm waiting for your review/ack ;)

> Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)

Nice 'tool' :)

> P.S.: As the Linux kernel's regression tracker I'm getting a lot of
> reports on my table. I can only look briefly into most of them and lack
> knowledge about most of the areas they concern. I thus unfortunately
> will sometimes get things wrong or miss something important. I hope
> that's not the case here; if you think it is, don't hesitate to tell me
> in a public reply, it's in everyone's interest to set the public record
> straight.
> 
> #regzbot poke
> 
> On 23.03.22 18:04, Tokunori Ikegami wrote:
> > Since commit dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to
> > check correct value") buffered writes fail on S29GL064N. This is
> > because, on S29GL064N, reads return 0xFF at the end of DQ polling for
> > write completion, where as, chip_good() check expects actual data
> > written to the last location to be returned post DQ polling completion.
> > Fix is to revert to using chip_good() for S29GL064N which only checks
> > for DQ lines to settle down to determine write completion.
> > 
> > Fixes: dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to check correct value")
> > Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
> > Cc: stable@vger.kernel.org
> > Link: https://lore.kernel.org/r/b687c259-6413-26c9-d4c9-b3afa69ea124@pengutronix.de/
> > 
> > Tokunori Ikegami (4):
> >   mtd: cfi_cmdset_0002: Move and rename
> >     chip_check/chip_ready/chip_good_for_write
> >   mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
> >   mtd: cfi_cmdset_0002: Add S29GL064N ID definition
> >   mtd: cfi_cmdset_0002: Rename chip_ready variables
> > 
> >  drivers/mtd/chips/cfi_cmdset_0002.c | 112 ++++++++++++++--------------
> >  include/linux/mtd/cfi.h             |   1 +
> >  2 files changed, 55 insertions(+), 58 deletions(-)
> >   
> 


Thanks,
Miquèl

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

* Re: [PATCH v7 0/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
  2022-04-11  7:40   ` Miquel Raynal
@ 2022-04-27  9:37     ` Miquel Raynal
  2022-04-28  6:32       ` Vignesh Raghavendra
  0 siblings, 1 reply; 11+ messages in thread
From: Miquel Raynal @ 2022-04-27  9:37 UTC (permalink / raw)
  To: Thorsten Leemhuis; +Cc: Tokunori Ikegami, richard, vigneshr, linux-mtd, stable

Hi Vignesh,

miquel.raynal@bootlin.com wrote on Mon, 11 Apr 2022 09:40:47 +0200:

> Hello,
> 
> regressions@leemhuis.info wrote on Sun, 10 Apr 2022 10:51:17 +0200:
> 
> > Hi, this is your Linux kernel regression tracker. Top-posting for once,
> > to make this easily accessible to everyone.
> > 
> > Miquel, Richard, Vignesh: what's up here? This patchset fixes a
> > regression. It's quite old, so it's not that urgent, but it looked like
> > nothing happened for two and a half week now. Or was progress made
> > somewhere?  
> 
> Vignesh, I'm waiting for your review/ack ;)

Are you still around? We wait for your ack on this.

> > Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)  
> 
> Nice 'tool' :)
> 
> > P.S.: As the Linux kernel's regression tracker I'm getting a lot of
> > reports on my table. I can only look briefly into most of them and lack
> > knowledge about most of the areas they concern. I thus unfortunately
> > will sometimes get things wrong or miss something important. I hope
> > that's not the case here; if you think it is, don't hesitate to tell me
> > in a public reply, it's in everyone's interest to set the public record
> > straight.
> > 
> > #regzbot poke
> > 
> > On 23.03.22 18:04, Tokunori Ikegami wrote:  
> > > Since commit dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to
> > > check correct value") buffered writes fail on S29GL064N. This is
> > > because, on S29GL064N, reads return 0xFF at the end of DQ polling for
> > > write completion, where as, chip_good() check expects actual data
> > > written to the last location to be returned post DQ polling completion.
> > > Fix is to revert to using chip_good() for S29GL064N which only checks
> > > for DQ lines to settle down to determine write completion.
> > > 
> > > Fixes: dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to check correct value")
> > > Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
> > > Cc: stable@vger.kernel.org
> > > Link: https://lore.kernel.org/r/b687c259-6413-26c9-d4c9-b3afa69ea124@pengutronix.de/
> > > 
> > > Tokunori Ikegami (4):
> > >   mtd: cfi_cmdset_0002: Move and rename
> > >     chip_check/chip_ready/chip_good_for_write
> > >   mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
> > >   mtd: cfi_cmdset_0002: Add S29GL064N ID definition
> > >   mtd: cfi_cmdset_0002: Rename chip_ready variables
> > > 
> > >  drivers/mtd/chips/cfi_cmdset_0002.c | 112 ++++++++++++++--------------
> > >  include/linux/mtd/cfi.h             |   1 +
> > >  2 files changed, 55 insertions(+), 58 deletions(-)
> > >     
> >   
> 
> 
> Thanks,
> Miquèl
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/


Thanks,
Miquèl

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

* Re: [PATCH v7 0/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
  2022-04-27  9:37     ` Miquel Raynal
@ 2022-04-28  6:32       ` Vignesh Raghavendra
  0 siblings, 0 replies; 11+ messages in thread
From: Vignesh Raghavendra @ 2022-04-28  6:32 UTC (permalink / raw)
  To: Miquel Raynal, Thorsten Leemhuis
  Cc: Tokunori Ikegami, richard, linux-mtd, stable



On 27/04/22 15:07, Miquel Raynal wrote:
> Hi Vignesh,
> 
> miquel.raynal@bootlin.com wrote on Mon, 11 Apr 2022 09:40:47 +0200:
> 
>> Hello,
>>
>> regressions@leemhuis.info wrote on Sun, 10 Apr 2022 10:51:17 +0200:
>>
>>> Hi, this is your Linux kernel regression tracker. Top-posting for once,
>>> to make this easily accessible to everyone.
>>>
>>> Miquel, Richard, Vignesh: what's up here? This patchset fixes a
>>> regression. It's quite old, so it's not that urgent, but it looked like
>>> nothing happened for two and a half week now. Or was progress made
>>> somewhere?  
>>
>> Vignesh, I'm waiting for your review/ack ;)
> 

Sorry for the delay, I was able to test this series and to see no
regression on CFI an HyperFlashes that I have access to

I think series is in good shape now.

So

Acked-by: Vignesh Raghavendra <vigneshr@ti.com>


[...]

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

* Re: [PATCH v7 2/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
  2022-03-23 17:04 ` [PATCH v7 2/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N Tokunori Ikegami
@ 2022-04-28  8:18   ` Miquel Raynal
  0 siblings, 0 replies; 11+ messages in thread
From: Miquel Raynal @ 2022-04-28  8:18 UTC (permalink / raw)
  To: Tokunori Ikegami, miquel.raynal; +Cc: richard, vigneshr, linux-mtd, stable

On Wed, 2022-03-23 at 17:04:56 UTC, Tokunori Ikegami wrote:
> Since commit dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to
> check correct value") buffered writes fail on S29GL064N. This is
> because, on S29GL064N, reads return 0xFF at the end of DQ polling for
> write completion, where as, chip_good() check expects actual data
> written to the last location to be returned post DQ polling completion.
> Fix is to revert to using chip_good() for S29GL064N which only checks
> for DQ lines to settle down to determine write completion.
> 
> Fixes: dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to check correct value")
> Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
> Cc: stable@vger.kernel.org
> Link: https://lore.kernel.org/r/b687c259-6413-26c9-d4c9-b3afa69ea124@pengutronix.de/

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

Miquel

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

* Re: [PATCH v7 1/4] mtd: cfi_cmdset_0002: Move and rename chip_check/chip_ready/chip_good_for_write
  2022-03-23 17:04 ` [PATCH v7 1/4] mtd: cfi_cmdset_0002: Move and rename chip_check/chip_ready/chip_good_for_write Tokunori Ikegami
@ 2022-04-28  8:18   ` Miquel Raynal
  0 siblings, 0 replies; 11+ messages in thread
From: Miquel Raynal @ 2022-04-28  8:18 UTC (permalink / raw)
  To: Tokunori Ikegami, miquel.raynal; +Cc: richard, vigneshr, linux-mtd, stable

On Wed, 2022-03-23 at 17:04:55 UTC, Tokunori Ikegami wrote:
> This is a preparation patch for the S29GL064N buffer writes fix. There
> is no functional change.
> 
> Fixes: dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to check correct value")
> Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
> Cc: stable@vger.kernel.org
> Link: https://lore.kernel.org/r/b687c259-6413-26c9-d4c9-b3afa69ea124@pengutronix.de/

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

Miquel

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

end of thread, other threads:[~2022-04-28  8:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-23 17:04 [PATCH v7 0/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N Tokunori Ikegami
2022-03-23 17:04 ` [PATCH v7 1/4] mtd: cfi_cmdset_0002: Move and rename chip_check/chip_ready/chip_good_for_write Tokunori Ikegami
2022-04-28  8:18   ` Miquel Raynal
2022-03-23 17:04 ` [PATCH v7 2/4] mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N Tokunori Ikegami
2022-04-28  8:18   ` Miquel Raynal
2022-03-28 10:50 ` [PATCH v7 0/4] " Ahmad Fatoum
2022-03-28 15:31   ` Tokunori Ikegami
2022-04-10  8:51 ` Thorsten Leemhuis
2022-04-11  7:40   ` Miquel Raynal
2022-04-27  9:37     ` Miquel Raynal
2022-04-28  6:32       ` Vignesh Raghavendra

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).