NAND parameter page read fails with bitflip and no column change support
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines
I had reached out to Miquel privately with this issue, only due to the desire to help inform maintainers of the issue. I was too busy at the time to join the list and write up something more formal. Miquel provided a small patch for me that did not work at the time, and then I lost access to the board for a while. Now I have a little time and a board, so I am here to report the issue and make it public.
I tried the patch from Miquel back in February and it works correctly with 6.6.12 and my older driver without column change support.
Here is h is patch for reference:
drivers/mtd/nand/raw/nand_base.c +1 -1
@@ -2123,7 +2123,7 @@ EXPORT_SYMBOL_GPL(nand_reset_op);int nand_read_data_op (struct nand_chip *chip,void *buf,unsigned int len,bool force_8bit,bool check_only) { -if (!len || !buf) +if (!len || (!check_only && !buf))return -EINVAL ;if (nand_has_exec_op (chip)) {
I also realize that company email using outlook 365 is terrible for lists and list etiquette. Hopefully the list handles threading from digest emails correctly.
Thanks,
Steven
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Hello Steven, Miquel,
Am Wed, Apr 10, 2024 at 06:45:58PM +0000 schrieb Steven Seeger:
Quoted 14 lines
Quoted 5 lines
I had reached out to Miquel privately with this issue, only due to the desire to help inform maintainers of the issue. I was too busy at the time to join the list and write up something more formal. Miquel provided a small patch for me that did not work at the time, and then I lost access to the board for a while. Now I have a little time and a board, so I am here to report the issue and make it public.
I tried the patch from Miquel back in February and it works correctly with 6.6.12 and my older driver without column change support.
Here is h is patch for reference:
drivers/mtd/nand/raw/nand_base.c EXPORT_SYMBOL_GPL(nand_reset_op); · line 2129
Quoted 8 lines
drivers/mtd/nand/raw/nand_base.c +1
-1@@ -2123,7 +2123,7 @@ EXPORT_SYMBOL_GPL(nand_reset_op);int nand_read_data_op (struct nand_chip *chip,void *buf,unsigned int len,bool force_8bit,bool check_only) { -if (!len || !buf) +if (!len || (!check_only && !buf))return -EINVAL ;if (nand_has_exec_op (chip)) {
Looking at the context aka the whole function nand_read_data_op() this looks fine. I had reported the same issue in March, referencing the same commit 9f820fc0651c ("mtd: rawnand: Check the data only read pattern only once") you mentioned in your other mail:
With nand_read_data_op() fixed in nand_onfi_detect() the boolean use_datain is true now instead of false (because rawnand_check_data_only_read_support() calls that function, too). So in nand_onfi_detect() code jumps to nand_read_data_op() in the second loop run now instead of nand_change_read_column_op() which probably masks that other problem with mtd->writesize not set mentioned in our earlier discussion.
Long story short: the diff above in itself seems correct to me. A test with that fix applied on our sam9x60 board using nand_soft_waitrdy instead of RB# gpio successfully gets ONFI param page 1 with nand_read_data_op() after getting ONFI param page 0 with nand_read_param_page_op() failed.
You said this is a patch/diff from Miquel. Miquel do you send this as a proper patch then, or should someone else?
Greets
Alex
P.S.: still busy with other things, no time yet for proper timing analysis of our other NAND flash problems with logic analyzer etc.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Miquel Raynal
maintainerHello,
[email protected] wrote on Thu, 11 Apr 2024 10:52:48 +0200:
Quoted 47 lines
Hello Steven, Miquel,
Am Wed, Apr 10, 2024 at 06:45:58PM +0000 schrieb Steven Seeger:
Quoted 14 lines
Quoted 5 lines
I had reached out to Miquel privately with this issue, only due to the desire to help inform maintainers of the issue. I was too busy at the time to join the list and write up something more formal. Miquel provided a small patch for me that did not work at the time, and then I lost access to the board for a while. Now I have a little time and a board, so I am here to report the issue and make it public.
I tried the patch from Miquel back in February and it works correctly with 6.6.12 and my older driver without column change support.
Here is h is patch for reference:
drivers/mtd/nand/raw/nand_base.c EXPORT_SYMBOL_GPL(nand_reset_op); · line 2129
Quoted 8 lines
drivers/mtd/nand/raw/nand_base.c +1
-1@@ -2123,7 +2123,7 @@ EXPORT_SYMBOL_GPL(nand_reset_op);int nand_read_data_op (struct nand_chip *chip,void *buf,unsigned int len,bool force_8bit,bool check_only) { -if (!len || !buf) +if (!len || (!check_only && !buf))return -EINVAL ;if (nand_has_exec_op (chip)) {Looking at the context aka the whole function
nand_read_data_op()this looks fine. I had reported the same issue in March, referencing the same commit9f820fc0651c("mtd: rawnand: Check the data only read pattern only once") you mentioned in your other mail:With
nand_read_data_op()fixed innand_onfi_detect()the booleanuse_datainis true now instead of false (becauserawnand_check_data_only_read_support()calls that function, too). So innand_onfi_detect()code jumps tonand_read_data_op()in the second loop run now instead ofnand_change_read_column_op()which probably masks that other problem withmtd->writesizenot set mentioned in our earlier discussion.Long story short: the diff above in itself seems correct to me. A test with that fix applied on our sam9x60 board using
nand_soft_waitrdyinstead of RB# gpio successfully gets ONFI param page 1 withnand_read_data_op()after getting ONFI param page 0 withnand_read_param_page_op()failed.
Quoted 9 lines
You said this is a patch/diff from Miquel. Miquel do you send this as a proper patch then, or should someone else?
Greets
Alex
P.S.: still busy with other things, no time yet for proper timing analysis of our other NAND flash problems with logic analyzer etc.
Sorry for the delay, here is the proposal for fixing this mess:
https://lore.kernel.org/linux-mtd/[email protected]/T/#t
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/