This patch fixes up a regression with virtio not working under the latest OpenBIOS SPARC64.
The error was introduced by the new interrupt routing code which needs to generate interrupt-map properties based upon the current active PCI slot (previously the OS would determine this automatically as the properties weren't present in the device tree).
In its current form, the code works by hard-coding the slots for the network and disk devices; however this fails to map the interrupt for devices added at QEMU runtime via device such as virtio.
This patchset fixes this problem in the following way:
1) Move the PCI host interrupt setup from out of the per-device host bridge callback (called generally towards the start of the PCI bus scan) and into a separate function called after the entire PCI bus has been scanned
2) Add code to dynamically generate the interrupt-map property for slots containing devices with an interrupt pin once the PCI bus scan is complete
3) As a bonus: tidy up the openpic interrupt mapping into the same routine
I believe there is a strong case for getting this patchset into the upcoming QEMU 2.2 release, so please let me know if there are any great objections.
Mark Cave-Ayland (4): pci.c: remove unneeded CONFIG_PPC define pci.c: rework pci_host_set_interrupt_map() to use phandle_t rather than pci_config_t macio.c: move openpic interrupt map initialisation to after PCI bus scan pci.c: move openpic interrupt mapping to post-PCI-bus scan
openbios-devel/drivers/macio.c | 40 --------- openbios-devel/drivers/pci.c | 185 +++++++++++++++++++++++++--------------- 2 files changed, 116 insertions(+), 109 deletions(-)