Skip to content

Commit e812020

Browse files
legoatermpe
authored andcommitted
powerpc/pseries/pci: Introduce rtas_prepare_msi_irqs()
This splits the routine setting the MSIs in two parts: allocation of MSIs for the PCI device at the FW level (RTAS) and the actual mapping and activation of the IRQs. rtas_prepare_msi_irqs() will serve as a handler for the PCI MSI domain. Signed-off-by: Cédric Le Goater <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 786e5b1 commit e812020

File tree

1 file changed

+19
-4
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+19
-4
lines changed

arch/powerpc/platforms/pseries/msi.c

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,11 @@ static void rtas_hack_32bit_msi_gen2(struct pci_dev *pdev)
373373
pci_write_config_dword(pdev, pdev->msi_cap + PCI_MSI_ADDRESS_HI, 0);
374374
}
375375

376-
static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type)
376+
static int rtas_prepare_msi_irqs(struct pci_dev *pdev, int nvec_in, int type,
377+
msi_alloc_info_t *arg)
377378
{
378379
struct pci_dn *pdn;
379-
int hwirq, virq, i, quota, rc;
380-
struct msi_desc *entry;
381-
struct msi_msg msg;
380+
int quota, rc;
382381
int nvec = nvec_in;
383382
int use_32bit_msi_hack = 0;
384383

@@ -456,6 +455,22 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type)
456455
return rc;
457456
}
458457

458+
return 0;
459+
}
460+
461+
static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type)
462+
{
463+
struct pci_dn *pdn;
464+
int hwirq, virq, i;
465+
int rc;
466+
struct msi_desc *entry;
467+
struct msi_msg msg;
468+
469+
rc = rtas_prepare_msi_irqs(pdev, nvec_in, type, NULL);
470+
if (rc)
471+
return rc;
472+
473+
pdn = pci_get_pdn(pdev);
459474
i = 0;
460475
for_each_pci_msi_entry(entry, pdev) {
461476
hwirq = rtas_query_irq_number(pdn, i++);

0 commit comments

Comments
 (0)