diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-04-28 11:43:00 +0200 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-05-11 09:51:40 +0200 |
commit | 6e9c65d87c6d92ed988ecdab3ae6ed4d7d94f67c (patch) | |
tree | 5d2442bfa3863bc1de50dfee8ae3b90f984cee1b | |
parent | 7e928263fc539bb20e73344a3ef5492ffa8bba7e (diff) | |
download | lwn-6e9c65d87c6d92ed988ecdab3ae6ed4d7d94f67c.tar.gz lwn-6e9c65d87c6d92ed988ecdab3ae6ed4d7d94f67c.zip |
mtd: rawnand: onfi: Drop a useless parameter page read
During detection the logic on the NAND bus is:
/* Regular ONFI detection */
1/ read the three NAND parameter pages
/* Extended parameter page detection */
2/ send "read the NAND parameter page" commands without reading
actual data
3/ move the column pointer to the extended page and read it
If fact, as long as there is nothing happening on the NAND bus between
1/ and 3/, the operation 2/ is redundant so remove it.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-8-miquel.raynal@bootlin.com
-rw-r--r-- | drivers/mtd/nand/raw/nand_onfi.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/mtd/nand/raw/nand_onfi.c b/drivers/mtd/nand/raw/nand_onfi.c index 0f3fb9fe4d1d..ee0f2c2549c1 100644 --- a/drivers/mtd/nand/raw/nand_onfi.c +++ b/drivers/mtd/nand/raw/nand_onfi.c @@ -47,12 +47,10 @@ static int nand_flash_detect_ext_param_page(struct nand_chip *chip, if (!ep) return -ENOMEM; - /* Send our own NAND_CMD_PARAM. */ - ret = nand_read_param_page_op(chip, 0, NULL, 0); - if (ret) - goto ext_out; - - /* Use the Change Read Column command to skip the ONFI param pages. */ + /* + * Use the Change Read Column command to skip the ONFI param pages and + * ensure we read at the right location. + */ ret = nand_change_read_column_op(chip, sizeof(*p) * p->num_of_param_pages, ep, len, true); |