qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Hervé Poussineau" <hpoussin@reactos.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	qemu-block@nongnu.org, "John Snow" <jsnow@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	qemu-ppc@nongnu.org, "Hanna Reitz" <hreitz@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [PATCH v2 07/18] hw/ide/piix: Ensure IDE output IRQs are wired at realization
Date: Wed, 15 Feb 2023 17:16:30 +0100	[thread overview]
Message-ID: <20230215161641.32663-8-philmd@linaro.org> (raw)
In-Reply-To: <20230215161641.32663-1-philmd@linaro.org>

Ensure both IDE output IRQ lines are wired.

We can remove the last use of isa_get_irq(NULL).

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/ide/piix.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index 9d876dd4a7..b75a4ddcca 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -133,14 +133,17 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned i, Error **errp)
     static const struct {
         int iobase;
         int iobase2;
-        int isairq;
     } port_info[] = {
-        {0x1f0, 0x3f6, 14},
-        {0x170, 0x376, 15},
+        {0x1f0, 0x3f6},
+        {0x170, 0x376},
     };
     int ret;
 
-    qemu_irq irq_out = d->irq[i] ? : isa_get_irq(NULL, port_info[i].isairq);
+    if (!d->irq[i]) {
+        error_setg(errp, "output IDE IRQ %u not connected", i);
+        return false;
+    }
+
     ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2);
     ret = ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase,
                           port_info[i].iobase2);
@@ -149,7 +152,7 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned i, Error **errp)
                          object_get_typename(OBJECT(d)), i);
         return false;
     }
-    ide_bus_init_output_irq(&d->bus[i], irq_out);
+    ide_bus_init_output_irq(&d->bus[i], d->irq[i]);
 
     bmdma_init(&d->bus[i], &d->bmdma[i], d);
     d->bmdma[i].bus = &d->bus[i];
-- 
2.38.1



  parent reply	other threads:[~2023-02-15 16:19 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15 16:16 [PATCH v2 00/18] hw/ide: Untangle ISA/PCI abuses of ide_init_ioport() Philippe Mathieu-Daudé
2023-02-15 16:16 ` [PATCH v2 01/18] hw/isa: Rename isa_get_dma() -> isa_bus_get_dma() Philippe Mathieu-Daudé
2023-02-24  8:42   ` Thomas Huth
2023-02-15 16:16 ` [PATCH v2 02/18] hw/isa: Factor isa_bus_get_irq() out of isa_get_irq() Philippe Mathieu-Daudé
2023-02-24  8:44   ` Thomas Huth
2023-02-15 16:16 ` [PATCH v2 03/18] hw: Replace isa_get_irq() by isa_bus_get_irq() when ISABus is available Philippe Mathieu-Daudé
2023-02-24  8:51   ` Thomas Huth
2023-02-15 16:16 ` [PATCH v2 04/18] hw/ide/piix: Expose output IRQ as properties for late object population Philippe Mathieu-Daudé
2023-02-15 16:16 ` [PATCH v2 05/18] hw/i386/pc_piix: Wire PIIX3 IDE ouput IRQs to ISA bus IRQs 14/15 Philippe Mathieu-Daudé
2023-02-15 16:16 ` [PATCH v2 06/18] hw/isa/piix4: Wire PIIX4 " Philippe Mathieu-Daudé
2023-02-15 16:16 ` Philippe Mathieu-Daudé [this message]
2023-02-16 14:43   ` [PATCH v2 07/18] hw/ide/piix: Ensure IDE output IRQs are wired at realization Bernhard Beschow
2023-02-16 15:33     ` Philippe Mathieu-Daudé
2023-02-16 17:10       ` Bernhard Beschow
2023-02-19 21:54       ` Philippe Mathieu-Daudé
2023-02-20 23:49         ` Bernhard Beschow
2023-02-20 23:58           ` BALATON Zoltan
2023-02-21 11:45         ` Daniel P. Berrangé
2023-02-15 16:16 ` [PATCH v2 08/18] hw/isa: Deprecate isa_get_irq() in favor of isa_bus_get_irq() Philippe Mathieu-Daudé
2023-02-15 16:16 ` [PATCH v2 09/18] hw/isa: Simplify isa_address_space[_io]() Philippe Mathieu-Daudé
2023-02-15 16:16 ` [PATCH v2 10/18] hw/isa: Use isa_address_space_io() in isa_register_ioport() Philippe Mathieu-Daudé
2023-02-15 16:16 ` [PATCH v2 11/18] hw/ide: Declare ide_get_[geometry/bios_chs_trans] in 'hw/ide/internal.h' Philippe Mathieu-Daudé
2023-02-15 16:16 ` [PATCH v2 12/18] hw/ide: Rename ISA specific ide_init_ioport -> ide_bus_init_ioport_isa Philippe Mathieu-Daudé
2023-02-15 16:16 ` [PATCH v2 13/18] hw/ide: Introduce generic ide_init_ioport() Philippe Mathieu-Daudé
2023-02-15 16:16 ` [PATCH v2 14/18] hw/ide/piix: Use generic ide_bus_init_ioport() Philippe Mathieu-Daudé
2023-02-15 16:16 ` [PATCH v2 15/18] hw/isa: Ensure isa_register_portio_list() do not get NULL ISA device Philippe Mathieu-Daudé
2023-02-15 16:16 ` [PATCH v2 16/18] hw/isa: Reduce 'isabus' singleton scope to isa_bus_new() Philippe Mathieu-Daudé
2023-02-15 16:16 ` [PATCH v2 17/18] hw/isa: Un-inline isa_bus_from_device() Philippe Mathieu-Daudé
2023-02-16 15:28   ` Bernhard Beschow
2023-02-15 16:16 ` [PATCH v2 18/18] hw/isa: Remove empty ISADeviceClass structure Philippe Mathieu-Daudé
2023-02-16 15:28   ` Bernhard Beschow
2023-02-20  8:00 ` [PATCH v2 06.5/18] hw/ide/piix: Allow using PIIX3-IDE as standalone PCI function Philippe Mathieu-Daudé
2023-02-20  9:10   ` Gerd Hoffmann
2023-02-20  9:52     ` Philippe Mathieu-Daudé
2023-02-27 22:26       ` Philippe Mathieu-Daudé

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=20230215161641.32663-8-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=eduardo@habkost.net \
    --cc=hpoussin@reactos.org \
    --cc=hreitz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).