[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/11] ide: fix device_reset to not ignore pending AI
From: |
John Snow |
Subject: |
[Qemu-devel] [PULL 06/11] ide: fix device_reset to not ignore pending AIO |
Date: |
Wed, 10 Feb 2016 14:38:04 -0500 |
Signed-off-by: John Snow <address@hidden>
Reported-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: 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 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 */
--
2.4.3
- [Qemu-devel] [PULL 00/11] Ide patches, John Snow, 2016/02/10
- [Qemu-devel] [PULL 01/11] ide: Prohibit RESET on IDE drives, John Snow, 2016/02/10
- [Qemu-devel] [PULL 00/11] Ide patches, John Snow, 2016/02/10
- [Qemu-devel] [PULL 03/11] ide: move buffered DMA cancel to core, John Snow, 2016/02/10
- [Qemu-devel] [PULL 04/11] ide: replace blk_drain_all by blk_drain, John Snow, 2016/02/10
- [Qemu-devel] [PULL 02/11] ide: code motion, John Snow, 2016/02/10
- [Qemu-devel] [PULL 05/11] ide: Add silent DRQ cancellation, John Snow, 2016/02/10
- [Qemu-devel] [PULL 06/11] ide: fix device_reset to not ignore pending AIO,
John Snow <=
- [Qemu-devel] [PULL 07/11] fdc: always compile-check debug prints, John Snow, 2016/02/10
- [Qemu-devel] [PULL 10/11] ahci: explicitly reject bad engine states on post_load, John Snow, 2016/02/10
- [Qemu-devel] [PULL 08/11] ahci: Do not unmap NULL addresses, John Snow, 2016/02/10
- [Qemu-devel] [PULL 09/11] ahci: handle LIST_ON and FIS_ON in map helpers, John Snow, 2016/02/10
- [Qemu-devel] [PULL 11/11] ahci: prohibit "restarting" the FIS or CLB engines, John Snow, 2016/02/10