Skip to content

Commit 07817a5

Browse files
legoatermpe
authored andcommitted
powerpc/pseries/pci: Add a domain_free_irqs() handler
The RTAS firmware can not disable one MSI at a time. It's all or nothing. We need a custom free IRQ handler for that. 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-9-clg@kaod.org
1 parent 292145a commit 07817a5

File tree

1 file changed

+16
-0
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+16
-0
lines changed

arch/powerpc/platforms/pseries/msi.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,24 @@ static int pseries_msi_ops_prepare(struct irq_domain *domain, struct device *dev
529529
return rtas_prepare_msi_irqs(pdev, nvec, type, arg);
530530
}
531531

532+
/*
533+
* RTAS can not disable one MSI at a time. It's all or nothing. Do it
534+
* at the end after all IRQs have been freed.
535+
*/
536+
static void pseries_msi_domain_free_irqs(struct irq_domain *domain,
537+
struct device *dev)
538+
{
539+
if (WARN_ON_ONCE(!dev_is_pci(dev)))
540+
return;
541+
542+
__msi_domain_free_irqs(domain, dev);
543+
544+
rtas_disable_msi(to_pci_dev(dev));
545+
}
546+
532547
static struct msi_domain_ops pseries_pci_msi_domain_ops = {
533548
.msi_prepare = pseries_msi_ops_prepare,
549+
.domain_free_irqs = pseries_msi_domain_free_irqs,
534550
};
535551

536552
static void pseries_msi_shutdown(struct irq_data *d)

0 commit comments

Comments
 (0)