]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
ide: perform SRST as early as possible
authorJohn Snow <jsnow@redhat.com>
Tue, 20 Oct 2020 20:02:41 +0000 (16:02 -0400)
committerJohn Snow <jsnow@redhat.com>
Tue, 27 Oct 2020 14:39:06 +0000 (10:39 -0400)
We don't need to wait for the falling edge. We can set BSY as
soon as possible and begin immediately resetting the drive. Devices
don't appear to need to take any specific action on the falling edge.

Signed-off-by: John Snow <jsnow@redhat.com>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-id: 20201020200242.1497705-3-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
hw/ide/core.c

index 84e887d4269d7627fb0fc0983137a7511ecf74d3..98cea7ad45075306723ac49fb4db21069a0c6994 100644 (file)
@@ -2280,9 +2280,7 @@ void ide_ctrl_write(void *opaque, uint32_t addr, uint32_t val)
 
     /* Device0 and Device1 each have their own control register,
      * but QEMU models it as just one register in the controller. */
-    if ((bus->cmd & IDE_CTRL_RESET) &&
-        !(val & IDE_CTRL_RESET)) {
-        /* SRST triggers on falling edge */
+    if (!(bus->cmd & IDE_CTRL_RESET) && (val & IDE_CTRL_RESET)) {
         for (i = 0; i < 2; i++) {
             s = &bus->ifs[i];
             s->status |= BUSY_STAT;