From: Mark Cave-Ayland Date: Fri, 12 Jan 2024 12:53:13 +0000 (+0000) Subject: esp.c: update condition for esp_dma_done() in esp_do_dma() to device path X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c5bd505524303bd8cb9eaf5d44ca7e1713d27f90;p=qemu.git esp.c: update condition for esp_dma_done() in esp_do_dma() to device path Ensure that esp_dma_done() is only called when TC is zero, which is currently always the case for DMA transfers. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-22-mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 96723efcf3..06be9f2e74 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -725,9 +725,11 @@ static void esp_do_dma(ESPState *s) return; } - /* Partially filled a scsi buffer. Complete immediately. */ - esp_dma_done(s); - esp_lower_drq(s); + if (esp_get_tc(s) == 0) { + /* Partially filled a scsi buffer. Complete immediately. */ + esp_dma_done(s); + esp_lower_drq(s); + } } else { esp_set_pdma_cb(s, DO_DMA_PDMA_CB); esp_raise_drq(s);