Commit a67cc2d476 for qemu.org

commit a67cc2d47673dd07a9817edb97d186d4ca9447cc
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date:   Thu Nov 19 22:24:21 2026 +0100

    hw/dma/i8257: Honor the command register group-disable bit

    Command bit 2 of the 82C37-compatible DMA controller disables
    the channel group (PIIX3 datasheet, section 2.5.1.1). The model
    accepted but ignored it.
    Gate servicing on that bit and re-run the engine after a command
    write so re-enabling resumes pending requests.

    Fixes: 275033239681 ("Soundblaster 16 support")
    Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
    Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
    Message-ID: <20261119220838.52034-4-philmd@oss.qualcomm.com>

diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c
index f44632de3d..8ff4cbf497 100644
--- a/hw/dma/i8257.c
+++ b/hw/dma/i8257.c
@@ -195,6 +195,8 @@ static void i8257_write_cont(void *opaque, hwaddr nport, uint64_t data,
             return;
         }
         d->command = data;
+        /* A pending request may be serviced once the group is enabled. */
+        i8257_dma_run(d);
         break;

     case 0x01:
@@ -354,6 +356,11 @@ static void i8257_dma_run(void *opaque)
     int ichan;
     int rearm = 0;

+    /* DCOM bit 2 disables the channel group. */
+    if (d->command & CMD_BLOCK_CONTROLLER) {
+        return;
+    }
+
     if (d->running) {
         rearm = 1;
         goto out;