All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lokesh Vutla <lokeshvutla@ti.com>
To: Nishanth Menon <nm@ti.com>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Rob Herring <robh+dt@kernel.org>, <tglx@linutronix.de>,
	<jason@lakedaemon.net>, <marc.zyngier@arm.com>
Cc: Linux ARM Mailing List <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, Tero Kristo <t-kristo@ti.com>,
	Sekhar Nori <nsekhar@ti.com>,
	Device Tree Mailing List <devicetree@vger.kernel.org>,
	Grygorii Strashko <grygorii.strashko@ti.com>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Lokesh Vutla <lokeshvutla@ti.com>
Subject: [RFC PATCH v3 09/13] genirq/msi: Add support for .msi_unprepare callback
Date: Tue, 6 Nov 2018 14:11:01 +0530	[thread overview]
Message-ID: <20181106084105.32483-10-lokeshvutla@ti.com> (raw)
In-Reply-To: <20181106084105.32483-1-lokeshvutla@ti.com>

Add an optional callback .msi_unprepare to struct msi_domain_ops.
This is used to clear any effect that is done by .msi_prepare callback.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
Changes since v2:
- New patch

 include/linux/msi.h |  3 +++
 kernel/irq/msi.c    | 10 ++++++++++
 2 files changed, 13 insertions(+)

