All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: mxc_nand: always copy_spare() for page write
@ 2024-05-28 20:30 ` Sascha Hauer
  0 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2024-05-28 20:30 UTC (permalink / raw)
  To: linux-mtd; +Cc: linux-kernel, Miquel Raynal, Richard Weinberger, Sascha Hauer

When doing a page write we always have to copy the OOB data in place,
as the controller will always write it. Not copying it means we write
random data to the OOB area.

Fixes: 3df54960b63cc ("mtd: nand: mxc_nand: implement exec_op")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Miquel, feel free to fixup the original patch with this.
---
 drivers/mtd/nand/raw/mxc_nand.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/raw/mxc_nand.c b/drivers/mtd/nand/raw/mxc_nand.c
index 9d50f41b3d5a1..e90c6047e82a5 100644
--- a/drivers/mtd/nand/raw/mxc_nand.c
+++ b/drivers/mtd/nand/raw/mxc_nand.c
@@ -806,8 +806,7 @@ static int mxc_nand_write_page_ecc(struct nand_chip *chip, const uint8_t *buf,
 	struct mxc_nand_host *host = nand_get_controller_data(chip);
 	int ret;
 
-	if (oob_required)
-		copy_spare(mtd, false, chip->oob_poi);
+	copy_spare(mtd, false, chip->oob_poi);
 
 	host->devtype_data->enable_hwecc(chip, true);
 
@@ -823,8 +822,7 @@ static int mxc_nand_write_page_raw(struct nand_chip *chip, const uint8_t *buf,
 {
 	struct mtd_info *mtd = nand_to_mtd(chip);
 
-	if (oob_required)
-		copy_spare(mtd, false, chip->oob_poi);
+	copy_spare(mtd, false, chip->oob_poi);
 
 	return nand_prog_page_op(chip, page, 0, buf, mtd->writesize);
 }
-- 
2.39.2


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

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

* [PATCH] mtd: nand: mxc_nand: always copy_spare() for page write
@ 2024-05-28 20:30 ` Sascha Hauer
  0 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2024-05-28 20:30 UTC (permalink / raw)
  To: linux-mtd; +Cc: linux-kernel, Miquel Raynal, Richard Weinberger, Sascha Hauer

When doing a page write we always have to copy the OOB data in place,
as the controller will always write it. Not copying it means we write
random data to the OOB area.

Fixes: 3df54960b63cc ("mtd: nand: mxc_nand: implement exec_op")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Miquel, feel free to fixup the original patch with this.
---
 drivers/mtd/nand/raw/mxc_nand.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/raw/mxc_nand.c b/drivers/mtd/nand/raw/mxc_nand.c
