Commit c12cd67241 for qemu.org

commit c12cd67241c77dd601f62004aacd02a636ecb07f
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date:   Tue Nov 24 19:44:11 2026 +0100

    hw/block/pflash_cfi01: Allow zero-count buffer write

    Linux's Intel CFI driver emits a zero count for a single buffered
    write (one write cycle, at any bank width). The block update buffer
    was only started for non-zero counts, so the data was rejected with
    a programming error. Enable the block update buffer for any count.

    Cc: qemu-stable@nongnu.org
    Fixes: 2563be6317fa ("hw/pflash: fix block write start")
    Reported-by: Daniel Skinstad Drabitzius <daniel.drabitzius@northern.tech>
    Suggested-by: Daniel Skinstad Drabitzius <daniel.drabitzius@northern.tech>
    Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4111
    Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
    Message-ID: <20261124185556.81132-3-philmd@oss.qualcomm.com>

diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c
index 78cb221dda..72c544dee8 100644
--- a/hw/block/pflash_cfi01.c
+++ b/hw/block/pflash_cfi01.c
@@ -605,7 +605,7 @@ static void pflash_write(PFlashCFI01 *pfl, hwaddr offset,
         switch (pfl->cmd) {
         case 0xe8: /* Block write */
             /* FIXME check @offset, @width */
-            if (pfl->blk_offset == -1 && pfl->counter) {
+            if (pfl->blk_offset == -1) {
                 pflash_blk_write_start(pfl, offset);
             }
             if (!pfl->ro && (pfl->blk_offset != -1)) {