flashcp fails with SFDP rev D on a Micron MT35XU512ABA flash

Wadim Egorov w.egorov at phytec.de
Tue Nov 21 03:55:43 PST 2023


Hello,

I noticed that flashcp fails to verify data on flash devices implementing
newer SFDP revisions (D). Interestingly, the same setup works properly on
an older batch of devices.

$ flashcp file /dev/mtd0
File does not seem to match flash data. First mismatch at 
0x00000000-0x000000d0

All data gets successfully written into the device. Only the verify step 
seems
to fail.

After a bit of debugging, I observed that a partial readout of SFDP in
spi_nor_parse_bfpt() -> spi_nor_read_sfdp_dma_unsafe() with addr=0x30
and len=0x50 triggers the issue.
But when I reread the full SFDP block from addr=0 instead, the error 
disappears.

Is it possible that we may be overlooking the handling of a corner case for
SFDP reads on Micron flashes? Any guidance on where I should look at would
be very helpful.

Link to a short log of both devices including infos about mtd-utils
and kernel version along with a dump of the SFDP.

   https://pastebin.ubuntu.com/p/ZYy3RR88TQ

Regards,
Wadim




More information about the linux-mtd mailing list