Skip to content

Commit 2082b69

Browse files
Arseniy Krasnovmiquelraynal
authored andcommitted
mtd: rawnand: meson: handle OOB buffer according OOB layout
In case of MTD_OPS_AUTO_OOB mode, MTD/NAND layer fills/reads OOB buffer according current OOB layout so we need to follow it in the driver. Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20231109053953.3863664-1-avkrasnov@salutedevices.com
1 parent acb1fd5 commit 2082b69

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/mtd/nand/raw/meson_nand.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ static void meson_nfc_set_user_byte(struct nand_chip *nand, u8 *oob_buf)
511511
__le64 *info;
512512
int i, count;
513513

514-
for (i = 0, count = 0; i < nand->ecc.steps; i++, count += 2) {
514+
for (i = 0, count = 0; i < nand->ecc.steps; i++, count += (2 + nand->ecc.bytes)) {
515515
info = &meson_chip->info_buf[i];
516516
*info |= oob_buf[count];
517517
*info |= oob_buf[count + 1] << 8;
@@ -524,7 +524,7 @@ static void meson_nfc_get_user_byte(struct nand_chip *nand, u8 *oob_buf)
524524
__le64 *info;
525525
int i, count;
526526

527-
for (i = 0, count = 0; i < nand->ecc.steps; i++, count += 2) {
527+
for (i = 0, count = 0; i < nand->ecc.steps; i++, count += (2 + nand->ecc.bytes)) {
528528
info = &meson_chip->info_buf[i];
529529
oob_buf[count] = *info;
530530
oob_buf[count + 1] = *info >> 8;

0 commit comments

Comments
 (0)