]> Git Repo - qemu.git/commitdiff
scsi: Fix SCSI bus reset
authorJan Kiszka <[email protected]>
Tue, 6 Jul 2010 08:58:03 +0000 (10:58 +0200)
committerAnthony Liguori <[email protected]>
Tue, 6 Jul 2010 15:36:27 +0000 (10:36 -0500)
When the controller raises the SCSI reset line, we have to perform the
requested reset on all disks attached to the controller's bus. Moreover,
reset is edge triggered, so avoid repeating it if the line was already
high.

Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
hw/lsi53c895a.c

index 1bb1caf478a358eead6ffe061ba49d950c7d3a76..bd7b661426023929d58f0e1748dc54ae3a1ff436 100644 (file)
@@ -1590,8 +1590,19 @@ static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val)
             BADF("Immediate Arbritration not implemented\n");
         }
         if (val & LSI_SCNTL1_RST) {
-            s->sstat0 |= LSI_SSTAT0_RST;
-            lsi_script_scsi_interrupt(s, LSI_SIST0_RST, 0);
+            if (!(s->sstat0 & LSI_SSTAT0_RST)) {
+                DeviceState *dev;
+                int id;
+
+                for (id = 0; id < s->bus.ndev; id++) {
+                    if (s->bus.devs[id]) {
+                        dev = &s->bus.devs[id]->qdev;
+                        dev->info->reset(dev);
+                    }
+                }
+                s->sstat0 |= LSI_SSTAT0_RST;
+                lsi_script_scsi_interrupt(s, LSI_SIST0_RST, 0);
+            }
         } else {
             s->sstat0 &= ~LSI_SSTAT0_RST;
         }
This page took 0.027027 seconds and 4 git commands to generate.