Skip to content

Commit 44a80df

Browse files
asverdlinambarus
authored andcommitted
mtd: spi-nor: intel-spi: Simulate WRDI command
After spi_nor_write_disable() return code checks were introduced in the spi-nor front end intel-spi backend stopped to work because WRDI was never supported and always failed. Just pretend it was sucessful and ignore the command itself. HW sequencer shall do the right thing automatically, while with SW sequencer we cannot do it anyway, because the only tool we had was preopcode and it makes no sense for WRDI. Fixes: bce679e ("mtd: spi-nor: Check for errors after each Register Operation") Signed-off-by: Alexander Sverdlin <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tudor Ambarus <[email protected]>
1 parent fb249e1 commit 44a80df

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/mtd/spi-nor/controllers/intel-spi.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,15 @@ static int intel_spi_write_reg(struct spi_nor *nor, u8 opcode, const u8 *buf,
612612
return 0;
613613
}
614614

615+
/*
616+
* We hope that HW sequencer will do the right thing automatically and
617+
* with the SW sequencer we cannot use preopcode anyway, so just ignore
618+
* the Write Disable operation and pretend it was completed
619+
* successfully.
620+
*/
621+
if (opcode == SPINOR_OP_WRDI)
622+
return 0;
623+
615624
writel(0, ispi->base + FADDR);
616625

617626
/* Write the value beforehand */

0 commit comments

Comments
 (0)