[PATCH] mtd: cfi_cmdset_0002: also clamp the write buffer of an x16 part strapped to x8
Miquel Raynal
miquel.raynal at bootlin.com
Mon Oct 12 11:28:29 PDT 2026
Hi Orgad,
On 06/10/2026 at 05:24:35 GMT, Orgad Shaneh <orgads at gmail.com> wrote:
> Commit cfc5ebc9540e ("mtd: cfi_cmdset_0002: cap the write-buffer chunk
> at 256 bytes on an x8 device") limits a Write to Buffer to 256 bytes
> when cfi->device_type is CFI_DEVICETYPE_X8, because do_write_buffer()
> sends the word count as a single bus word and an 8-bit data lane
> truncates it.
>
> The M29EW that commit was written for is an x16 part strapped to x8.
> The probe reports it as
>
> phys_mapped_flash: Found 1 x16 devices at 0x0 in 8-bit bank.
> Manufacturer ID 0x000089 Chip ID 0x00007e
>
> so its device_type is CFI_DEVICETYPE_X16, the clamp does not apply, and
> every full 512-byte chunk still times out:
>
> MTD do_write_buffer_wait(): software timeout, address:0x002203ff.
>
> What limits the count is the width of each device's data lane, not the
> part's type. Test that instead: map_bankwidth(map) / cfi_interleave(cfi)
> is 1 for an x8 part, for x8 parts interleaved on a wider bus, and for an
> x16 part in an 8-bit bank.
>
> On the board (Octeon CN6335, the same M29EW) writes of 1, 2, 32, 64 and
> 256 bytes to an erased partition read back correctly and 512, 1024,
> 2048 and 4096 failed with the timeout above; with this patch every size
> up to 64 KiB reads back correctly and the u-boot environment can be
> saved from Linux again.
>
It no longer applies, can you please rebase and resend?
Thanks,
Miquèl
More information about the linux-mtd
mailing list