diff --git a/include/linux/msi.h b/include/linux/msi.h
index 021f789226b5..1e37aa569a3c 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -237,6 +237,8 @@ struct msi_domain_ops {
 	int		(*msi_prepare)(struct irq_domain *domain,
 				       struct device *dev, int nvec,
 				       msi_alloc_info_t *arg);
+	void		(*msi_unprepare)(struct irq_domain *domain, int nvec,
+					 void *data);
 	void		(*msi_finish)(msi_alloc_info_t *arg, int retval);
 	void		(*set_desc)(msi_alloc_info_t *arg,
 				    struct msi_desc *desc);
@@ -317,6 +319,7 @@ void platform_msi_domain_free_irqs(struct device *dev);
 /* When an MSI domain is used as an intermediate domain */
 int msi_domain_prepare_irqs(struct irq_domain *domain, struct device *dev,
 			    int nvec, msi_alloc_info_t *args);
+void msi_domain_unprepare_irqs(struct irq_domain *domain, int nvec, void *data);
 int msi_domain_populate_irqs(struct irq_domain *domain, struct device *dev,
 			     int virq, int nvec, msi_alloc_info_t *args);
 struct irq_domain *
diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index e37238317fab..87ce5a5d0c6d 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -312,6 +312,16 @@ int msi_domain_prepare_irqs(struct irq_domain *domain, struct device *dev,
 	return ret;
 }
 
+void msi_domain_unprepare_irqs(struct irq_domain *domain, int nvec,
+			       void *data)
+{
+	struct msi_domain_info *info = domain->host_data;
+	struct msi_domain_ops *ops = info->ops;
+
+	if (ops->msi_unprepare)
+		ops->msi_unprepare(domain, nvec, data);
+}
+
 int msi_domain_populate_irqs(struct irq_domain *domain, struct device *dev,
 			     int virq, int nvec, msi_alloc_info_t *arg)
 {
-- 
2.19.1


WARNING: multiple messages have this Message-ID (diff)
From: Lokesh Vutla <lokeshvutla@ti.com>
To: Nishanth Menon <nm@ti.com>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com
Cc: Linux ARM Mailing List <linux-arm-kernel@lists.infradead.org>,
	linux-kernel@vger.kernel.org, Tero Kristo <t-kristo@ti.com>,
	Sekhar Nori <nsekhar@ti.com>,
	Device Tree Mailing List <devicetree@vger.kernel.org>,
	Grygorii Strashko <grygorii.strashko@ti.com>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Lokesh Vutla <lokeshvutla@ti.com>
Subject: [RFC PATCH v3 09/13] genirq/msi: Add support for .msi_unprepare callback
Date: Tue, 6 Nov 2018 14:11:01 +0530	[thread overview]
Message-ID: <20181106084105.32483-10-lokeshvutla@ti.com> (raw)
In-Reply-To: <20181106084105.32483-1-lokeshvutla@ti.com>

Add an optional callback .msi_unprepare to struct msi_domain_ops.
This is used to clear any effect that is done by .msi_prepare callback.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
Changes since v2:
- New patch

 include/linux/msi.h |  3 +++
 kernel/irq/msi.c    | 10 ++++++++++
 2 files changed, 13 insertions(+)

diff --git a/include/linux/msi.h b/include/linux/msi.h
index 021f789226b5..1e37aa569a3c 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -237,6 +237,8 @@ struct msi_domain_ops {
 	int		(*msi_prepare)(struct irq_domain *domain,
 				       struct device *dev, int nvec,
 				       msi_alloc_info_t *arg);
+	void		(*msi_unprepare)(struct irq_domain *domain, int nvec,
+					 void *data);
 	void		(*msi_finish)(msi_alloc_info_t *arg, int retval);
 	void		(*set_desc)(msi_alloc_info_t *arg,
 				    struct msi_desc *desc);
@@ -317,6 +319,7 @@ void platform_msi_domain_free_irqs(struct device *dev);
 /* When an MSI domain is used as an intermediate domain */
 int msi_domain_prepare_irqs(struct irq_domain *domain, struct device *dev,
 			    int nvec, msi_alloc_info_t *args);
+void msi_domain_unprepare_irqs(struct irq_domain *domain, int nvec, void *data);
 int msi_domain_populate_irqs(struct irq_domain *domain, struct device *dev,
 			     int virq, int nvec, msi_alloc_info_t *args);
 struct irq_domain *
diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index e37238317fab..87ce5a5d0c6d 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -312,6 +312,16 @@ int msi_domain_prepare_irqs(struct irq_domain *domain, struct device *dev,
 	return ret;
 }
 
+void msi_domain_unprepare_irqs(struct irq_domain *domain, int nvec,
+			       void *data)
+{
+	struct msi_domain_info *info = domain->host_data;
+	struct msi_domain_ops *ops = info->ops;
+
+	if (ops->msi_unprepare)
+		ops->msi_unprepare(domain, nvec, data);
+}
+
 int msi_domain_populate_irqs(struct irq_domain *domain, struct device *dev,
 			     int virq, int nvec, msi_alloc_info_t *arg)
 {
-- 
2.19.1

WARNING: multiple messages have this Message-ID (diff)
From: lokeshvutla@ti.com (Lokesh Vutla)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH v3 09/13] genirq/msi: Add support for .msi_unprepare callback
Date: Tue, 6 Nov 2018 14:11:01 +0530	[thread overview]
Message-ID: <20181106084105.32483-10-lokeshvutla@ti.com> (raw)
In-Reply-To: <20181106084105.32483-1-lokeshvutla@ti.com>

Add an optional callback .msi_unprepare to struct msi_domain_ops.
This is used to clear any effect that is done by .msi_prepare callback.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
Changes since v2:
- New patch

 include/linux/msi.h |  3 +++
 kernel/irq/msi.c    | 10 ++++++++++
 2 files changed, 13 insertions(+)

diff --git a/include/linux/msi.h b/include/linux/msi.h
index 021f789226b5..1e37aa569a3c 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -237,6 +237,8 @@ struct msi_domain_ops {
 	int		(*msi_prepare)(struct irq_domain *domain,
 				       struct device *dev, int nvec,
 				       msi_alloc_info_t *arg);
+	void		(*msi_unprepare)(struct irq_domain *domain, int nvec,
+					 void *data);
 	void		(*msi_finish)(msi_alloc_info_t *arg, int retval);
 	void		(*set_desc)(msi_alloc_info_t *arg,
 				    struct msi_desc *desc);
@@ -317,6 +319,7 @@ void platform_msi_domain_free_irqs(struct device *dev);
 /* When an MSI domain is used as an intermediate domain */
 int msi_domain_prepare_irqs(struct irq_domain *domain, struct device *dev,
 			    int nvec, msi_alloc_info_t *args);
+void msi_domain_unprepare_irqs(struct irq_domain *domain, int nvec, void *data);
 int msi_domain_populate_irqs(struct irq_domain *domain, struct device *dev,
 			     int virq, int nvec, msi_alloc_info_t *args);
 struct irq_domain *
diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index e37238317fab..87ce5a5d0c6d 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -312,6 +312,16 @@ int msi_domain_prepare_irqs(struct irq_domain *domain, struct device *dev,
 	return ret;
 }
 
+void msi_domain_unprepare_irqs(struct irq_domain *domain, int nvec,
+			       void *data)
+{
+	struct msi_domain_info *info = domain->host_data;
+	struct msi_domain_ops *ops = info->ops;
+
+	if (ops->msi_unprepare)
+		ops->msi_unprepare(domain, nvec, data);
+}
+
 int msi_domain_populate_irqs(struct irq_domain *domain, struct device *dev,
 			     int virq, int nvec, msi_alloc_info_t *arg)
 {
-- 
2.19.1

  parent reply	other threads:[~2018-11-06  8:42 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06  8:40 [PATCH v3 00/13] Add support for TISCI irqchip drivers Lokesh Vutla
2018-11-06  8:40 ` Lokesh Vutla
2018-11-06  8:40 ` Lokesh Vutla
2018-11-06  8:40 ` [PATCH v3 01/13] firmware: ti_sci: Add support to get TISCI handle using of_phandle Lokesh Vutla
2018-11-06  8:40   ` Lokesh Vutla
2018-11-06  8:40   ` Lokesh Vutla
2018-11-06  8:40 ` [PATCH v3 02/13] firmware: ti_sci: Add support for RM core ops Lokesh Vutla
2018-11-06  8:40   ` Lokesh Vutla
2018-11-06  8:40   ` Lokesh Vutla
2018-11-06  8:40 ` [PATCH v3 03/13] firmware: ti_sci: Add support for IRQ management Lokesh Vutla
2018-11-06  8:40   ` Lokesh Vutla
2018-11-06  8:40   ` Lokesh Vutla
2018-11-06  8:40 ` [PATCH v3 04/13] firmware: ti_sci: Add RM mapping table for am654 Lokesh Vutla
2018-11-06  8:40   ` Lokesh Vutla
2018-11-06  8:40   ` Lokesh Vutla
2018-11-06  8:40 ` [PATCH v3 05/13] firmware: ti_sci: Add helper apis to manage resources Lokesh Vutla
2018-11-06  8:40   ` Lokesh Vutla
2018-11-06  8:40   ` Lokesh Vutla
2018-11-06  8:40 ` [PATCH v3 06/13] dt-bindings: irqchip: Introduce TISCI Interrupt router bindings Lokesh Vutla
2018-11-06  8:40   ` Lokesh Vutla
2018-11-06  8:40   ` Lokesh Vutla
2018-11-12 18:00   ` Rob Herring
2018-11-12 18:00     ` Rob Herring
2018-11-13  6:13     ` Lokesh Vutla
2018-11-13  6:13       ` Lokesh Vutla
2018-11-13  6:13       ` Lokesh Vutla
2018-11-16  2:06       ` Lokesh Vutla
2018-11-16  2:06         ` Lokesh Vutla
2018-11-16  2:06         ` Lokesh Vutla
2018-11-06  8:40 ` [PATCH v3 07/13] irqchip: ti-sci-intr: Add support for Interrupt Router driver Lokesh Vutla
2018-11-06  8:40   ` Lokesh Vutla
2018-11-06  8:40   ` Lokesh Vutla
2018-11-06  8:41 ` [RFC PATCH v3 08/13] genirq/msi: Add support for allocating single MSI for a device Lokesh Vutla
2018-11-06  8:41   ` Lokesh Vutla
2018-11-06  8:41   ` Lokesh Vutla
2018-11-06  8:41 ` Lokesh Vutla [this message]
2018-11-06  8:41   ` [RFC PATCH v3 09/13] genirq/msi: Add support for .msi_unprepare callback Lokesh Vutla
2018-11-06  8:41   ` Lokesh Vutla
2018-11-06  8:41 ` [RFC PATCH v3 10/13] soc: ti: Add MSI domain support for K3 Interrupt Aggregator Lokesh Vutla
2018-11-06  8:41   ` Lokesh Vutla
2018-11-06  8:41   ` Lokesh Vutla
2018-11-13  7:35   ` Lokesh Vutla
2018-11-13  7:35     ` Lokesh Vutla
2018-11-13  7:35     ` Lokesh Vutla
2018-11-06  8:41 ` [RFC PATCH v3 11/13] dt-bindings: irqchip: Introduce TISCI Interrupt Aggregator bindings Lokesh Vutla
2018-11-06  8:41   ` Lokesh Vutla
2018-11-06  8:41   ` Lokesh Vutla
2018-11-06  8:41 ` [RFC PATCH v3 12/13] irqchip: ti-sci-inta: Add support for Interrupt Aggregator driver Lokesh Vutla
2018-11-06  8:41   ` Lokesh Vutla
2018-11-06  8:41   ` Lokesh Vutla
2018-11-06  8:41 ` [RFC PATCH v3 13/13] soc: ti: am6: Enable interrupt controller drivers Lokesh Vutla
2018-11-06  8:41   ` Lokesh Vutla
2018-11-06  8:41   ` Lokesh Vutla

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=20181106084105.32483-10-lokeshvutla@ti.com \
    --to=lokeshvutla@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=grygorii.strashko@ti.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=nm@ti.com \
    --cc=nsekhar@ti.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=robh+dt@kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=t-kristo@ti.com \
    --cc=tglx@linutronix.de \
    /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.