No functional change in this patch, only cosmetics:
Use indentation width = 4 spaces everywhere, fix typo in
one of the comments ("Child pin" instead of "Chile pin"),
and rename "swizzledpin" in the return stack comments
to "parentpin" to match the non-return stack comments.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
PCI bridges can have up to 31 slots. If we limit the value
from pci-addr2dev with "modulo 4", all devices in slots 4
and higher won't work correctly since the interrupt-map
property then contains wrong values in this case. For
example, when QEMU is started with the following command
line, Linux is not able to use the balloon device:
qemu-system-ppc64 ... \
-device pci-bridge,bus=pci.0,id=bridge1,chassis_nr=1,addr=0x6 \
-device virtio-balloon-pci,id=balloon0,bus=bridge1,addr=5
To fix this issue, simply remove the bogus "4 mod" calculation.
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1366953
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
The legacy PCI interrupts in the device tree are enumerated from 1
to 4. However, the code in pci-gen-irq-map-one generates numbers
between 0 and 3 instead. This renders devices unusable by Linux
in case they should use IRQ 4. For example, when starting QEMU with
qemu-system-ppc64 ... \
-device pci-bridge,bus=pci.0,id=bridge1,chassis_nr=1,addr=0x6 \
-device virtio-balloon-pci,id=balloon0,bus=bridge1,addr=3
Linux can not use the balloon device since it is unable to determine
the right IRQ number in this case.
To fix this issue, we've simply got to make sure that the IRQ
numbers are in the range from 1 to 4 instead of 0 to 3.
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1366953
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
The previous scheme always put 0 as a parent slot#. However it is
not always the case and QEMU's PCI bridge does not support putting
device at slot#0 as it claims SHPC support for hotplug.
This modifies the interrups map to let the linux guest resolve XICS
global interrupt number correctly.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
We now support populating the device-nodes ourselves when using
a newer qemu which doesn't do it anymore.
Note: I have removed the support for working with the existing
device nodes, so qemu needs to be updated in sync with slof
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>