index 9d50f41b3d5a1..e90c6047e82a5 100644
--- a/drivers/mtd/nand/raw/mxc_nand.c
+++ b/drivers/mtd/nand/raw/mxc_nand.c
@@ -806,8 +806,7 @@ static int mxc_nand_write_page_ecc(struct nand_chip *chip, const uint8_t *buf,
 	struct mxc_nand_host *host = nand_get_controller_data(chip);
 	int ret;
 
-	if (oob_required)
-		copy_spare(mtd, false, chip->oob_poi);
+	copy_spare(mtd, false, chip->oob_poi);
 
 	host->devtype_data->enable_hwecc(chip, true);
 
@@ -823,8 +822,7 @@ static int mxc_nand_write_page_raw(struct nand_chip *chip, const uint8_t *buf,
 {
 	struct mtd_info *mtd = nand_to_mtd(chip);
 
-	if (oob_required)
-		copy_spare(mtd, false, chip->oob_poi);
+	copy_spare(mtd, false, chip->oob_poi);
 
 	return nand_prog_page_op(chip, page, 0, buf, mtd->writesize);
 }
-- 
2.39.2


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

* Re: [PATCH] mtd: nand: mxc_nand: always copy_spare() for page write
  2024-05-28 20:30 ` Sascha Hauer
@ 2024-07-01  9:53   ` Miquel Raynal
  -1 siblings, 0 replies; 8+ messages in thread
From: Miquel Raynal @ 2024-07-01  9:53 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: linux-mtd, linux-kernel, Richard Weinberger

Hi Sascha,

s.hauer@pengutronix.de wrote on Tue, 28 May 2024 22:30:06 +0200:

> When doing a page write we always have to copy the OOB data in place,
> as the controller will always write it. Not copying it means we write
> random data to the OOB area.
> 
> Fixes: 3df54960b63cc ("mtd: nand: mxc_nand: implement exec_op")
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> Miquel, feel free to fixup the original patch with this.

Sorry for the delay, I'm now fixing up the original patch with this one.

Thanks for the follow-up.

BTW I've changed the titles to "mtd: rawnand: mxc:" to match the naming
changes since the introduction of spi-nand.

Cheers,
Miquèl

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

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

* Re: [PATCH] mtd: nand: mxc_nand: always copy_spare() for page write
@ 2024-07-01  9:53   ` Miquel Raynal
  0 siblings, 0 replies; 8+ messages in thread
From: Miquel Raynal @ 2024-07-01  9:53 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: linux-mtd, linux-kernel, Richard Weinberger

Hi Sascha,

s.hauer@pengutronix.de wrote on Tue, 28 May 2024 22:30:06 +0200:

> When doing a page write we always have to copy the OOB data in place,
> as the controller will always write it. Not copying it means we write
> random data to the OOB area.
> 
> Fixes: 3df54960b63cc ("mtd: nand: mxc_nand: implement exec_op")
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> Miquel, feel free to fixup the original patch with this.

Sorry for the delay, I'm now fixing up the original patch with this one.

Thanks for the follow-up.

BTW I've changed the titles to "mtd: rawnand: mxc:" to match the naming
changes since the introduction of spi-nand.

Cheers,
Miquèl

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

* Re: [PATCH] mtd: nand: mxc_nand: always copy_spare() for page write
  2024-05-28 20:30 ` Sascha Hauer
@ 2024-07-01 12:00   ` Miquel Raynal
  -1 siblings, 0 replies; 8+ messages in thread
From: Miquel Raynal @ 2024-07-01 12:00 UTC (permalink / raw)
  To: Sascha Hauer, linux-mtd; +Cc: Miquel Raynal, linux-kernel, Richard Weinberger

On Tue, 2024-05-28 at 20:30:06 UTC, Sascha Hauer wrote:
> When doing a page write we always have to copy the OOB data in place,
> as the controller will always write it. Not copying it means we write
> random data to the OOB area.
> 
> Fixes: 3df54960b63cc ("mtd: nand: mxc_nand: implement exec_op")
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

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

Miquel

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

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

* Re: [PATCH] mtd: nand: mxc_nand: always copy_spare() for page write
@ 2024-07-01 12:00   ` Miquel Raynal
  0 siblings, 0 replies; 8+ messages in thread
From: Miquel Raynal @ 2024-07-01 12:00 UTC (permalink / raw)
  To: Sascha Hauer, linux-mtd; +Cc: Miquel Raynal, linux-kernel, Richard Weinberger

On Tue, 2024-05-28 at 20:30:06 UTC, Sascha Hauer wrote:
> When doing a page write we always have to copy the OOB data in place,
> as the controller will always write it. Not copying it means we write
> random data to the OOB area.
> 
> Fixes: 3df54960b63cc ("mtd: nand: mxc_nand: implement exec_op")
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

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

Miquel

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

* [PATCH] mtd: nand: mxc_nand: always copy_spare() for page write
@ 2024-07-02  8:45 Sascha Hauer
  2024-07-03  8:53 ` Sascha Hauer
  0 siblings, 1 reply; 8+ messages in thread
From: Sascha Hauer @ 2024-07-02  8:45 UTC (permalink / raw)
  To: Barebox List

When doing a page write we always have to copy the OOB data in place,
as the controller will always write it. Not copying it means we write
random data to the OOB area.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mtd/nand/raw/mxc_nand.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/raw/mxc_nand.c b/drivers/mtd/nand/raw/mxc_nand.c
index a5500f7dda..c2a03ed0d1 100644
--- a/drivers/mtd/nand/raw/mxc_nand.c
+++ b/drivers/mtd/nand/raw/mxc_nand.c
@@ -759,8 +759,7 @@ static int mxc_nand_write_page_ecc(struct nand_chip *chip, const uint8_t *buf,
 	struct mxc_nand_host *host = nand_get_controller_data(chip);
 	int ret;
 
-	if (oob_required)
-		copy_spare(mtd, false, chip->oob_poi);
+	copy_spare(mtd, false, chip->oob_poi);
 
 	host->devtype_data->enable_hwecc(chip, true);
 
@@ -776,8 +775,7 @@ static int mxc_nand_write_page_raw(struct nand_chip *chip, const uint8_t *buf,
 {
 	struct mtd_info *mtd = nand_to_mtd(chip);
 
-	if (oob_required)
-		copy_spare(mtd, false, chip->oob_poi);
+	copy_spare(mtd, false, chip->oob_poi);
 
 	return nand_prog_page_op(chip, page, 0, buf, mtd->writesize);
 }
-- 
2.39.2




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

* Re: [PATCH] mtd: nand: mxc_nand: always copy_spare() for page write
  2024-07-02  8:45 Sascha Hauer
@ 2024-07-03  8:53 ` Sascha Hauer
  0 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2024-07-03  8:53 UTC (permalink / raw)
  To: Barebox List, Sascha Hauer


On Tue, 02 Jul 2024 10:45:22 +0200, Sascha Hauer wrote:
> When doing a page write we always have to copy the OOB data in place,
> as the controller will always write it. Not copying it means we write
> random data to the OOB area.
> 
> 

Applied, thanks!

[1/1] mtd: nand: mxc_nand: always copy_spare() for page write
      https://git.pengutronix.de/cgit/barebox/commit/?id=d74c84582591 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2024-07-03  8:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-28 20:30 [PATCH] mtd: nand: mxc_nand: always copy_spare() for page write Sascha Hauer
2024-05-28 20:30 ` Sascha Hauer
2024-07-01  9:53 ` Miquel Raynal
2024-07-01  9:53   ` Miquel Raynal
2024-07-01 12:00 ` Miquel Raynal
2024-07-01 12:00   ` Miquel Raynal
  -- strict thread matches above, loose matches on Subject: below --
2024-07-02  8:45 Sascha Hauer
2024-07-03  8:53 ` Sascha Hauer

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.