Re: [PATCH 1/1] mtd: spi-nor: remove WARN_ONCE() message in spi_nor_write()

From: Brian Norris
Date: Fri Feb 10 2017 - 13:31:00 EST


On Thu, Feb 09, 2017 at 02:50:02PM +0100, Cyrille Pitchen wrote:
> In most, if not all, cases this warning is a false positive as for most
> memories it is valid to write a single page with more than one Page Program
> commands or to write data starting from the middle of the page.

Right, I agree that many cases were false positives, and the WARN is
rather scary, so it's definitely good to drop the WARN. And I've already
pulled that patch in, so we're good :)

> The only hardware limitation at the SPI NOR side is that we can't cross the
> page boundary.

Is it the *only* limitation? Marcin pointed out that at least for some
Macronix flash:

http://www.macronix.com/Lists/ApplicationNote/Attachments/1606/AN0302V1%20-%20MX25L_G%20Serial%20Flash%20Programming%20Guide.pdf

"it is strongly recommended that data be written to the MX25L_G using
full 256-byte pages"

.

Now I don't claim the original WARN captured this recommendation
correctly, but I was just nudging people to consider the original
intention.

> If we would do so, internally the SPI NOR memory would wrap
> the address instead of incrementing it hence the additional data would be
> written at the beginning of the same page and not at the beginning of the
> next one.

Brian