All of lore.kernel.org
 help / color / mirror / Atom feed
From: Naphtali Sprei <nsprei@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] call ide_reset when resetting the piix
Date: Mon, 27 Jul 2009 19:42:24 +0300	[thread overview]
Message-ID: <4A6DD8F0.5060606@redhat.com> (raw)

In some cases reboot sequence fails to detect the ide device in the rombios
sequence for ata_detect, since ioport writes are ignored when the
ide device status indicates busy or data request in progres.
The ide if must be reset when system reset.

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
---
 hw/ide.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index f3787f2..4bf0987 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3352,6 +3352,8 @@ static void piix3_reset(void *opaque)
 
     for (i = 0; i < 2; i++)
         ide_dma_cancel(&d->bmdma[i]);
+    for (i = 0; i < 4; i++)
+        ide_reset(&d->ide_if[i]);
 
     pci_conf[0x04] = 0x00;
     pci_conf[0x05] = 0x00;
@@ -3383,9 +3385,6 @@ void pci_piix3_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn,
     pci_config_set_class(pci_conf, PCI_CLASS_STORAGE_IDE);
     pci_conf[PCI_HEADER_TYPE] = PCI_HEADER_TYPE_NORMAL; // header_type
 
-    qemu_register_reset(piix3_reset, 0, d);
-    piix3_reset(d);
-
     pci_register_bar((PCIDevice *)d, 4, 0x10,
                            PCI_ADDRESS_SPACE_IO, bmdma_map);
 
@@ -3398,6 +3397,9 @@ void pci_piix3_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn,
         if (hd_table[i])
             hd_table[i]->private = &d->dev;
 
+    qemu_register_reset(piix3_reset, 0, d);
+    piix3_reset(d);
+
     register_savevm("ide", 0, 2, pci_ide_save, pci_ide_load, d);
 }
 
@@ -3423,9 +3425,6 @@ void pci_piix4_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn,
     pci_config_set_class(pci_conf, PCI_CLASS_STORAGE_IDE);
     pci_conf[PCI_HEADER_TYPE] = PCI_HEADER_TYPE_NORMAL; // header_type
 
-    qemu_register_reset(piix3_reset, 0, d);
-    piix3_reset(d);
-
     pci_register_bar((PCIDevice *)d, 4, 0x10,
                            PCI_ADDRESS_SPACE_IO, bmdma_map);
 
@@ -3434,6 +3433,9 @@ void pci_piix4_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn,
     ide_init_ioport(&d->ide_if[0], 0x1f0, 0x3f6);
     ide_init_ioport(&d->ide_if[2], 0x170, 0x376);
 
+    qemu_register_reset(piix3_reset, 0, d);
+    piix3_reset(d);
+
     register_savevm("ide", 0, 2, pci_ide_save, pci_ide_load, d);
 }
 
-- 
1.5.5.6

             reply	other threads:[~2009-07-27 16:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-27 16:42 Naphtali Sprei [this message]
2009-07-27 17:17 ` [Qemu-devel] [PATCH] call ide_reset when resetting the piix Ryan Harper
2009-07-28 10:50   ` Naphtali Sprei
2009-07-30 13:24 ` Anthony Liguori
2009-08-02 15:29   ` Naphtali Sprei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A6DD8F0.5060606@redhat.com \
    --to=nsprei@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.