]> Git Repo - linux.git/commitdiff
mtd: spi-nor: intel-spi: Simulate WRDI command
authorAlexander Sverdlin <[email protected]>
Wed, 22 Jul 2020 14:01:36 +0000 (16:01 +0200)
committerTudor Ambarus <[email protected]>
Mon, 27 Jul 2020 05:24:39 +0000 (08:24 +0300)
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: bce679e5ae3a ("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]>
drivers/mtd/spi-nor/controllers/intel-spi.c

index 61d2a0ad21319f24aa0dd39b8101e77503f0c06c..3259c9fc981f8bedcfc450e0e40ab36a38ca8ee6 100644 (file)
@@ -612,6 +612,15 @@ static int intel_spi_write_reg(struct spi_nor *nor, u8 opcode, const u8 *buf,
                return 0;
        }
 
+       /*
+        * We hope that HW sequencer will do the right thing automatically and
+        * with the SW sequencer we cannot use preopcode anyway, so just ignore
+        * the Write Disable operation and pretend it was completed
+        * successfully.
+        */
+       if (opcode == SPINOR_OP_WRDI)
+               return 0;
+
        writel(0, ispi->base + FADDR);
 
        /* Write the value beforehand */
This page took 0.065048 seconds and 4 git commands to generate.