From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: linux-mtd@lists.infradead.org
Subject: Re: Using nand_change_read_column_op() in nand_onfi_detect()
Date: Tue, 14 May 2024 13:53:16 +0200 [thread overview]
Message-ID: <20240514135316.4940a7b6@xps-13> (raw)
In-Reply-To: <ZkNPkzKmwMWzbyWJ@pengutronix.de>
Hi Sascha,
s.hauer@pengutronix.de wrote on Tue, 14 May 2024 13:48:35 +0200:
> Hi all,
>
> I am currently stumbling over this in nand_onfi_detect():
>
> for (i = 0; i < ONFI_PARAM_PAGES; i++) {
> if (!i)
> ret = nand_read_param_page_op(chip, 0, &pbuf[i],
> sizeof(*pbuf));
> else if (use_datain)
> ret = nand_read_data_op(chip, &pbuf[i], sizeof(*pbuf),
> true, false);
> else
> ret = nand_change_read_column_op(chip, sizeof(*pbuf) * i,
> &pbuf[i], sizeof(*pbuf),
> true);
> ...
> }
>
> nand_change_read_column_op() heavily uses mtd->writesize and bails out
> with an error when the writesize is 0. mtd->writesize is still
> uninitialised at that point, it's initialized a few lines further down
> in the same function. It looks like this code never worked as expected.
>
> Also it seems use_datain is always 0, see 1), so existing code only ever
> reads the first parameter page.
>
> The same pattern is in nand_jedec_detect() as well.
>
> Not sure what we make from this.
>
> Sascha
>
> 1) https://lore.kernel.org/linux-mtd/20240514103355.817056-1-s.hauer@pengutronix.de/T/#u
>
Sorry for not mentioning that before, I sent two fixes about that:
https://lore.kernel.org/linux-mtd/20240507160546.130255-1-miquel.raynal@bootlin.com/T/#t
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2024-05-14 11:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-14 11:48 Using nand_change_read_column_op() in nand_onfi_detect() Sascha Hauer
2024-05-14 11:53 ` Miquel Raynal [this message]
2024-05-14 13:42 ` Sascha Hauer
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=20240514135316.4940a7b6@xps-13 \
--to=miquel.raynal@bootlin.com \
--cc=linux-mtd@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).