On 13/11/26 10:41, Yifan Wang wrote:
From: Chao Liu <[email protected]>

The flash clears the write enable latch when a WRSR2 command completes,
just like a WRSR write; otherwise a following program or erase could
proceed without a new WREN.

Fixes: 9785731ec4f7 ("hw/block:m25p80: Support write status register 2 command 
(0x31) for w25q01jvq")
Signed-off-by: Chao Liu <[email protected]>
Signed-off-by: Yifan Wang <[email protected]>
---
  hw/block/m25p80.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index 2a882c392c..d0a8ecf1b8 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -853,6 +853,9 @@ static void complete_collecting_data(Flash *s)
          default:
              break;
          }
+        if (s->write_enable) {
+            s->write_enable = false;

Directly assign? Otherwise:
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>

+        }
          break;
      case BRWR:
      case EXTEND_ADDR_WRITE:


Reply via email to