All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: computersforpeace@gmail.com, kdasu.kdev@gmail.com,
	miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com,
	sumit.semwal@linaro.org, linux-mtd@lists.infradead.org,
	bcm-kernel-feedback-list@broadcom.com,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org
Cc: "Álvaro Fernández Rojas" <noltari@gmail.com>, stable@vger.kernel.org
Subject: [PATCH v4 1/2] mtd: rawnand: brcmnand: fix hamming oob layout
Date: Tue, 12 May 2020 09:57:32 +0200	[thread overview]
Message-ID: <20200512075733.745374-2-noltari@gmail.com> (raw)
In-Reply-To: <20200512075733.745374-1-noltari@gmail.com>

First 2 bytes are used in large-page nand.

Fixes: ef5eeea6e911 ("mtd: nand: brcm: switch to mtd_ooblayout_ops")
Cc: stable@vger.kernel.org
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 v4: no changes
 v3: invert patch order
 v2: extend original comment

 drivers/mtd/nand/raw/brcmnand/brcmnand.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index e4e3ceeac38f..1c1070111ebc 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -1116,11 +1116,14 @@ static int brcmnand_hamming_ooblayout_free(struct mtd_info *mtd, int section,
 		if (!section) {
 			/*
 			 * Small-page NAND use byte 6 for BBI while large-page
-			 * NAND use byte 0.
+			 * NAND use bytes 0 and 1.
 			 */
-			if (cfg->page_size > 512)
-				oobregion->offset++;
-			oobregion->length--;
+			if (cfg->page_size > 512) {
+				oobregion->offset += 2;
+				oobregion->length -= 2;
+			} else {
+				oobregion->length--;
+			}
 		}
 	}
 
-- 
2.26.2


WARNING: multiple messages have this Message-ID (diff)
From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: computersforpeace@gmail.com, kdasu.kdev@gmail.com,
	miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com,
	sumit.semwal@linaro.org, linux-mtd@lists.infradead.org,
	bcm-kernel-feedback-list@broadcom.com,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org
Cc: "Álvaro Fernández Rojas" <noltari@gmail.com>, stable@vger.kernel.org
Subject: [PATCH v4 1/2] mtd: rawnand: brcmnand: fix hamming oob layout
Date: Tue, 12 May 2020 09:57:32 +0200	[thread overview]
Message-ID: <20200512075733.745374-2-noltari@gmail.com> (raw)
In-Reply-To: <20200512075733.745374-1-noltari@gmail.com>

First 2 bytes are used in large-page nand.

Fixes: ef5eeea6e911 ("mtd: nand: brcm: switch to mtd_ooblayout_ops")
Cc: stable@vger.kernel.org
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 v4: no changes
 v3: invert patch order
 v2: extend original comment

 drivers/mtd/nand/raw/brcmnand/brcmnand.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index e4e3ceeac38f..1c1070111ebc 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -1116,11 +1116,14 @@ static int brcmnand_hamming_ooblayout_free(struct mtd_info *mtd, int section,
 		if (!section) {
 			/*
 			 * Small-page NAND use byte 6 for BBI while large-page
-			 * NAND use byte 0.
+			 * NAND use bytes 0 and 1.
 			 */
-			if (cfg->page_size > 512)
-				oobregion->offset++;
-			oobregion->length--;
+			if (cfg->page_size > 512) {
+				oobregion->offset += 2;
+				oobregion->length -= 2;
+			} else {
+				oobregion->length--;
+			}
 		}
 	}
 
-- 
2.26.2


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

WARNING: multiple messages have this Message-ID (diff)
From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: computersforpeace@gmail.com, kdasu.kdev@gmail.com,
	miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com,
	sumit.semwal@linaro.org, linux-mtd@lists.infradead.org,
	bcm-kernel-feedback-list@broadcom.com,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org
Cc: "Álvaro Fernández Rojas" <noltari@gmail.com>, stable@vger.kernel.org
Subject: [PATCH v4 1/2] mtd: rawnand: brcmnand: fix hamming oob layout
Date: Tue, 12 May 2020 09:57:32 +0200	[thread overview]
Message-ID: <20200512075733.745374-2-noltari@gmail.com> (raw)
In-Reply-To: <20200512075733.745374-1-noltari@gmail.com>

First 2 bytes are used in large-page nand.

Fixes: ef5eeea6e911 ("mtd: nand: brcm: switch to mtd_ooblayout_ops")
Cc: stable@vger.kernel.org
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 v4: no changes
 v3: invert patch order
 v2: extend original comment

 drivers/mtd/nand/raw/brcmnand/brcmnand.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index e4e3ceeac38f..1c1070111ebc 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -1116,11 +1116,14 @@ static int brcmnand_hamming_ooblayout_free(struct mtd_info *mtd, int section,
 		if (!section) {
 			/*
 			 * Small-page NAND use byte 6 for BBI while large-page
-			 * NAND use byte 0.
+			 * NAND use bytes 0 and 1.
 			 */
-			if (cfg->page_size > 512)
-				oobregion->offset++;
-			oobregion->length--;
+			if (cfg->page_size > 512) {
+				oobregion->offset += 2;
+				oobregion->length -= 2;
+			} else {
+				oobregion->length--;
+			}
 		}
 	}
 
