PCI: keystone: Use hwirq to get the MSI IRQ number offset
authorKishon Vijay Abraham I <kishon@ti.com>
Thu, 21 Mar 2019 09:59:22 +0000 (15:29 +0530)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Thu, 4 Apr 2019 16:09:36 +0000 (17:09 +0100)
commitf6f2900ca9b7c79d304e0cc264b010ed1c86a6b1
tree994933ed677ff6bafc8ba9c54d3de4838ff82ef0
parent1146c2953dcbd5eb01e415f528015206479e8fe3
PCI: keystone: Use hwirq to get the MSI IRQ number offset

ks_pcie_msi_irq_handler() uses 'virq' to get the IRQ number offset.
This offset is used to get the correct MSI_IRQ_STATUS register
corresponding to the IRQ line that raised the interrupt.

There is no guarantee that 'virq' assigned for consecutive hardware
IRQ will be contiguous and this might get us an incorrect IRQ number
offset.

Fix it here by using 'hwirq' to get the IRQ number offset. Since we
don't store the 'virq' numbers of all the IRQ numbers, stop checking
if irq count is greater than MAX_MSI_HOST_IRQS and remove
MAX_MSI_HOST_IRQS.

Link: https://lkml.kernel.org/r/bb081d21-7c03-0357-4294-7e92d95d838c@arm.com
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
drivers/pci/controller/dwc/pci-keystone.c