[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v2 6/6] ide: fix device_reset to not ignore pending
From: |
John Snow |
Subject: |
[Qemu-block] [PATCH v2 6/6] ide: fix device_reset to not ignore pending AIO |
Date: |
Tue, 19 Jan 2016 12:39:51 -0500 |
Signed-off-by: John Snow <address@hidden>
---
hw/ide/core.c | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 9bc8e58..c68d1d4 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -502,7 +502,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);
@@ -1295,6 +1294,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) {
@@ -1611,15 +1627,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 */
--
2.4.3
- [Qemu-block] [PATCH v2 0/6] ide: fix atapi software reset, John Snow, 2016/01/19
- [Qemu-block] [PATCH v2 1/6] ide: Prohibit RESET on IDE drives, John Snow, 2016/01/19
- [Qemu-block] [PATCH v2 2/6] ide: code motion, John Snow, 2016/01/19
- [Qemu-block] [PATCH v2 4/6] ide: replace blk_drain_all by blk_drain, John Snow, 2016/01/19
- [Qemu-block] [PATCH v2 5/6] ide: Add silent DRQ cancellation, John Snow, 2016/01/19
- [Qemu-block] [PATCH v2 3/6] ide: move buffered DMA cancel to core, John Snow, 2016/01/19
- [Qemu-block] [PATCH v2 6/6] ide: fix device_reset to not ignore pending AIO,
John Snow <=
- Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/6] ide: fix atapi software reset, John Snow, 2016/01/26