On Tue, 21 Apr 2020 18:46:35 +0200 Miquel Raynal <miquel.raynal@xxxxxxxxxxx> wrote: > There is no need for separate parameter page reads, the delay penalty > is negligible so let's do read the three copies in one go. ^let's read In theory that's correct, but I fear this was done because some controllers couldn't read 768 bytes in one go. Could we do that only if the controller implements exec_op() and exec_op(check_only) returns true? > > Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx> > --- > drivers/mtd/nand/raw/nand_onfi.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/drivers/mtd/nand/raw/nand_onfi.c b/drivers/mtd/nand/raw/nand_onfi.c > index d6124180b47b..b76772666b82 100644 > --- a/drivers/mtd/nand/raw/nand_onfi.c > +++ b/drivers/mtd/nand/raw/nand_onfi.c > @@ -160,19 +160,13 @@ int nand_onfi_detect(struct nand_chip *chip) > if (!pbuf) > return -ENOMEM; > > - ret = nand_read_param_page_op(chip, 0, NULL, 0); > + ret = nand_read_param_page_op(chip, 0, pbuf, 3 * sizeof(*pbuf)); > if (ret) { > ret = 0; > goto free_onfi_param_page; > } > > for (i = 0; i < 3; i++) { > - 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 *)&pbuf[i], 254); > if (crc == le16_to_cpu(pbuf[i].crc)) { > p = &pbuf[i]; ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/