mtd: spi-nor: intel-spi: Simulate WRDI command
Subsystems (2)
PATCH 1/1 mtd: spi-nor: intel-spi: Simulate WRDI command
From: Alexander Sverdlin <[email protected]>
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.
--- drivers/mtd/spi-nor/controllers/intel-spi.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/mtd/spi-nor/controllers/intel-spi.c +8 -0
@@ -612,6 +612,14 @@ 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 seuencer we cannot use preopcode any way, so just ignore +* 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 */
Signature · 1 line
2.10.2
+ Mika
Hi, Mika,
Would you please review the patch from below?
Thanks!
Quoted 42 lines · Alexander Sverdlin
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
From: Alexander Sverdlin <[email protected]>
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]>--- drivers/mtd/spi-nor/controllers/intel-spi.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/mtd/spi-nor/controllers/intel-spi.c +8
-1@@ -612,6 +612,14 @@ 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 seuencer we cannot use preopcode any way, so just ignore +* 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 */ --2.10.2
Hi,
Quoted 5 lines · On Wed, Jul 22, 2020 at 02:28:30PM +0000, [email protected] wrote:
+ Mika
Hi, Mika,
Would you please review the patch from below?
Sure, there is minor comment below.
Quoted 32 lines
Thanks!
Quoted 28 lines · Alexander Sverdlin
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
From: Alexander Sverdlin <[email protected]>
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]>--- drivers/mtd/spi-nor/controllers/intel-spi.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/mtd/spi-nor/controllers/intel-spi.c +0
-0@@ -612,6 +612,14 @@ static int intel_spi_write_reg(struct spi_nor *nor, u8 opcode, const u8 *buf,return 0 ; }
Quoted 3 lines
drivers/mtd/spi-nor/controllers/intel-spi.c static int intel_spi_write_reg(struct spi_nor *nor, u8 opcode, const u8 *buf, · line 617
Quoted 3 lines
drivers/mtd/spi-nor/controllers/intel-spi.c +3
-0+/* +* We hope that HW sequencer will do the right thing automatically and +* with the SW seuencer we cannot use preopcode any way, so just ignore
^^^^^^^^
Typo, should be sequencer.
Otherwise looks good to me.
Quoted 45 lines · Mika Westerberg
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Hi,
Quoted 5 lines · On Wed, Jul 22, 2020 at 02:28:30PM +0000, [email protected] wrote:
+ Mika
Hi, Mika,
Would you please review the patch from below?
Sure, there is minor comment below.
Quoted 32 lines
Thanks!
Quoted 28 lines · Alexander Sverdlin
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
From: Alexander Sverdlin <[email protected]>
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]>--- drivers/mtd/spi-nor/controllers/intel-spi.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/mtd/spi-nor/controllers/intel-spi.c +0
-0@@ -612,6 +612,14 @@ static int intel_spi_write_reg(struct spi_nor *nor, u8 opcode, const u8 *buf,return 0 ; }
Quoted 8 lines
Quoted 3 lines
drivers/mtd/spi-nor/controllers/intel-spi.c static int intel_spi_write_reg(struct spi_nor *nor, u8 opcode, const u8 *buf, · line 617
Quoted 3 lines
drivers/mtd/spi-nor/controllers/intel-spi.c +3
-0+/* +* We hope that HW sequencer will do the right thing automatically and +* with the SW seuencer we cannot use preopcode any way, so just ignore ^^^^^^^^Typo, should be sequencer.
Otherwise looks good to me.
It looks good to me too. Should I add your R-b tag when applying? I can fix the typo.
Cheers,
ta
Hi!
On 22/07/2020 17:18, [email protected] wrote:
[...]
Quoted 30 lines
Quoted 30 lines
Quoted 24 lines
Quoted 24 lines
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]>--- drivers/mtd/spi-nor/controllers/intel-spi.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/mtd/spi-nor/controllers/intel-spi.c +0
-0@@ -612,6 +612,14 @@ static int intel_spi_write_reg(struct spi_nor *nor, u8 opcode, const u8 *buf,return 0 ; }Quoted 3 lines
drivers/mtd/spi-nor/controllers/intel-spi.c static int intel_spi_write_reg(struct spi_nor *nor, u8 opcode, const u8 *buf, · line 617
Quoted 3 lines
drivers/mtd/spi-nor/controllers/intel-spi.c +3
-0+/* +* We hope that HW sequencer will do the right thing automatically and +* with the SW seuencer we cannot use preopcode any way, so just ignore ^^^^^^^^Typo, should be sequencer.
Quoted 4 lines
Quoted 2 lines
Otherwise looks good to me.
It looks good to me too. Should I add your R-b tag when applying? I can fix the typo.
Thank you, Mika, Tudor!
Signature · 2 lines
Best regards, Alexander Sverdlin.
Quoted 52 lines · On Wed, Jul 22, 2020 at 03:18:50PM +0000, [email protected] wrote:
Quoted 51 lines · Mika Westerberg
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Hi,
Quoted 5 lines · On Wed, Jul 22, 2020 at 02:28:30PM +0000, [email protected] wrote:
+ Mika
Hi, Mika,
Would you please review the patch from below?
Sure, there is minor comment below.
Quoted 32 lines
Thanks!
Quoted 28 lines · Alexander Sverdlin
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
From: Alexander Sverdlin <[email protected]>
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]>--- drivers/mtd/spi-nor/controllers/intel-spi.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/mtd/spi-nor/controllers/intel-spi.c +0
-0@@ -612,6 +612,14 @@ static int intel_spi_write_reg(struct spi_nor *nor, u8 opcode, const u8 *buf,return 0 ; }Quoted 3 lines
drivers/mtd/spi-nor/controllers/intel-spi.c static int intel_spi_write_reg(struct spi_nor *nor, u8 opcode, const u8 *buf, · line 617
Quoted 3 lines
drivers/mtd/spi-nor/controllers/intel-spi.c +3
-0+/* +* We hope that HW sequencer will do the right thing automatically and +* with the SW seuencer we cannot use preopcode any way, so just ignore ^^^^^^^^Typo, should be sequencer.
Quoted 5 lines
Quoted 2 lines
Otherwise looks good to me.
It looks good to me too. Should I add your R-b tag when applying? I can fix the typo.
Sure. Thanks!
Tudor Ambarus
AppliedQuoted 8 lines · Alexander Sverdlin
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.
Applied to spi-nor/next, thanks!
[1/1] mtd: spi-nor: intel-spi: Simulate WRDI command
https://git.kernel.org/mtd/c/44a80df4bfce
Best regards,
Signature · 1 line
Tudor Ambarus <[email protected]>