On 12/22/20 2:23 PM, BALATON Zoltan wrote: > On Tue, 22 Dec 2020, BALATON Zoltan via wrote: >> Hello, >> >> On Tue, 22 Dec 2020, Guenter Roeck wrote: >>> Hi, >>> >>> commit 459ca8bfa41 ("pci: Assert irqnum is between 0 and bus->nirqs in >>> pci_bus_change_irq_level") added sanity checks to the interrupt number >>> passed >>> to pci_bus_change_irq_level(). That makes sense, given that bus->irq_count >>> is indexed and sized by the number of interrupts. >>> >>> However, as it turns out, the interrupt number passed to this function >>> is the _mapped_ interrupt number. The result in assertion failures for >>> various >>> emulations. >>> >>> Examples (I don't know if there are others): >>> >>> - ppc4xx_pci_map_irq() maps the interrupt number to "slot - 1". Obviously >>> that isn't a good thing to do for slot 0, and indeed results in an >>> assertion as soon as slot 0 is initialized (presumably that is the root >>> bridge). Changing the mapping to "slot" doesn't help because valid slots >>> are 0..4, and only four interrupts are allocated. >> >> Is that with sam460ex? This ppc4xx_pci_map_irq appears in ppc4xx-host-bridge >> and hw/ppc/ppc440_pcix.c (which is used by sam460ex) has a >> ppc4xx-host-bridge. Other user of it may be the bamboo 440 board where this >> host bridge appears too. I did not see asserts with sam460ex but I've only >> tested it with AmigaOS which may use it in an odd way not tripping the check. > > I've just remembered that for sam460ex we had this commit: 484ab3dffadc > (sam460ex: Fix PCI interrupts with multiple devices) that changed that > mapping for that machine so I guess you got the exception with the bamboo > board then. I'm not sure though that similar fix is applicable fot that or > even that this fix is correct for sam460ex but appears to work so far. > Yes, it is for bamboo. I think I'll just keep the mapping I came up with; that seems to work for me.
Thanks, Guenter