From: Mark Cave-Ayland Date: Fri, 12 Jan 2024 12:53:56 +0000 (+0000) Subject: esp.c: don't raise INTR_BS interrupt in DATA IN phase until TI command issued X-Git-Tag: v9.0.0-rc0~66^2~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9655f72c20385a535158540ab1daaf71b9222d68;p=thirdparty%2Fqemu.git esp.c: don't raise INTR_BS interrupt in DATA IN phase until TI command issued In the case where a SCSI command with a DATA IN phase has been issued, the host may preload the FIFO with unaligned bytes before issuing the main DMA transfer. When accumulating data in the FIFO don't raise the INTR_BS interrupt until the TI command is issued, otherwise the unexpected interrupt can confuse the host. In particular this is needed to prevent the MacOS Disk Utility from failing when switching non-DMA transfers to use esp_do_nodma(). Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-65-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 bcebd008317..dd6bf6f0335 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -786,6 +786,11 @@ static void esp_do_nodma(ESPState *s) return; } + /* If preloading the FIFO, defer until TI command issued */ + if (s->rregs[ESP_CMD] != CMD_TI) { + return; + } + s->rregs[ESP_RINTR] |= INTR_BS; esp_raise_irq(s); break;