[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/pci-host/grackle: Verify PIC link is properly set

From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] hw/pci-host/grackle: Verify PIC link is properly set
Date: Mon, 12 Oct 2020 14:01:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1

On 10/12/20 11:23 AM, Mark Cave-Ayland wrote:
On 11/10/2020 20:03, Philippe Mathieu-Daudé wrote:

The Grackle PCI host model expects the interrupt controller
being set, but does not verify it is present. Add a check to
help developers using this model.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
  hw/pci-host/grackle.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c
index 57c29b20afb..20361d215ca 100644
--- a/hw/pci-host/grackle.c
+++ b/hw/pci-host/grackle.c
@@ -76,6 +76,10 @@ static void grackle_realize(DeviceState *dev, Error **errp)
      GrackleState *s = GRACKLE_PCI_HOST_BRIDGE(dev);
      PCIHostState *phb = PCI_HOST_BRIDGE(dev);
+ if (!s->pic) {
+        error_setg(errp, TYPE_GRACKLE_PCI_HOST_BRIDGE ": 'pic' link not set");
+        return;
+    }
      phb->bus = pci_register_root_bus(dev, NULL,

Reviewing this now, my feeling is that both grackle and uninorth are doing the 
thing here by passing in a link to the PIC - certainly if I had written this 
recently than I originally did, I would simply use qdev_init_gpio_out() for the 
lines and do the wiring during machine init.

I've got a few other things to look at first, but I'll post a patchset later 
which I
think will improve this for both Mac machines.

Awesome, thanks!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]