Skip to content

Commit

Permalink
powerpc/pseries/pci: Introduce rtas_prepare_msi_irqs()
Browse files Browse the repository at this point in the history
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 <clg@kaod.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210701132750.1475580-3-clg@kaod.org
  • Loading branch information
Cédric Le Goater authored and Michael Ellerman committed Aug 10, 2021
1 parent 786e5b1 commit e812020
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions arch/powerpc/platforms/pseries/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,11 @@ static void rtas_hack_32bit_msi_gen2(struct pci_dev *pdev)
pci_write_config_dword(pdev, pdev->msi_cap + PCI_MSI_ADDRESS_HI, 0);
}

static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type)
static int rtas_prepare_msi_irqs(struct pci_dev *pdev, int nvec_in, int type,
msi_alloc_info_t *arg)
{
struct pci_dn *pdn;
int hwirq, virq, i, quota, rc;
struct msi_desc *entry;
struct msi_msg msg;
int quota, rc;
int nvec = nvec_in;
int use_32bit_msi_hack = 0;

Expand Down Expand Up @@ -456,6 +455,22 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type)
return rc;
}

return 0;
}

static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type)
{
struct pci_dn *pdn;
int hwirq, virq, i;
int rc;
struct msi_desc *entry;
struct msi_msg msg;

rc = rtas_prepare_msi_irqs(pdev, nvec_in, type, NULL);
if (rc)
return rc;

pdn = pci_get_pdn(pdev);
i = 0;
for_each_pci_msi_entry(entry, pdev) {
hwirq = rtas_query_irq_number(pdn, i++);
Expand Down

0 comments on commit e812020

Please sign in to comment.