-- 
2.26.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-05-12  7:57 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04  9:30 [PATCH 1/2] nand: brcmnand: improve hamming oob layout Álvaro Fernández Rojas
2020-05-04  9:30 ` Álvaro Fernández Rojas
2020-05-04  9:30 ` Álvaro Fernández Rojas
2020-05-04  9:30 ` [PATCH 2/2] nand: brcmnand: fix BBI in " Álvaro Fernández Rojas
2020-05-04  9:30   ` Álvaro Fernández Rojas
2020-05-04  9:30   ` Álvaro Fernández Rojas
2020-05-04 18:59 ` [PATCH v2 1/2] nand: brcmnand: improve " Álvaro Fernández Rojas
2020-05-04 18:59   ` Álvaro Fernández Rojas
2020-05-04 18:59   ` Álvaro Fernández Rojas
2020-05-04 18:59   ` [PATCH v2 2/2] nand: brcmnand: fix " Álvaro Fernández Rojas
2020-05-04 18:59     ` Álvaro Fernández Rojas
2020-05-04 18:59     ` Álvaro Fernández Rojas
2020-05-11 16:34   ` [PATCH v2 1/2] nand: brcmnand: improve " Miquel Raynal
2020-05-11 16:34     ` Miquel Raynal
2020-05-12  6:00   ` [PATCH v3 0/2] mtd: rawnand: " Álvaro Fernández Rojas
2020-05-12  6:00     ` Álvaro Fernández Rojas
2020-05-12  6:00     ` Álvaro Fernández Rojas
2020-05-12  6:00     ` [PATCH v3 1/2] mtd: rawnand: brcmnand: fix " Álvaro Fernández Rojas
2020-05-12  6:00       ` Álvaro Fernández Rojas
2020-05-12  6:00       ` Álvaro Fernández Rojas
2020-05-19 11:49       ` Sasha Levin
2020-05-12  6:00     ` [PATCH v3 2/2] mtd: rawnand: brcmnand: improve " Álvaro Fernández Rojas
2020-05-12  6:00       ` Álvaro Fernández Rojas
2020-05-12  6:00       ` Álvaro Fernández Rojas
2020-05-12  7:08       ` Miquel Raynal
2020-05-12  7:08         ` Miquel Raynal
2020-05-12  7:08         ` Miquel Raynal
2020-05-12  7:12         ` Álvaro Fernández Rojas
2020-05-12  7:12           ` Álvaro Fernández Rojas
2020-05-12  7:12           ` Álvaro Fernández Rojas
2020-05-12  7:19           ` Miquel Raynal
2020-05-12  7:19             ` Miquel Raynal
2020-05-12  7:19             ` Miquel Raynal
2020-05-12  7:26             ` Álvaro Fernández Rojas
2020-05-12  7:26               ` Álvaro Fernández Rojas
2020-05-12  7:26               ` Álvaro Fernández Rojas
2020-05-12  7:41               ` Miquel Raynal
2020-05-12  7:41                 ` Miquel Raynal
2020-05-12  7:41                 ` Miquel Raynal
2020-05-12  7:57     ` [PATCH v4 0/2] " Álvaro Fernández Rojas
2020-05-12  7:57       ` Álvaro Fernández Rojas
2020-05-12  7:57       ` Álvaro Fernández Rojas
2020-05-12  7:57       ` Álvaro Fernández Rojas [this message]
2020-05-12  7:57         ` [PATCH v4 1/2] mtd: rawnand: brcmnand: fix " Álvaro Fernández Rojas
2020-05-12  7:57         ` Álvaro Fernández Rojas
2020-05-19 11:49         ` Sasha Levin
2020-05-24 19:17         ` Miquel Raynal
2020-05-24 19:17           ` Miquel Raynal
2020-05-24 19:17           ` Miquel Raynal
2020-05-12  7:57       ` [PATCH v4 2/2] mtd: rawnand: brcmnand: improve " Álvaro Fernández Rojas
2020-05-12  7:57         ` Álvaro Fernández Rojas
2020-05-12  7:57         ` Álvaro Fernández Rojas
2020-05-24 19:17         ` Miquel Raynal
2020-05-24 19:17           ` Miquel Raynal
2020-05-24 19:17           ` Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200512075733.745374-2-noltari@gmail.com \
    --to=noltari@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=computersforpeace@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kdasu.kdev@gmail.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.