Skip to content

Commit 7e44041

Browse files
Mauri Sandbergr-vignesh
authored andcommitted
mtd: cfi_cmdset_0002: Disable buffered writes for AMD chip 0x2201
Buffer writes do not work with AMD chip 0x2201. The chip in question is a AMD/Spansion/Cypress Semiconductor S29GL256N and datasheet [1] talks about writing buffers being possible. While waiting for a neater solution resort to writing word-sized chunks only. Without the patch kernel logs will be flooded with entries like below: jffs2_scan_eraseblock(): End of filesystem marker found at 0x0 jffs2_build_filesystem(): unlocking the mtd device... done. jffs2_build_filesystem(): erasing all blocks after the end marker... MTD do_write_buffer_wait(): software timeout, address:0x01ec000a. jffs2: Write clean marker to block at 0x01920000 failed: -5 MTD do_write_buffer_wait(): software timeout, address:0x01e2000a. jffs2: Write clean marker to block at 0x01880000 failed: -5 MTD do_write_buffer_wait(): software timeout, address:0x01e0000a. jffs2: Write clean marker to block at 0x01860000 failed: -5 MTD do_write_buffer_wait(): software timeout, address:0x01dc000a. jffs2: Write clean marker to block at 0x01820000 failed: -5 MTD do_write_buffer_wait(): software timeout, address:0x01da000a. jffs2: Write clean marker to block at 0x01800000 failed: -5 ... Tested on a Buffalo wzr-hp-g300nh running kernel 5.10.16. [1] https://www.cypress.com/file/219941/download or https://datasheetspdf.com/pdf-file/565708/SPANSION/S29GL256N/1 Signed-off-by: Mauri Sandberg <sandberg@mailfence.com> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Link: https://lore.kernel.org/r/20210309174859.362060-1-sandberg@mailfence.com
1 parent a38fd87 commit 7e44041

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/mtd/chips/cfi_cmdset_0002.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ static void fixup_use_write_buffers(struct mtd_info *mtd)
272272
{
273273
struct map_info *map = mtd->priv;
274274
struct cfi_private *cfi = map->fldrv_priv;
275+
276+
if (cfi->mfr == CFI_MFR_AMD && cfi->id == 0x2201)
277+
return;
278+
275279
if (cfi->cfiq->BufWriteTimeoutTyp) {
276280
pr_debug("Using buffer write method\n");
277281
mtd->_write = cfi_amdstd_write_buffers;

0 commit comments

Comments
 (0)