
On Mon, 2015-01-26 at 17:17 -0600, Peter Tyser wrote:
On Mon, 2015-01-26 at 16:33 -0600, Scott Wood wrote:
On Mon, 2015-01-26 at 16:24 -0600, Peter Tyser wrote:
The driver-specific verify_buf() function can be replaced with the standard read_page_raw() function to verify writes. This will allow verify_buf() to be removed from individual drivers. verify_buf() is no longer supported in mainline Linux, so it is a pain to continue supporting.
Any reason not to just remove this feature from U-Boot, as Linux has done?
The Linux change for reference: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6...
I waffled about removing it, but leaned towards leaving it in because:
- I didn't want to change the existing U-Boot behavior for other
users. A google of 'u-boot "nand write"' shows a lot of examples that don't include verification of writes, and they should if we remove auto-verification.
How many configs actually enable this option? I don't see many beyond the FSL PPC boards (which are so full of copy-and-paste that it probably wasn't deliberate).
- The reason it was removed in Linux was "Both UBI and JFFS2 are able
to read verify what they wrote already. There are also MTD tests which do this verification." I thought U-Boot was more likely than Linux to use raw NAND writes without a filesystem, so leaving it in U- Boot made sense since the UBI/JFFS2 logic didn't apply as much here.
Right, though raw writes ought to be limited to blocks that aren't written often enough to fail.
- I didn't think a lot of people would know they have to explicitly
verify NAND contents after a write, since they'd assume it was like other memories that aren't as lossy.
- The penalty of slightly different code from Linux and a small
performance hit was worth the gain of auto-verification to me. I viewed consolidating it into one small chunk of code as a happy medium.
The davinci patches show that there can still be driver dependencies depending on what the driver overrides. I'm not hugely opposed, but it seems like it would be better to do it at a higher level (e.g. in nand_util.c with a flag to enable, and either make support mandatory, or if you try to use that command variant without support it fails rather than silently not verifying).
-Scott