summaryrefslogtreecommitdiffstats
path: root/hw/ide
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2016-02-10 13:29:39 -0500
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:41:57 -0600
commitc548422a37e9240407624aad45cea1de834bd1c0 (patch)
tree8d85f3cc14346388f5ac0ca4e18b34b34325f034 /hw/ide
parentb66255f2cec75f153bc2f3e428e1134820fc8fc0 (diff)
downloadhqemu-c548422a37e9240407624aad45cea1de834bd1c0.zip
hqemu-c548422a37e9240407624aad45cea1de834bd1c0.tar.gz
ide: fix device_reset to not ignore pending AIO
Signed-off-by: John Snow <jsnow@redhat.com> Reported-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1453225191-11871-7-git-send-email-jsnow@redhat.com
Diffstat (limited to 'hw/ide')
-rw-r--r--hw/ide/core.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 3c32b39..241e840 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -505,7 +505,6 @@ void ide_transfer_stop(IDEState *s)
ide_transfer_halt(s, ide_transfer_stop, true);
}
-__attribute__((__unused__))
static void ide_transfer_cancel(IDEState *s)
{
ide_transfer_halt(s, ide_transfer_cancel, false);
@@ -1298,6 +1297,23 @@ static bool cmd_nop(IDEState *s, uint8_t cmd)
return true;
}
+static bool cmd_device_reset(IDEState *s, uint8_t cmd)
+{
+ /* Halt PIO (in the DRQ phase), then DMA */
+ ide_transfer_cancel(s);
+ ide_cancel_dma_sync(s);
+
+ /* Reset any PIO commands, reset signature, etc */
+ ide_reset(s);
+
+ /* RESET: ATA8-ACS3 7.10.4 "Normal Outputs";
+ * ATA8-ACS3 Table 184 "Device Signatures for Normal Output" */
+ s->status = 0x00;
+
+ /* Do not overwrite status register */
+ return false;
+}
+
static bool cmd_data_set_management(IDEState *s, uint8_t cmd)
{
switch (s->feature) {
@@ -1614,15 +1630,6 @@ static bool cmd_exec_dev_diagnostic(IDEState *s, uint8_t cmd)
return false;
}
-static bool cmd_device_reset(IDEState *s, uint8_t cmd)
-{
- ide_set_signature(s);
- s->status = 0x00; /* NOTE: READY is _not_ set */
- s->error = 0x01;
-
- return false;
-}
-
static bool cmd_packet(IDEState *s, uint8_t cmd)
{
/* overlapping commands not supported */
OpenPOWER on IntegriCloud