From patchwork Sun Aug 2 15:29:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naphtali Sprei X-Patchwork-Id: 30475 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 98876B70D7 for ; Mon, 3 Aug 2009 01:30:53 +1000 (EST) Received: from localhost ([127.0.0.1]:55996 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXd1N-0007T3-D5 for incoming@patchwork.ozlabs.org; Sun, 02 Aug 2009 11:30:49 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXd0v-0007Sy-Tn for qemu-devel@nongnu.org; Sun, 02 Aug 2009 11:30:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXd0q-0007QX-Bq for qemu-devel@nongnu.org; Sun, 02 Aug 2009 11:30:20 -0400 Received: from [199.232.76.173] (port=46610 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXd0q-0007QT-6D for qemu-devel@nongnu.org; Sun, 02 Aug 2009 11:30:16 -0400 Received: from mx2.redhat.com ([66.187.237.31]:39364) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MXd0p-0002UJ-Lz for qemu-devel@nongnu.org; Sun, 02 Aug 2009 11:30:16 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n72FTXK8026062; Sun, 2 Aug 2009 11:29:44 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n72FTMl4014291; Sun, 2 Aug 2009 11:29:28 -0400 Received: from [10.35.0.60] (dhcp-0-60.tlv.redhat.com [10.35.0.60]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n72FTLtl024405; Sun, 2 Aug 2009 11:29:22 -0400 Message-ID: <4A75B0D1.5030306@redhat.com> Date: Sun, 02 Aug 2009 18:29:21 +0300 From: Naphtali Sprei User-Agent: Thunderbird 2.0.0.21 (X11/20090409) MIME-Version: 1.0 To: Anthony Liguori Subject: Re: [Qemu-devel] [PATCH] call ide_reset when resetting the piix References: <4A6DD8F0.5060606@redhat.com> <4A719F1F.40904@codemonkey.ws> In-Reply-To: <4A719F1F.40904@codemonkey.ws> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: qemu-devel@nongnu.org X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Anthony Liguori wrote: > Naphtali Sprei wrote: >> 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 >> > > What is this against? > >> - qemu_register_reset(piix3_reset, 0, d); >> - piix3_reset(d); >> - >> > > qemu_register_reset hasn't had this signature in a long time. I think > you need to rebase against tip. thanks, rebased against tip. Also added text to comment. Naphtali > > Regards, > > Anthony Liguori > > Subject: [PATCH] call ide_reset when resetting the piix 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. Moved the location of calling piix3_reset since now it must come after initialization: ide_init2, it eventually calls ide_dummy_transfer_stop that uses the io_buffer. Signed-off-by: Naphtali Sprei --- hw/ide.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/ide.c b/hw/ide.c index 6cf04a6..7e1b776 100644 --- a/hw/ide.c +++ b/hw/ide.c @@ -3368,6 +3368,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; @@ -3399,9 +3401,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, d); - piix3_reset(d); - pci_register_bar((PCIDevice *)d, 4, 0x10, PCI_ADDRESS_SPACE_IO, bmdma_map); @@ -3414,6 +3413,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, d); + piix3_reset(d); + register_savevm("ide", 0, 2, pci_ide_save, pci_ide_load, d); } @@ -3439,9 +3441,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, d); - piix3_reset(d); - pci_register_bar((PCIDevice *)d, 4, 0x10, PCI_ADDRESS_SPACE_IO, bmdma_map); @@ -3450,6 +3449,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, d); + piix3_reset(d); + register_savevm("ide", 0, 2, pci_ide_save, pci_ide_load, d); }