diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2024-01-12 12:53:19 +0000 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2024-02-13 19:37:27 +0000 |
commit | a79e767ab147164195b664f359ea6e54294b4698 (patch) | |
tree | 9aab5cc8e9ea7aa538355ecdf5090e019fc2a7f6 | |
parent | fe082b54751dd4404c17a676a7d2f8630c91067c (diff) | |
download | qemu-a79e767ab147164195b664f359ea6e54294b4698.zip qemu-a79e767ab147164195b664f359ea6e54294b4698.tar.gz qemu-a79e767ab147164195b664f359ea6e54294b4698.tar.bz2 |
esp.c: update end of transfer logic at the end of esp_transfer_data()
Since esp_dma_done() is called in both cases, and ti_size cannot be zero
(otherwise esp_command_complete() would have been called instead), replace
the conditional logic with a single call to esp_dma_done().
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: Helge Deller <deller@gmx.de>
Tested-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20240112125420.514425-28-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
-rw-r--r-- | hw/scsi/esp.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 96123c5..6b0811d 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -925,16 +925,10 @@ void esp_transfer_data(SCSIRequest *req, uint32_t len) */ if (s->ti_cmd == (CMD_TI | CMD_DMA)) { - if (dmalen) { - esp_do_dma(s); - } else if (s->ti_size <= 0) { - /* - * If this was the last part of a DMA transfer then the - * completion interrupt is deferred to here. - */ - esp_dma_done(s); - esp_lower_drq(s); - } + /* When the SCSI layer returns more data, raise deferred INTR_BS */ + esp_dma_done(s); + + esp_do_dma(s); } else if (s->ti_cmd == CMD_TI) { esp_do_nodma(s); } |