All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: linuxppc-dev@lists.ozlabs.org
Cc: "Cédric Le Goater" <clg@kaod.org>
Subject: [PATCH v2 08/32] powerpc/pseries/pci: Add a domain_free_irqs() handler
Date: Thu,  1 Jul 2021 15:27:26 +0200	[thread overview]
Message-ID: <20210701132750.1475580-9-clg@kaod.org> (raw)
In-Reply-To: <20210701132750.1475580-1-clg@kaod.org>

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>
---
 arch/powerpc/platforms/pseries/msi.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
index 86c6809ebac2..591cee9cbc9e 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -529,8 +529,24 @@ static int pseries_msi_ops_prepare(struct irq_domain *domain, struct device *dev
 	return rtas_prepare_msi_irqs(pdev, nvec, type, arg);
 }
 
+/*
+ * RTAS can not disable one MSI at a time. It's all or nothing. Do it
+ * at the end after all IRQs have been freed.
+ */
+static void pseries_msi_domain_free_irqs(struct irq_domain *domain,
+					 struct device *dev)
+{
+	if (WARN_ON_ONCE(!dev_is_pci(dev)))
+		return;
+
+	__msi_domain_free_irqs(domain, dev);
+
+	rtas_disable_msi(to_pci_dev(dev));
+}
+
 static struct msi_domain_ops pseries_pci_msi_domain_ops = {
 	.msi_prepare	= pseries_msi_ops_prepare,
+	.domain_free_irqs = pseries_msi_domain_free_irqs,
 };
 
 static void pseries_msi_shutdown(struct irq_data *d)
-- 
2.31.1


  parent reply	other threads:[~2021-07-01 13:29 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 13:27 [PATCH v2 00/32] powerpc: Add MSI IRQ domains to PCI drivers Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 01/32] powerpc/pseries/pci: Introduce __find_pe_total_msi() Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 02/32] powerpc/pseries/pci: Introduce rtas_prepare_msi_irqs() Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 03/32] powerpc/xive: Add support for IRQ domain hierarchy Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 04/32] powerpc/xive: Ease debugging of xive_irq_set_affinity() Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 05/32] powerpc/pseries/pci: Add MSI domains Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 06/32] powerpc/xive: Drop unmask of MSIs at startup Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 07/32] powerpc/xive: Remove irqd_is_started() check when setting the affinity Cédric Le Goater
2021-07-01 13:27 ` Cédric Le Goater [this message]
2021-07-01 13:27 ` [PATCH v2 09/32] powerpc/pseries/pci: Add a msi_free() handler to clear XIVE data Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 10/32] powerpc/pseries/pci: Add support of MSI domains to PHB hotplug Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 11/32] powerpc/powernv/pci: Introduce __pnv_pci_ioda_msi_setup() Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 12/32] powerpc/powernv/pci: Add MSI domains Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 13/32] KVM: PPC: Book3S HV: Use the new IRQ chip to detect passthrough interrupts Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 14/32] KVM: PPC: Book3S HV: XIVE: Change interface of passthrough interrupt routines Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 15/32] KVM: PPC: Book3S HV: XIVE: Fix mapping of passthrough interrupts Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 16/32] powerpc/xics: Remove ICS list Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 17/32] powerpc/xics: Rename the map handler in a check handler Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 18/32] powerpc/xics: Give a name to the default XICS IRQ domain Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 19/32] powerpc/xics: Add debug logging to the set_irq_affinity handlers Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 20/32] powerpc/xics: Add support for IRQ domain hierarchy Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 21/32] powerpc/powernv/pci: Customize the MSI EOI handler to support PHB3 Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 22/32] powerpc/pci: Drop XIVE restriction on MSI domains Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 23/32] powerpc/xics: Drop unmask of MSIs at startup Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 24/32] powerpc/pseries/pci: Drop unused MSI code Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 25/32] powerpc/powernv/pci: " Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 26/32] powerpc/powernv/pci: Adapt is_pnv_opal_msi() to detect passthrough interrupt Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 27/32] powerpc/xics: Fix IRQ migration Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 28/32] powerpc/powernv/pci: Set the IRQ chip data for P8/CXL devices Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 29/32] powerpc/powernv/pci: Rework pnv_opal_pci_msi_eoi() Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 30/32] KVM: PPC: Book3S HV: XICS: Fix mapping of passthrough interrupts Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 31/32] powerpc/xive: Use XIVE domain under xmon and debugfs Cédric Le Goater
2021-07-01 13:27 ` [PATCH v2 32/32] genirq: Improve "hwirq" output in /proc and /sys/ Cédric Le Goater
2021-08-18 13:38 ` [PATCH v2 00/32] powerpc: Add MSI IRQ domains to PCI drivers Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210701132750.1475580-9-clg@kaod.org \
    --to=clg@kaod.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.