On 03/02/2021 14:23, BALATON Zoltan wrote:
On Wed, 3 Feb 2021, Philippe Mathieu-Daudé wrote:
LSI SCSI on PReP is the unique particular case where we use fixed IRQ routing. All other cases use regular IRQ swizzling.
Signed-off-by: Philippe Mathieu-Daudé f4bug@amsat.org
drivers/pci.c | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-)
diff --git a/drivers/pci.c b/drivers/pci.c index a2774d2..ef9a2da 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -1991,28 +1991,15 @@ static void ob_pci_host_bus_interrupt(ucell dnode, u32 *props, int *ncells, u32 { *ncells += pci_encode_phys_addr(props + *ncells, 0, 0, addr, 0, 0);
- if (is_apple()) { - /* Mac machines */ - props[(*ncells)++] = intno; - props[(*ncells)++] = dnode; - props[(*ncells)++] = arch->irqs[((intno - 1) + (addr >> 11)) & 3]; - props[(*ncells)++] = 1; + props[(*ncells)++] = intno; + props[(*ncells)++] = dnode; + if (!is_apple() && (PCI_DEV(addr) == 1 && PCI_FN(addr) == 0)) { + /* On PReP machine the LSI SCSI has fixed routing to IRQ 13 */
I don't really care so feel free to ignore this comment but is there a way to check for what the comment says, i.e. we're on PReP and device vendor/product ID matches the SCSI controller, instead of what we have here that says if it's not a Mac then anything in this slot will use IRQ 13 which theoretically could match unwanted devices?
Note that this version of ob_pci_host_bus_interrupt() is in a #if defined(CONFIG_PPC) ... #endif block and so !is_apple() is enough to distinguish between PReP and Mac machines. This pattern is used in quite a few places within OpenBIOS and so I'd expect quite a few things to break if this assumption ever changed...
ATB,
Mark.