diff options
author | John Snow <jsnow@redhat.com> | 2020-10-20 16:02:41 -0400 |
---|---|---|
committer | John Snow <jsnow@redhat.com> | 2020-10-27 10:39:06 -0400 |
commit | b45bcd81e05dea2781f2164ca1c9dd86069502ea (patch) | |
tree | 9c604af40f2c07b89a373ca751a02a5262deaf8c /hw/ide | |
parent | 4ac4e7281a2dd1ca5158812198c4d2cbacf2ae25 (diff) | |
download | qemu-b45bcd81e05dea2781f2164ca1c9dd86069502ea.zip qemu-b45bcd81e05dea2781f2164ca1c9dd86069502ea.tar.gz qemu-b45bcd81e05dea2781f2164ca1c9dd86069502ea.tar.bz2 |
ide: perform SRST as early as possible
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>
Diffstat (limited to 'hw/ide')
-rw-r--r-- | hw/ide/core.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c index 84e887d..98cea7a 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -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; |