lsi53c895a: do not do anything else if a reset is requested by writing ISTAT0
If the device is reset, anything that is done before will not really be visible. So do the reset and exit immediately if that is one of the requests in the value written to ISTAT0. Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini committed
Mar 27, 2026 at 17:39 UTC
64807c84e83f767c135aa9ba4b5f61162bb177ef
1 file changed
+4
-3
hw/scsi/lsi53c895a.c
+4
-3
@@ -1949,6 +1949,10 @@ static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val)
1949
CASE_SET_REG32(dsa, 0x10)
1950
case 0x14: /* ISTAT0 */
1951
s->istat0 = (s->istat0 & 0x0f) | (val & 0xf0);
1952
+ if (val & LSI_ISTAT0_SRST) {
1953
+ device_cold_reset(DEVICE(s));
1954
+ return;
1955
+ }
1956
if (val & LSI_ISTAT0_ABRT) {
1957
lsi_script_dma_interrupt(s, LSI_DSTAT_ABRT);
1958
}
@@ -1962,9 +1966,6 @@ static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val)
1966
s->dsp = s->dnad;
1967
lsi_execute_script(s);
1968
}
1965
- if (val & LSI_ISTAT0_SRST) {
1966
- device_cold_reset(DEVICE(s));
1967
- }
1969
break;
1970
case 0x16: /* MBOX0 */
1971
s->mbox0 = val;