All of lore.kernel.org
 help / color / mirror / Atom feed
* staging: fsl-mc: Convert to use platform_msi infrastrucutre
@ 2016-04-13 10:30 ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: gregkh, robh+dt, frowand.list, grant.likely, German.Rivera,
	jiang.liu, marc.zyngier, tglx
  Cc: treding, stuart.yoder, jroedel, agraf, bp, matthias.bgg,
	bhaktipriya96, linux-kernel, devicetree, devel, linux-arm-kernel,
	mbrugger

Freescale MC driver can't be build as module as it uses it's own
msi implementation. This patch set converts the driver to use platform_msi
infrastructure instead, so that we can build the driver as a module.

Apart from that we have to export some functions of the msi framework to
handle the domain.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* staging: fsl-mc: Convert to use platform_msi infrastrucutre
@ 2016-04-13 10:30 ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	frowand.list-Re5JQEeQqe8AvxtiuMwx3w,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	German.Rivera-KZfg59tc24xl57MIdRCFDg,
	jiang.liu-VuQAYsv1563Yd54FQh9/CA, marc.zyngier-5wv7dgnIgG8,
	tglx-hfZtesqFncYOwBW4kG4KsQ
  Cc: treding-DDmLM1+adcrQT0dZR+AlfA, stuart.yoder-3arQi8VN3Tc,
	jroedel-l3A5Bk7waGM, agraf-l3A5Bk7waGM, bp-l3A5Bk7waGM,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	bhaktipriya96-Re5JQEeQqe8AvxtiuMwx3w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	mbrugger-IBi9RG/b67k

Freescale MC driver can't be build as module as it uses it's own
msi implementation. This patch set converts the driver to use platform_msi
infrastructure instead, so that we can build the driver as a module.

Apart from that we have to export some functions of the msi framework to
handle the domain.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 33+ messages in thread

* staging: fsl-mc: Convert to use platform_msi infrastrucutre
@ 2016-04-13 10:30 ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: linux-arm-kernel

Freescale MC driver can't be build as module as it uses it's own
msi implementation. This patch set converts the driver to use platform_msi
infrastructure instead, so that we can build the driver as a module.

Apart from that we have to export some functions of the msi framework to
handle the domain.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 1/6] of/irq: Export of_msi_get_domain
  2016-04-13 10:30 ` Matthias Brugger
  (?)
@ 2016-04-13 10:30   ` Matthias Brugger
  -1 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: gregkh, robh+dt, frowand.list, grant.likely, German.Rivera,
	jiang.liu, marc.zyngier, tglx
  Cc: treding, stuart.yoder, jroedel, agraf, bp, matthias.bgg,
	bhaktipriya96, linux-kernel, devicetree, devel, linux-arm-kernel,
	mbrugger

From: Matthias Brugger <matthias.bgg@gmail.com>

Export of_mis_get_domain to enable it for users from outside.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 drivers/of/irq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index e7bfc17..9f8cd6a 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -750,6 +750,7 @@ struct irq_domain *of_msi_get_domain(struct device *dev,
 
 	return NULL;
 }
+EXPORT_SYMBOL_GPL(of_msi_get_domain);
 
 /**
  * of_msi_configure - Set the msi_domain field of a device
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 1/6] of/irq: Export of_msi_get_domain
@ 2016-04-13 10:30   ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: gregkh, robh+dt, frowand.list, grant.likely, German.Rivera,
	jiang.liu, marc.zyngier, tglx
  Cc: devel, devicetree, bp, mbrugger, bhaktipriya96, stuart.yoder,
	agraf, jroedel, linux-arm-kernel, matthias.bgg, treding,
	linux-kernel

From: Matthias Brugger <matthias.bgg@gmail.com>

Export of_mis_get_domain to enable it for users from outside.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 drivers/of/irq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index e7bfc17..9f8cd6a 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -750,6 +750,7 @@ struct irq_domain *of_msi_get_domain(struct device *dev,
 
 	return NULL;
 }
+EXPORT_SYMBOL_GPL(of_msi_get_domain);
 
 /**
  * of_msi_configure - Set the msi_domain field of a device
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 1/6] of/irq: Export of_msi_get_domain
@ 2016-04-13 10:30   ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Matthias Brugger <matthias.bgg@gmail.com>

Export of_mis_get_domain to enable it for users from outside.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 drivers/of/irq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index e7bfc17..9f8cd6a 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -750,6 +750,7 @@ struct irq_domain *of_msi_get_domain(struct device *dev,
 
 	return NULL;
 }
+EXPORT_SYMBOL_GPL(of_msi_get_domain);
 
 /**
  * of_msi_configure - Set the msi_domain field of a device
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 2/6] base: Export platform_msi_create_irq_domain
  2016-04-13 10:30 ` Matthias Brugger
@ 2016-04-13 10:30   ` Matthias Brugger
  -1 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: gregkh, robh+dt, frowand.list, grant.likely, German.Rivera,
	jiang.liu, marc.zyngier, tglx
  Cc: treding, stuart.yoder, jroedel, agraf, bp, matthias.bgg,
	bhaktipriya96, linux-kernel, devicetree, devel, linux-arm-kernel,
	mbrugger

From: Matthias Brugger <matthias.bgg@gmail.com>

Export platform_msi_create_irq_domain to make it useable from within
modules.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 drivers/base/platform-msi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/base/platform-msi.c b/drivers/base/platform-msi.c
index 279e539..9ae0443 100644
--- a/drivers/base/platform-msi.c
+++ b/drivers/base/platform-msi.c
@@ -200,6 +200,7 @@ struct irq_domain *platform_msi_create_irq_domain(struct fwnode_handle *fwnode,
 
 	return domain;
 }
+EXPORT_SYMBOL_GPL(platform_msi_create_irq_domain);
 
 static struct platform_msi_priv_data *
 platform_msi_alloc_priv_data(struct device *dev, unsigned int nvec,
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 2/6] base: Export platform_msi_create_irq_domain
@ 2016-04-13 10:30   ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Matthias Brugger <matthias.bgg@gmail.com>

Export platform_msi_create_irq_domain to make it useable from within
modules.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 drivers/base/platform-msi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/base/platform-msi.c b/drivers/base/platform-msi.c
index 279e539..9ae0443 100644
--- a/drivers/base/platform-msi.c
+++ b/drivers/base/platform-msi.c
@@ -200,6 +200,7 @@ struct irq_domain *platform_msi_create_irq_domain(struct fwnode_handle *fwnode,
 
 	return domain;
 }
+EXPORT_SYMBOL_GPL(platform_msi_create_irq_domain);
 
 static struct platform_msi_priv_data *
 platform_msi_alloc_priv_data(struct device *dev, unsigned int nvec,
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 3/6] genirq/msi: Export msi_get_domain_info
@ 2016-04-13 10:30   ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: gregkh, robh+dt, frowand.list, grant.likely, German.Rivera,
	jiang.liu, marc.zyngier, tglx
  Cc: treding, stuart.yoder, jroedel, agraf, bp, matthias.bgg,
	bhaktipriya96, linux-kernel, devicetree, devel, linux-arm-kernel,
	mbrugger

From: Matthias Brugger <matthias.bgg@gmail.com>

Allow modules to call msi_get_domain_info.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 kernel/irq/msi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index 38e89ce..9b0ba4a 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -400,5 +400,6 @@ struct msi_domain_info *msi_get_domain_info(struct irq_domain *domain)
 {
 	return (struct msi_domain_info *)domain->host_data;
 }
+EXPORT_SYMBOL_GPL(msi_get_domain_info);
 
 #endif /* CONFIG_GENERIC_MSI_IRQ_DOMAIN */
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 3/6] genirq/msi: Export msi_get_domain_info
@ 2016-04-13 10:30   ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	frowand.list-Re5JQEeQqe8AvxtiuMwx3w,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	German.Rivera-KZfg59tc24xl57MIdRCFDg,
	jiang.liu-VuQAYsv1563Yd54FQh9/CA, marc.zyngier-5wv7dgnIgG8,
	tglx-hfZtesqFncYOwBW4kG4KsQ
  Cc: treding-DDmLM1+adcrQT0dZR+AlfA, stuart.yoder-3arQi8VN3Tc,
	jroedel-l3A5Bk7waGM, agraf-l3A5Bk7waGM, bp-l3A5Bk7waGM,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	bhaktipriya96-Re5JQEeQqe8AvxtiuMwx3w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	mbrugger-IBi9RG/b67k

From: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Allow modules to call msi_get_domain_info.

Signed-off-by: Matthias Brugger <mbrugger-IBi9RG/b67k@public.gmane.org>
---
 kernel/irq/msi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index 38e89ce..9b0ba4a 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -400,5 +400,6 @@ struct msi_domain_info *msi_get_domain_info(struct irq_domain *domain)
 {
 	return (struct msi_domain_info *)domain->host_data;
 }
+EXPORT_SYMBOL_GPL(msi_get_domain_info);
 
 #endif /* CONFIG_GENERIC_MSI_IRQ_DOMAIN */
-- 
2.6.6

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 3/6] genirq/msi: Export msi_get_domain_info
@ 2016-04-13 10:30   ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Matthias Brugger <matthias.bgg@gmail.com>

Allow modules to call msi_get_domain_info.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 kernel/irq/msi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index 38e89ce..9b0ba4a 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -400,5 +400,6 @@ struct msi_domain_info *msi_get_domain_info(struct irq_domain *domain)
 {
 	return (struct msi_domain_info *)domain->host_data;
 }
+EXPORT_SYMBOL_GPL(msi_get_domain_info);
 
 #endif /* CONFIG_GENERIC_MSI_IRQ_DOMAIN */
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
  2016-04-13 10:30 ` Matthias Brugger
@ 2016-04-13 10:30   ` Matthias Brugger
  -1 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: gregkh, robh+dt, frowand.list, grant.likely, German.Rivera,
	jiang.liu, marc.zyngier, tglx
  Cc: treding, stuart.yoder, jroedel, agraf, bp, matthias.bgg,
	bhaktipriya96, linux-kernel, devicetree, devel, linux-arm-kernel,
	mbrugger

From: Matthias Brugger <matthias.bgg@gmail.com>

The fsl-mc driver can't be build as a module because it uses msi_*
functions directly. Port the driver to use the platform_msi_*
infrastructure instead, to allow it to be build as a module.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   5 +-
 drivers/staging/fsl-mc/bus/mc-allocator.c          |   9 +-
 drivers/staging/fsl-mc/bus/mc-msi.c                | 169 +--------------------
 drivers/staging/fsl-mc/include/mc-sys.h            |   3 +
 4 files changed, 14 insertions(+), 172 deletions(-)

diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
index 720e2b0..0eecb7e 100644
--- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
+++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
@@ -25,7 +25,6 @@ static struct irq_chip its_msi_irq_chip = {
 	.irq_mask = irq_chip_mask_parent,
 	.irq_unmask = irq_chip_unmask_parent,
 	.irq_eoi = irq_chip_eoi_parent,
-	.irq_set_affinity = msi_domain_set_affinity
 };
 
 static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
@@ -86,7 +85,7 @@ int __init its_fsl_mc_msi_init(void)
 			continue;
 		}
 
-		mc_msi_domain = fsl_mc_msi_create_irq_domain(
+		mc_msi_domain = platform_msi_create_irq_domain(
 						 of_node_to_fwnode(np),
 						 &its_fsl_mc_msi_domain_info,
 						 parent);
@@ -113,7 +112,7 @@ void its_fsl_mc_msi_cleanup(void)
 	     np = of_find_matching_node(np, its_device_id)) {
 		struct irq_domain *mc_msi_domain = irq_find_matching_host(
 							np,
-							DOMAIN_BUS_FSL_MC_MSI);
+							DOMAIN_BUS_PLATFORM_MSI);
 
 		if (!of_property_read_bool(np, "msi-controller"))
 			continue;
diff --git a/drivers/staging/fsl-mc/bus/mc-allocator.c b/drivers/staging/fsl-mc/bus/mc-allocator.c
index 86f8543..b469c5a 100644
--- a/drivers/staging/fsl-mc/bus/mc-allocator.c
+++ b/drivers/staging/fsl-mc/bus/mc-allocator.c
@@ -487,7 +487,8 @@ int fsl_mc_populate_irq_pool(struct fsl_mc_bus *mc_bus,
 		    irq_count > FSL_MC_IRQ_POOL_MAX_TOTAL_IRQS))
 		return -EINVAL;
 
-	error = fsl_mc_msi_domain_alloc_irqs(&mc_bus_dev->dev, irq_count);
+	error = platform_msi_domain_alloc_irqs(&mc_bus_dev->dev, irq_count,
+					       fsl_mc_msi_write_msg);
 	if (error < 0)
 		return error;
 
@@ -514,7 +515,7 @@ int fsl_mc_populate_irq_pool(struct fsl_mc_bus *mc_bus,
 	}
 
 	for_each_msi_entry(msi_desc, &mc_bus_dev->dev) {
-		mc_dev_irq = &irq_resources[msi_desc->fsl_mc.msi_index];
+		mc_dev_irq = &irq_resources[msi_desc->platform.msi_index];
 		mc_dev_irq->msi_desc = msi_desc;
 		mc_dev_irq->resource.id = msi_desc->irq;
 	}
@@ -525,7 +526,7 @@ int fsl_mc_populate_irq_pool(struct fsl_mc_bus *mc_bus,
 	return 0;
 
 cleanup_msi_irqs:
-	fsl_mc_msi_domain_free_irqs(&mc_bus_dev->dev);
+	platform_msi_domain_free_irqs(&mc_bus_dev->dev);
 	return error;
 }
 EXPORT_SYMBOL_GPL(fsl_mc_populate_irq_pool);
@@ -553,7 +554,7 @@ void fsl_mc_cleanup_irq_pool(struct fsl_mc_bus *mc_bus)
 	res_pool->max_count = 0;
 	res_pool->free_count = 0;
 	mc_bus->irq_resources = NULL;
-	fsl_mc_msi_domain_free_irqs(&mc_bus_dev->dev);
+	platform_msi_domain_free_irqs(&mc_bus_dev->dev);
 }
 EXPORT_SYMBOL_GPL(fsl_mc_cleanup_irq_pool);
 
diff --git a/drivers/staging/fsl-mc/bus/mc-msi.c b/drivers/staging/fsl-mc/bus/mc-msi.c
index 3a8258f..ae62a71 100644
--- a/drivers/staging/fsl-mc/bus/mc-msi.c
+++ b/drivers/staging/fsl-mc/bus/mc-msi.c
@@ -16,33 +16,9 @@
 #include <linux/of_irq.h>
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
-#include <linux/msi.h>
 #include "../include/mc-sys.h"
 #include "dprc-cmd.h"
 
-static void fsl_mc_msi_set_desc(msi_alloc_info_t *arg,
-				struct msi_desc *desc)
-{
-	arg->desc = desc;
-	arg->hwirq = (irq_hw_number_t)desc->fsl_mc.msi_index;
-}
-
-static void fsl_mc_msi_update_dom_ops(struct msi_domain_info *info)
-{
-	struct msi_domain_ops *ops = info->ops;
-
-	if (WARN_ON(!ops))
-		return;
-
-	/*
-	 * set_desc should not be set by the caller
-	 */
-	if (WARN_ON(ops->set_desc))
-		return;
-
-	ops->set_desc = fsl_mc_msi_set_desc;
-}
-
 static void __fsl_mc_msi_write_msg(struct fsl_mc_device *mc_bus_dev,
 				   struct fsl_mc_device_irq *mc_dev_irq)
 {
@@ -101,14 +77,13 @@ static void __fsl_mc_msi_write_msg(struct fsl_mc_device *mc_bus_dev,
 /*
  * NOTE: This function is invoked with interrupts disabled
  */
-static void fsl_mc_msi_write_msg(struct irq_data *irq_data,
-				 struct msi_msg *msg)
+void fsl_mc_msi_write_msg(struct msi_desc *msi_desc,
+			  struct msi_msg *msg)
 {
-	struct msi_desc *msi_desc = irq_data_get_msi_desc(irq_data);
 	struct fsl_mc_device *mc_bus_dev = to_fsl_mc_device(msi_desc->dev);
 	struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_bus_dev);
 	struct fsl_mc_device_irq *mc_dev_irq =
-		&mc_bus->irq_resources[msi_desc->fsl_mc.msi_index];
+		&mc_bus->irq_resources[msi_desc->platform.msi_index];
 
 	WARN_ON(mc_dev_irq->msi_desc != msi_desc);
 	msi_desc->msg = *msg;
@@ -119,52 +94,6 @@ static void fsl_mc_msi_write_msg(struct irq_data *irq_data,
 	__fsl_mc_msi_write_msg(mc_bus_dev, mc_dev_irq);
 }
 
-static void fsl_mc_msi_update_chip_ops(struct msi_domain_info *info)
-{
-	struct irq_chip *chip = info->chip;
-
-	if (WARN_ON((!chip)))
-		return;
-
-	/*
-	 * irq_write_msi_msg should not be set by the caller
-	 */
-	if (WARN_ON(chip->irq_write_msi_msg))
-		return;
-
-	chip->irq_write_msi_msg = fsl_mc_msi_write_msg;
-}
-
-/**
- * fsl_mc_msi_create_irq_domain - Create a fsl-mc MSI interrupt domain
- * @np:		Optional device-tree node of the interrupt controller
- * @info:	MSI domain info
- * @parent:	Parent irq domain
- *
- * Updates the domain and chip ops and creates a fsl-mc MSI
- * interrupt domain.
- *
- * Returns:
- * A domain pointer or NULL in case of failure.
- */
-struct irq_domain *fsl_mc_msi_create_irq_domain(struct fwnode_handle *fwnode,
-						struct msi_domain_info *info,
-						struct irq_domain *parent)
-{
-	struct irq_domain *domain;
-
-	if (info->flags & MSI_FLAG_USE_DEF_DOM_OPS)
-		fsl_mc_msi_update_dom_ops(info);
-	if (info->flags & MSI_FLAG_USE_DEF_CHIP_OPS)
-		fsl_mc_msi_update_chip_ops(info);
-
-	domain = msi_create_irq_domain(fwnode, info, parent);
-	if (domain)
-		domain->bus_token = DOMAIN_BUS_FSL_MC_MSI;
-
-	return domain;
-}
-
 int fsl_mc_find_msi_domain(struct device *mc_platform_dev,
 			   struct irq_domain **mc_msi_domain)
 {
@@ -172,7 +101,7 @@ int fsl_mc_find_msi_domain(struct device *mc_platform_dev,
 	struct device_node *mc_of_node = mc_platform_dev->of_node;
 
 	msi_domain = of_msi_get_domain(mc_platform_dev, mc_of_node,
-				       DOMAIN_BUS_FSL_MC_MSI);
+				       DOMAIN_BUS_PLATFORM_MSI);
 	if (!msi_domain) {
 		pr_err("Unable to find fsl-mc MSI domain for %s\n",
 		       mc_of_node->full_name);
@@ -184,93 +113,3 @@ int fsl_mc_find_msi_domain(struct device *mc_platform_dev,
 	return 0;
 }
 
-static void fsl_mc_msi_free_descs(struct device *dev)
-{
-	struct msi_desc *desc, *tmp;
-
-	list_for_each_entry_safe(desc, tmp, dev_to_msi_list(dev), list) {
-		list_del(&desc->list);
-		free_msi_entry(desc);
-	}
-}
-
-static int fsl_mc_msi_alloc_descs(struct device *dev, unsigned int irq_count)
-
-{
-	unsigned int i;
-	int error;
-	struct msi_desc *msi_desc;
-
-	for (i = 0; i < irq_count; i++) {
-		msi_desc = alloc_msi_entry(dev);
-		if (!msi_desc) {
-			dev_err(dev, "Failed to allocate msi entry\n");
-			error = -ENOMEM;
-			goto cleanup_msi_descs;
-		}
-
-		msi_desc->fsl_mc.msi_index = i;
-		msi_desc->nvec_used = 1;
-		INIT_LIST_HEAD(&msi_desc->list);
-		list_add_tail(&msi_desc->list, dev_to_msi_list(dev));
-	}
-
-	return 0;
-
-cleanup_msi_descs:
-	fsl_mc_msi_free_descs(dev);
-	return error;
-}
-
-int fsl_mc_msi_domain_alloc_irqs(struct device *dev,
-				 unsigned int irq_count)
-{
-	struct irq_domain *msi_domain;
-	int error;
-
-	if (WARN_ON(!list_empty(dev_to_msi_list(dev))))
-		return -EINVAL;
-
-	error = fsl_mc_msi_alloc_descs(dev, irq_count);
-	if (error < 0)
-		return error;
-
-	msi_domain = dev_get_msi_domain(dev);
-	if (WARN_ON(!msi_domain)) {
-		error = -EINVAL;
-		goto cleanup_msi_descs;
-	}
-
-	/*
-	 * NOTE: Calling this function will trigger the invocation of the
-	 * its_fsl_mc_msi_prepare() callback
-	 */
-	error = msi_domain_alloc_irqs(msi_domain, dev, irq_count);
-
-	if (error) {
-		dev_err(dev, "Failed to allocate IRQs\n");
-		goto cleanup_msi_descs;
-	}
-
-	return 0;
-
-cleanup_msi_descs:
-	fsl_mc_msi_free_descs(dev);
-	return error;
-}
-
-void fsl_mc_msi_domain_free_irqs(struct device *dev)
-{
-	struct irq_domain *msi_domain;
-
-	msi_domain = dev_get_msi_domain(dev);
-	if (WARN_ON(!msi_domain))
-		return;
-
-	msi_domain_free_irqs(msi_domain, dev);
-
-	if (WARN_ON(list_empty(dev_to_msi_list(dev))))
-		return;
-
-	fsl_mc_msi_free_descs(dev);
-}
diff --git a/drivers/staging/fsl-mc/include/mc-sys.h b/drivers/staging/fsl-mc/include/mc-sys.h
index c5038cc..d69582a 100644
--- a/drivers/staging/fsl-mc/include/mc-sys.h
+++ b/drivers/staging/fsl-mc/include/mc-sys.h
@@ -41,6 +41,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/mutex.h>
 #include <linux/spinlock.h>
+#include <linux/msi.h>
 
 /**
  * Bit masks for a MC I/O object (struct fsl_mc_io) flags
@@ -107,6 +108,8 @@ int fsl_mc_io_set_dpmcp(struct fsl_mc_io *mc_io,
 			struct fsl_mc_device *dpmcp_dev);
 
 void fsl_mc_io_unset_dpmcp(struct fsl_mc_io *mc_io);
+void fsl_mc_msi_write_msg(struct msi_desc *msi_desc,
+			  struct msi_msg *msg);
 
 int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd);
 
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
@ 2016-04-13 10:30   ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Matthias Brugger <matthias.bgg@gmail.com>

The fsl-mc driver can't be build as a module because it uses msi_*
functions directly. Port the driver to use the platform_msi_*
infrastructure instead, to allow it to be build as a module.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   5 +-
 drivers/staging/fsl-mc/bus/mc-allocator.c          |   9 +-
 drivers/staging/fsl-mc/bus/mc-msi.c                | 169 +--------------------
 drivers/staging/fsl-mc/include/mc-sys.h            |   3 +
 4 files changed, 14 insertions(+), 172 deletions(-)

diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
index 720e2b0..0eecb7e 100644
--- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
+++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
@@ -25,7 +25,6 @@ static struct irq_chip its_msi_irq_chip = {
 	.irq_mask = irq_chip_mask_parent,
 	.irq_unmask = irq_chip_unmask_parent,
 	.irq_eoi = irq_chip_eoi_parent,
-	.irq_set_affinity = msi_domain_set_affinity
 };
 
 static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
@@ -86,7 +85,7 @@ int __init its_fsl_mc_msi_init(void)
 			continue;
 		}
 
-		mc_msi_domain = fsl_mc_msi_create_irq_domain(
+		mc_msi_domain = platform_msi_create_irq_domain(
 						 of_node_to_fwnode(np),
 						 &its_fsl_mc_msi_domain_info,
 						 parent);
@@ -113,7 +112,7 @@ void its_fsl_mc_msi_cleanup(void)
 	     np = of_find_matching_node(np, its_device_id)) {
 		struct irq_domain *mc_msi_domain = irq_find_matching_host(
 							np,
-							DOMAIN_BUS_FSL_MC_MSI);
+							DOMAIN_BUS_PLATFORM_MSI);
 
 		if (!of_property_read_bool(np, "msi-controller"))
 			continue;
diff --git a/drivers/staging/fsl-mc/bus/mc-allocator.c b/drivers/staging/fsl-mc/bus/mc-allocator.c
index 86f8543..b469c5a 100644
--- a/drivers/staging/fsl-mc/bus/mc-allocator.c
+++ b/drivers/staging/fsl-mc/bus/mc-allocator.c
@@ -487,7 +487,8 @@ int fsl_mc_populate_irq_pool(struct fsl_mc_bus *mc_bus,
 		    irq_count > FSL_MC_IRQ_POOL_MAX_TOTAL_IRQS))
 		return -EINVAL;
 
-	error = fsl_mc_msi_domain_alloc_irqs(&mc_bus_dev->dev, irq_count);
+	error = platform_msi_domain_alloc_irqs(&mc_bus_dev->dev, irq_count,
+					       fsl_mc_msi_write_msg);
 	if (error < 0)
 		return error;
 
@@ -514,7 +515,7 @@ int fsl_mc_populate_irq_pool(struct fsl_mc_bus *mc_bus,
 	}
 
 	for_each_msi_entry(msi_desc, &mc_bus_dev->dev) {
-		mc_dev_irq = &irq_resources[msi_desc->fsl_mc.msi_index];
+		mc_dev_irq = &irq_resources[msi_desc->platform.msi_index];
 		mc_dev_irq->msi_desc = msi_desc;
 		mc_dev_irq->resource.id = msi_desc->irq;
 	}
@@ -525,7 +526,7 @@ int fsl_mc_populate_irq_pool(struct fsl_mc_bus *mc_bus,
 	return 0;
 
 cleanup_msi_irqs:
-	fsl_mc_msi_domain_free_irqs(&mc_bus_dev->dev);
+	platform_msi_domain_free_irqs(&mc_bus_dev->dev);
 	return error;
 }
 EXPORT_SYMBOL_GPL(fsl_mc_populate_irq_pool);
@@ -553,7 +554,7 @@ void fsl_mc_cleanup_irq_pool(struct fsl_mc_bus *mc_bus)
 	res_pool->max_count = 0;
 	res_pool->free_count = 0;
 	mc_bus->irq_resources = NULL;
-	fsl_mc_msi_domain_free_irqs(&mc_bus_dev->dev);
+	platform_msi_domain_free_irqs(&mc_bus_dev->dev);
 }
 EXPORT_SYMBOL_GPL(fsl_mc_cleanup_irq_pool);
 
diff --git a/drivers/staging/fsl-mc/bus/mc-msi.c b/drivers/staging/fsl-mc/bus/mc-msi.c
index 3a8258f..ae62a71 100644
--- a/drivers/staging/fsl-mc/bus/mc-msi.c
+++ b/drivers/staging/fsl-mc/bus/mc-msi.c
@@ -16,33 +16,9 @@
 #include <linux/of_irq.h>
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
-#include <linux/msi.h>
 #include "../include/mc-sys.h"
 #include "dprc-cmd.h"
 
-static void fsl_mc_msi_set_desc(msi_alloc_info_t *arg,
-				struct msi_desc *desc)
-{
-	arg->desc = desc;
-	arg->hwirq = (irq_hw_number_t)desc->fsl_mc.msi_index;
-}
-
-static void fsl_mc_msi_update_dom_ops(struct msi_domain_info *info)
-{
-	struct msi_domain_ops *ops = info->ops;
-
-	if (WARN_ON(!ops))
-		return;
-
-	/*
-	 * set_desc should not be set by the caller
-	 */
-	if (WARN_ON(ops->set_desc))
-		return;
-
-	ops->set_desc = fsl_mc_msi_set_desc;
-}
-
 static void __fsl_mc_msi_write_msg(struct fsl_mc_device *mc_bus_dev,
 				   struct fsl_mc_device_irq *mc_dev_irq)
 {
@@ -101,14 +77,13 @@ static void __fsl_mc_msi_write_msg(struct fsl_mc_device *mc_bus_dev,
 /*
  * NOTE: This function is invoked with interrupts disabled
  */
-static void fsl_mc_msi_write_msg(struct irq_data *irq_data,
-				 struct msi_msg *msg)
+void fsl_mc_msi_write_msg(struct msi_desc *msi_desc,
+			  struct msi_msg *msg)
 {
-	struct msi_desc *msi_desc = irq_data_get_msi_desc(irq_data);
 	struct fsl_mc_device *mc_bus_dev = to_fsl_mc_device(msi_desc->dev);
 	struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_bus_dev);
 	struct fsl_mc_device_irq *mc_dev_irq =
-		&mc_bus->irq_resources[msi_desc->fsl_mc.msi_index];
+		&mc_bus->irq_resources[msi_desc->platform.msi_index];
 
 	WARN_ON(mc_dev_irq->msi_desc != msi_desc);
 	msi_desc->msg = *msg;
@@ -119,52 +94,6 @@ static void fsl_mc_msi_write_msg(struct irq_data *irq_data,
 	__fsl_mc_msi_write_msg(mc_bus_dev, mc_dev_irq);
 }
 
-static void fsl_mc_msi_update_chip_ops(struct msi_domain_info *info)
-{
-	struct irq_chip *chip = info->chip;
-
-	if (WARN_ON((!chip)))
-		return;
-
-	/*
-	 * irq_write_msi_msg should not be set by the caller
-	 */
-	if (WARN_ON(chip->irq_write_msi_msg))
-		return;
-
-	chip->irq_write_msi_msg = fsl_mc_msi_write_msg;
-}
-
-/**
- * fsl_mc_msi_create_irq_domain - Create a fsl-mc MSI interrupt domain
- * @np:		Optional device-tree node of the interrupt controller
- * @info:	MSI domain info
- * @parent:	Parent irq domain
- *
- * Updates the domain and chip ops and creates a fsl-mc MSI
- * interrupt domain.
- *
- * Returns:
- * A domain pointer or NULL in case of failure.
- */
-struct irq_domain *fsl_mc_msi_create_irq_domain(struct fwnode_handle *fwnode,
-						struct msi_domain_info *info,
-						struct irq_domain *parent)
-{
-	struct irq_domain *domain;
-
-	if (info->flags & MSI_FLAG_USE_DEF_DOM_OPS)
-		fsl_mc_msi_update_dom_ops(info);
-	if (info->flags & MSI_FLAG_USE_DEF_CHIP_OPS)
-		fsl_mc_msi_update_chip_ops(info);
-
-	domain = msi_create_irq_domain(fwnode, info, parent);
-	if (domain)
-		domain->bus_token = DOMAIN_BUS_FSL_MC_MSI;
-
-	return domain;
-}
-
 int fsl_mc_find_msi_domain(struct device *mc_platform_dev,
 			   struct irq_domain **mc_msi_domain)
 {
@@ -172,7 +101,7 @@ int fsl_mc_find_msi_domain(struct device *mc_platform_dev,
 	struct device_node *mc_of_node = mc_platform_dev->of_node;
 
 	msi_domain = of_msi_get_domain(mc_platform_dev, mc_of_node,
-				       DOMAIN_BUS_FSL_MC_MSI);
+				       DOMAIN_BUS_PLATFORM_MSI);
 	if (!msi_domain) {
 		pr_err("Unable to find fsl-mc MSI domain for %s\n",
 		       mc_of_node->full_name);
@@ -184,93 +113,3 @@ int fsl_mc_find_msi_domain(struct device *mc_platform_dev,
 	return 0;
 }
 
-static void fsl_mc_msi_free_descs(struct device *dev)
-{
-	struct msi_desc *desc, *tmp;
-
-	list_for_each_entry_safe(desc, tmp, dev_to_msi_list(dev), list) {
-		list_del(&desc->list);
-		free_msi_entry(desc);
-	}
-}
-
-static int fsl_mc_msi_alloc_descs(struct device *dev, unsigned int irq_count)
-
-{
-	unsigned int i;
-	int error;
-	struct msi_desc *msi_desc;
-
-	for (i = 0; i < irq_count; i++) {
-		msi_desc = alloc_msi_entry(dev);
-		if (!msi_desc) {
-			dev_err(dev, "Failed to allocate msi entry\n");
-			error = -ENOMEM;
-			goto cleanup_msi_descs;
-		}
-
-		msi_desc->fsl_mc.msi_index = i;
-		msi_desc->nvec_used = 1;
-		INIT_LIST_HEAD(&msi_desc->list);
-		list_add_tail(&msi_desc->list, dev_to_msi_list(dev));
-	}
-
-	return 0;
-
-cleanup_msi_descs:
-	fsl_mc_msi_free_descs(dev);
-	return error;
-}
-
-int fsl_mc_msi_domain_alloc_irqs(struct device *dev,
-				 unsigned int irq_count)
-{
-	struct irq_domain *msi_domain;
-	int error;
-
-	if (WARN_ON(!list_empty(dev_to_msi_list(dev))))
-		return -EINVAL;
-
-	error = fsl_mc_msi_alloc_descs(dev, irq_count);
-	if (error < 0)
-		return error;
-
-	msi_domain = dev_get_msi_domain(dev);
-	if (WARN_ON(!msi_domain)) {
-		error = -EINVAL;
-		goto cleanup_msi_descs;
-	}
-
-	/*
-	 * NOTE: Calling this function will trigger the invocation of the
-	 * its_fsl_mc_msi_prepare() callback
-	 */
-	error = msi_domain_alloc_irqs(msi_domain, dev, irq_count);
-
-	if (error) {
-		dev_err(dev, "Failed to allocate IRQs\n");
-		goto cleanup_msi_descs;
-	}
-
-	return 0;
-
-cleanup_msi_descs:
-	fsl_mc_msi_free_descs(dev);
-	return error;
-}
-
-void fsl_mc_msi_domain_free_irqs(struct device *dev)
-{
-	struct irq_domain *msi_domain;
-
-	msi_domain = dev_get_msi_domain(dev);
-	if (WARN_ON(!msi_domain))
-		return;
-
-	msi_domain_free_irqs(msi_domain, dev);
-
-	if (WARN_ON(list_empty(dev_to_msi_list(dev))))
-		return;
-
-	fsl_mc_msi_free_descs(dev);
-}
diff --git a/drivers/staging/fsl-mc/include/mc-sys.h b/drivers/staging/fsl-mc/include/mc-sys.h
index c5038cc..d69582a 100644
--- a/drivers/staging/fsl-mc/include/mc-sys.h
+++ b/drivers/staging/fsl-mc/include/mc-sys.h
@@ -41,6 +41,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/mutex.h>
 #include <linux/spinlock.h>
+#include <linux/msi.h>
 
 /**
  * Bit masks for a MC I/O object (struct fsl_mc_io) flags
@@ -107,6 +108,8 @@ int fsl_mc_io_set_dpmcp(struct fsl_mc_io *mc_io,
 			struct fsl_mc_device *dpmcp_dev);
 
 void fsl_mc_io_unset_dpmcp(struct fsl_mc_io *mc_io);
+void fsl_mc_msi_write_msg(struct msi_desc *msi_desc,
+			  struct msi_msg *msg);
 
 int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd);
 
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 5/6] staging: fsl-mc: Clean up of irq_chip callbacks
  2016-04-13 10:30 ` Matthias Brugger
@ 2016-04-13 10:30   ` Matthias Brugger
  -1 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: gregkh, robh+dt, frowand.list, grant.likely, German.Rivera,
	jiang.liu, marc.zyngier, tglx
  Cc: treding, stuart.yoder, jroedel, agraf, bp, matthias.bgg,
	bhaktipriya96, linux-kernel, devicetree, devel, linux-arm-kernel,
	mbrugger

platform_msi_create_irq_domain already sets the irq_chip callbacks accordingly.
We don't need to define them explicitly in the driver.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
index 0eecb7e..c787090 100644
--- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
+++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
@@ -22,9 +22,6 @@
 
 static struct irq_chip its_msi_irq_chip = {
 	.name = "fsl-mc-bus-msi",
-	.irq_mask = irq_chip_mask_parent,
-	.irq_unmask = irq_chip_unmask_parent,
-	.irq_eoi = irq_chip_eoi_parent,
 };
 
 static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 5/6] staging: fsl-mc: Clean up of irq_chip callbacks
@ 2016-04-13 10:30   ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: linux-arm-kernel

platform_msi_create_irq_domain already sets the irq_chip callbacks accordingly.
We don't need to define them explicitly in the driver.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
index 0eecb7e..c787090 100644
--- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
+++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
@@ -22,9 +22,6 @@
 
 static struct irq_chip its_msi_irq_chip = {
 	.name = "fsl-mc-bus-msi",
-	.irq_mask = irq_chip_mask_parent,
-	.irq_unmask = irq_chip_unmask_parent,
-	.irq_eoi = irq_chip_eoi_parent,
 };
 
 static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 6/6] Revert "staging: fsl-mc: Do not allow building as a module"
  2016-04-13 10:30 ` Matthias Brugger
  (?)
@ 2016-04-13 10:30   ` Matthias Brugger
  -1 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: gregkh, robh+dt, frowand.list, grant.likely, German.Rivera,
	jiang.liu, marc.zyngier, tglx
  Cc: treding, stuart.yoder, jroedel, agraf, bp, matthias.bgg,
	bhaktipriya96, linux-kernel, devicetree, devel, linux-arm-kernel,
	mbrugger

From: Matthias Brugger <matthias.bgg@gmail.com>

This reverts commit <dfb11fe2281c> ("staging: fsl-mc: Do not allow building as a module")

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 drivers/staging/fsl-mc/bus/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fsl-mc/bus/Kconfig b/drivers/staging/fsl-mc/bus/Kconfig
index 1f95933..c498ac6 100644
--- a/drivers/staging/fsl-mc/bus/Kconfig
+++ b/drivers/staging/fsl-mc/bus/Kconfig
@@ -7,7 +7,7 @@
 #
 
 config FSL_MC_BUS
-	bool "Freescale Management Complex (MC) bus driver"
+	tristate "Freescale Management Complex (MC) bus driver"
 	depends on OF && ARM64
 	select GENERIC_MSI_IRQ_DOMAIN
 	help
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 6/6] Revert "staging: fsl-mc: Do not allow building as a module"
@ 2016-04-13 10:30   ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: gregkh, robh+dt, frowand.list, grant.likely, German.Rivera,
	jiang.liu, marc.zyngier, tglx
  Cc: devel, devicetree, bp, mbrugger, bhaktipriya96, stuart.yoder,
	agraf, jroedel, linux-arm-kernel, matthias.bgg, treding,
	linux-kernel

From: Matthias Brugger <matthias.bgg@gmail.com>

This reverts commit <dfb11fe2281c> ("staging: fsl-mc: Do not allow building as a module")

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 drivers/staging/fsl-mc/bus/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fsl-mc/bus/Kconfig b/drivers/staging/fsl-mc/bus/Kconfig
index 1f95933..c498ac6 100644
--- a/drivers/staging/fsl-mc/bus/Kconfig
+++ b/drivers/staging/fsl-mc/bus/Kconfig
@@ -7,7 +7,7 @@
 #
 
 config FSL_MC_BUS
-	bool "Freescale Management Complex (MC) bus driver"
+	tristate "Freescale Management Complex (MC) bus driver"
 	depends on OF && ARM64
 	select GENERIC_MSI_IRQ_DOMAIN
 	help
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 6/6] Revert "staging: fsl-mc: Do not allow building as a module"
@ 2016-04-13 10:30   ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 10:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Matthias Brugger <matthias.bgg@gmail.com>

This reverts commit <dfb11fe2281c> ("staging: fsl-mc: Do not allow building as a module")

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 drivers/staging/fsl-mc/bus/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fsl-mc/bus/Kconfig b/drivers/staging/fsl-mc/bus/Kconfig
index 1f95933..c498ac6 100644
--- a/drivers/staging/fsl-mc/bus/Kconfig
+++ b/drivers/staging/fsl-mc/bus/Kconfig
@@ -7,7 +7,7 @@
 #
 
 config FSL_MC_BUS
-	bool "Freescale Management Complex (MC) bus driver"
+	tristate "Freescale Management Complex (MC) bus driver"
 	depends on OF && ARM64
 	select GENERIC_MSI_IRQ_DOMAIN
 	help
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* Re: [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
@ 2016-04-13 10:56     ` Marc Zyngier
  0 siblings, 0 replies; 33+ messages in thread
From: Marc Zyngier @ 2016-04-13 10:56 UTC (permalink / raw)
  To: Matthias Brugger, gregkh, robh+dt, frowand.list, grant.likely,
	German.Rivera, jiang.liu, tglx
  Cc: treding, stuart.yoder, jroedel, agraf, bp, matthias.bgg,
	bhaktipriya96, linux-kernel, devicetree, devel, linux-arm-kernel

On 13/04/16 11:30, Matthias Brugger wrote:
> From: Matthias Brugger <matthias.bgg@gmail.com>
> 
> The fsl-mc driver can't be build as a module because it uses msi_*
> functions directly. Port the driver to use the platform_msi_*
> infrastructure instead, to allow it to be build as a module.
> 
> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
> ---
>  .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   5 +-
>  drivers/staging/fsl-mc/bus/mc-allocator.c          |   9 +-
>  drivers/staging/fsl-mc/bus/mc-msi.c                | 169 +--------------------
>  drivers/staging/fsl-mc/include/mc-sys.h            |   3 +
>  4 files changed, 14 insertions(+), 172 deletions(-)
> 
> diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> index 720e2b0..0eecb7e 100644
> --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> @@ -25,7 +25,6 @@ static struct irq_chip its_msi_irq_chip = {
>  	.irq_mask = irq_chip_mask_parent,
>  	.irq_unmask = irq_chip_unmask_parent,
>  	.irq_eoi = irq_chip_eoi_parent,
> -	.irq_set_affinity = msi_domain_set_affinity
>  };
>  
>  static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
> @@ -86,7 +85,7 @@ int __init its_fsl_mc_msi_init(void)
>  			continue;
>  		}
>  
> -		mc_msi_domain = fsl_mc_msi_create_irq_domain(
> +		mc_msi_domain = platform_msi_create_irq_domain(
>  						 of_node_to_fwnode(np),
>  						 &its_fsl_mc_msi_domain_info,
>  						 parent);

What? We are already creating a platform MSI domain for the ITS. How is
that going to work? If you want to convert this set of drivers to
platform ITS, fine. But you can't randomly hack in the ITS code and pray
for things not to fall apart.

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
@ 2016-04-13 10:56     ` Marc Zyngier
  0 siblings, 0 replies; 33+ messages in thread
From: Marc Zyngier @ 2016-04-13 10:56 UTC (permalink / raw)
  To: Matthias Brugger, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	frowand.list-Re5JQEeQqe8AvxtiuMwx3w,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	German.Rivera-KZfg59tc24xl57MIdRCFDg,
	jiang.liu-VuQAYsv1563Yd54FQh9/CA, tglx-hfZtesqFncYOwBW4kG4KsQ
  Cc: treding-DDmLM1+adcrQT0dZR+AlfA, stuart.yoder-3arQi8VN3Tc,
	jroedel-l3A5Bk7waGM, agraf-l3A5Bk7waGM, bp-l3A5Bk7waGM,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	bhaktipriya96-Re5JQEeQqe8AvxtiuMwx3w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 13/04/16 11:30, Matthias Brugger wrote:
> From: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> The fsl-mc driver can't be build as a module because it uses msi_*
> functions directly. Port the driver to use the platform_msi_*
> infrastructure instead, to allow it to be build as a module.
> 
> Signed-off-by: Matthias Brugger <mbrugger-IBi9RG/b67k@public.gmane.org>
> ---
>  .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   5 +-
>  drivers/staging/fsl-mc/bus/mc-allocator.c          |   9 +-
>  drivers/staging/fsl-mc/bus/mc-msi.c                | 169 +--------------------
>  drivers/staging/fsl-mc/include/mc-sys.h            |   3 +
>  4 files changed, 14 insertions(+), 172 deletions(-)
> 
> diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> index 720e2b0..0eecb7e 100644
> --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> @@ -25,7 +25,6 @@ static struct irq_chip its_msi_irq_chip = {
>  	.irq_mask = irq_chip_mask_parent,
>  	.irq_unmask = irq_chip_unmask_parent,
>  	.irq_eoi = irq_chip_eoi_parent,
> -	.irq_set_affinity = msi_domain_set_affinity
>  };
>  
>  static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
> @@ -86,7 +85,7 @@ int __init its_fsl_mc_msi_init(void)
>  			continue;
>  		}
>  
> -		mc_msi_domain = fsl_mc_msi_create_irq_domain(
> +		mc_msi_domain = platform_msi_create_irq_domain(
>  						 of_node_to_fwnode(np),
>  						 &its_fsl_mc_msi_domain_info,
>  						 parent);

What? We are already creating a platform MSI domain for the ITS. How is
that going to work? If you want to convert this set of drivers to
platform ITS, fine. But you can't randomly hack in the ITS code and pray
for things not to fall apart.

	M.
-- 
Jazz is not dead. It just smells funny...
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
@ 2016-04-13 10:56     ` Marc Zyngier
  0 siblings, 0 replies; 33+ messages in thread
From: Marc Zyngier @ 2016-04-13 10:56 UTC (permalink / raw)
  To: linux-arm-kernel

On 13/04/16 11:30, Matthias Brugger wrote:
> From: Matthias Brugger <matthias.bgg@gmail.com>
> 
> The fsl-mc driver can't be build as a module because it uses msi_*
> functions directly. Port the driver to use the platform_msi_*
> infrastructure instead, to allow it to be build as a module.
> 
> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
> ---
>  .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   5 +-
>  drivers/staging/fsl-mc/bus/mc-allocator.c          |   9 +-
>  drivers/staging/fsl-mc/bus/mc-msi.c                | 169 +--------------------
>  drivers/staging/fsl-mc/include/mc-sys.h            |   3 +
>  4 files changed, 14 insertions(+), 172 deletions(-)
> 
> diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> index 720e2b0..0eecb7e 100644
> --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> @@ -25,7 +25,6 @@ static struct irq_chip its_msi_irq_chip = {
>  	.irq_mask = irq_chip_mask_parent,
>  	.irq_unmask = irq_chip_unmask_parent,
>  	.irq_eoi = irq_chip_eoi_parent,
> -	.irq_set_affinity = msi_domain_set_affinity
>  };
>  
>  static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
> @@ -86,7 +85,7 @@ int __init its_fsl_mc_msi_init(void)
>  			continue;
>  		}
>  
> -		mc_msi_domain = fsl_mc_msi_create_irq_domain(
> +		mc_msi_domain = platform_msi_create_irq_domain(
>  						 of_node_to_fwnode(np),
>  						 &its_fsl_mc_msi_domain_info,
>  						 parent);

What? We are already creating a platform MSI domain for the ITS. How is
that going to work? If you want to convert this set of drivers to
platform ITS, fine. But you can't randomly hack in the ITS code and pray
for things not to fall apart.

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
@ 2016-04-13 11:23       ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 11:23 UTC (permalink / raw)
  To: Marc Zyngier, gregkh, robh+dt, frowand.list, grant.likely,
	German.Rivera, jiang.liu, tglx
  Cc: treding, stuart.yoder, jroedel, agraf, bp, matthias.bgg,
	bhaktipriya96, linux-kernel, devicetree, devel, linux-arm-kernel



On 13/04/16 12:56, Marc Zyngier wrote:
> On 13/04/16 11:30, Matthias Brugger wrote:
>> From: Matthias Brugger <matthias.bgg@gmail.com>
>>
>> The fsl-mc driver can't be build as a module because it uses msi_*
>> functions directly. Port the driver to use the platform_msi_*
>> infrastructure instead, to allow it to be build as a module.
>>
>> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
>> ---
>>   .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   5 +-
>>   drivers/staging/fsl-mc/bus/mc-allocator.c          |   9 +-
>>   drivers/staging/fsl-mc/bus/mc-msi.c                | 169 +--------------------
>>   drivers/staging/fsl-mc/include/mc-sys.h            |   3 +
>>   4 files changed, 14 insertions(+), 172 deletions(-)
>>
>> diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>> index 720e2b0..0eecb7e 100644
>> --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>> +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>> @@ -25,7 +25,6 @@ static struct irq_chip its_msi_irq_chip = {
>>   	.irq_mask = irq_chip_mask_parent,
>>   	.irq_unmask = irq_chip_unmask_parent,
>>   	.irq_eoi = irq_chip_eoi_parent,
>> -	.irq_set_affinity = msi_domain_set_affinity
>>   };
>>
>>   static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
>> @@ -86,7 +85,7 @@ int __init its_fsl_mc_msi_init(void)
>>   			continue;
>>   		}
>>
>> -		mc_msi_domain = fsl_mc_msi_create_irq_domain(
>> +		mc_msi_domain = platform_msi_create_irq_domain(
>>   						 of_node_to_fwnode(np),
>>   						 &its_fsl_mc_msi_domain_info,
>>   						 parent);
>
> What? We are already creating a platform MSI domain for the ITS. How is
> that going to work? If you want to convert this set of drivers to
> platform ITS, fine. But you can't randomly hack in the ITS code and pray
> for things not to fall apart.
>

 From what I see, the difference between irq-gic-v3-its-fsl-mc-msi and 
the irq-gic-v3-its-platform-msi is the way ITS specific DeviceID is 
created in msi_prepare.

German, is there a reason why you use the ICID read from the DPRC as dev_id?

Regards,
Matthias

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
@ 2016-04-13 11:23       ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 11:23 UTC (permalink / raw)
  To: Marc Zyngier, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	frowand.list-Re5JQEeQqe8AvxtiuMwx3w,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	German.Rivera-KZfg59tc24xl57MIdRCFDg,
	jiang.liu-VuQAYsv1563Yd54FQh9/CA, tglx-hfZtesqFncYOwBW4kG4KsQ
  Cc: treding-DDmLM1+adcrQT0dZR+AlfA, stuart.yoder-3arQi8VN3Tc,
	jroedel-l3A5Bk7waGM, agraf-l3A5Bk7waGM, bp-l3A5Bk7waGM,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	bhaktipriya96-Re5JQEeQqe8AvxtiuMwx3w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r



On 13/04/16 12:56, Marc Zyngier wrote:
> On 13/04/16 11:30, Matthias Brugger wrote:
>> From: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>
>> The fsl-mc driver can't be build as a module because it uses msi_*
>> functions directly. Port the driver to use the platform_msi_*
>> infrastructure instead, to allow it to be build as a module.
>>
>> Signed-off-by: Matthias Brugger <mbrugger-IBi9RG/b67k@public.gmane.org>
>> ---
>>   .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   5 +-
>>   drivers/staging/fsl-mc/bus/mc-allocator.c          |   9 +-
>>   drivers/staging/fsl-mc/bus/mc-msi.c                | 169 +--------------------
>>   drivers/staging/fsl-mc/include/mc-sys.h            |   3 +
>>   4 files changed, 14 insertions(+), 172 deletions(-)
>>
>> diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>> index 720e2b0..0eecb7e 100644
>> --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>> +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>> @@ -25,7 +25,6 @@ static struct irq_chip its_msi_irq_chip = {
>>   	.irq_mask = irq_chip_mask_parent,
>>   	.irq_unmask = irq_chip_unmask_parent,
>>   	.irq_eoi = irq_chip_eoi_parent,
>> -	.irq_set_affinity = msi_domain_set_affinity
>>   };
>>
>>   static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
>> @@ -86,7 +85,7 @@ int __init its_fsl_mc_msi_init(void)
>>   			continue;
>>   		}
>>
>> -		mc_msi_domain = fsl_mc_msi_create_irq_domain(
>> +		mc_msi_domain = platform_msi_create_irq_domain(
>>   						 of_node_to_fwnode(np),
>>   						 &its_fsl_mc_msi_domain_info,
>>   						 parent);
>
> What? We are already creating a platform MSI domain for the ITS. How is
> that going to work? If you want to convert this set of drivers to
> platform ITS, fine. But you can't randomly hack in the ITS code and pray
> for things not to fall apart.
>

 From what I see, the difference between irq-gic-v3-its-fsl-mc-msi and 
the irq-gic-v3-its-platform-msi is the way ITS specific DeviceID is 
created in msi_prepare.

German, is there a reason why you use the ICID read from the DPRC as dev_id?

Regards,
Matthias
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
@ 2016-04-13 11:23       ` Matthias Brugger
  0 siblings, 0 replies; 33+ messages in thread
From: Matthias Brugger @ 2016-04-13 11:23 UTC (permalink / raw)
  To: linux-arm-kernel



On 13/04/16 12:56, Marc Zyngier wrote:
> On 13/04/16 11:30, Matthias Brugger wrote:
>> From: Matthias Brugger <matthias.bgg@gmail.com>
>>
>> The fsl-mc driver can't be build as a module because it uses msi_*
>> functions directly. Port the driver to use the platform_msi_*
>> infrastructure instead, to allow it to be build as a module.
>>
>> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
>> ---
>>   .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   5 +-
>>   drivers/staging/fsl-mc/bus/mc-allocator.c          |   9 +-
>>   drivers/staging/fsl-mc/bus/mc-msi.c                | 169 +--------------------
>>   drivers/staging/fsl-mc/include/mc-sys.h            |   3 +
>>   4 files changed, 14 insertions(+), 172 deletions(-)
>>
>> diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>> index 720e2b0..0eecb7e 100644
>> --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>> +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>> @@ -25,7 +25,6 @@ static struct irq_chip its_msi_irq_chip = {
>>   	.irq_mask = irq_chip_mask_parent,
>>   	.irq_unmask = irq_chip_unmask_parent,
>>   	.irq_eoi = irq_chip_eoi_parent,
>> -	.irq_set_affinity = msi_domain_set_affinity
>>   };
>>
>>   static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
>> @@ -86,7 +85,7 @@ int __init its_fsl_mc_msi_init(void)
>>   			continue;
>>   		}
>>
>> -		mc_msi_domain = fsl_mc_msi_create_irq_domain(
>> +		mc_msi_domain = platform_msi_create_irq_domain(
>>   						 of_node_to_fwnode(np),
>>   						 &its_fsl_mc_msi_domain_info,
>>   						 parent);
>
> What? We are already creating a platform MSI domain for the ITS. How is
> that going to work? If you want to convert this set of drivers to
> platform ITS, fine. But you can't randomly hack in the ITS code and pray
> for things not to fall apart.
>

 From what I see, the difference between irq-gic-v3-its-fsl-mc-msi and 
the irq-gic-v3-its-platform-msi is the way ITS specific DeviceID is 
created in msi_prepare.

German, is there a reason why you use the ICID read from the DPRC as dev_id?

Regards,
Matthias

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
  2016-04-13 11:23       ` Matthias Brugger
  (?)
@ 2016-04-13 12:08         ` Marc Zyngier
  -1 siblings, 0 replies; 33+ messages in thread
From: Marc Zyngier @ 2016-04-13 12:08 UTC (permalink / raw)
  To: Matthias Brugger, gregkh, robh+dt, frowand.list, grant.likely,
	German.Rivera, jiang.liu, tglx
  Cc: treding, stuart.yoder, jroedel, agraf, bp, matthias.bgg,
	bhaktipriya96, linux-kernel, devicetree, devel, linux-arm-kernel

On 13/04/16 12:23, Matthias Brugger wrote:
> 
> 
> On 13/04/16 12:56, Marc Zyngier wrote:
>> On 13/04/16 11:30, Matthias Brugger wrote:
>>> From: Matthias Brugger <matthias.bgg@gmail.com>
>>>
>>> The fsl-mc driver can't be build as a module because it uses msi_*
>>> functions directly. Port the driver to use the platform_msi_*
>>> infrastructure instead, to allow it to be build as a module.
>>>
>>> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
>>> ---
>>>   .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   5 +-
>>>   drivers/staging/fsl-mc/bus/mc-allocator.c          |   9 +-
>>>   drivers/staging/fsl-mc/bus/mc-msi.c                | 169 +--------------------
>>>   drivers/staging/fsl-mc/include/mc-sys.h            |   3 +
>>>   4 files changed, 14 insertions(+), 172 deletions(-)
>>>
>>> diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>>> index 720e2b0..0eecb7e 100644
>>> --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>>> +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>>> @@ -25,7 +25,6 @@ static struct irq_chip its_msi_irq_chip = {
>>>   	.irq_mask = irq_chip_mask_parent,
>>>   	.irq_unmask = irq_chip_unmask_parent,
>>>   	.irq_eoi = irq_chip_eoi_parent,
>>> -	.irq_set_affinity = msi_domain_set_affinity
>>>   };
>>>
>>>   static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
>>> @@ -86,7 +85,7 @@ int __init its_fsl_mc_msi_init(void)
>>>   			continue;
>>>   		}
>>>
>>> -		mc_msi_domain = fsl_mc_msi_create_irq_domain(
>>> +		mc_msi_domain = platform_msi_create_irq_domain(
>>>   						 of_node_to_fwnode(np),
>>>   						 &its_fsl_mc_msi_domain_info,
>>>   						 parent);
>>
>> What? We are already creating a platform MSI domain for the ITS. How is
>> that going to work? If you want to convert this set of drivers to
>> platform ITS, fine. But you can't randomly hack in the ITS code and pray
>> for things not to fall apart.
>>
> 
>  From what I see, the difference between irq-gic-v3-its-fsl-mc-msi and 
> the irq-gic-v3-its-platform-msi is the way ITS specific DeviceID is 
> created in msi_prepare.

It is not "created". It is extracted from the HW, either by looking at
the RequesterID (PCI), at the DT (platform MSI), or a bus-specific method.

> German, is there a reason why you use the ICID read from the DPRC as dev_id?

Because that's what is presented to the ITS as a DevID. This is a HW
constraint, and you can't just change it.

If you want to use platform MSI for that, you also need to describe the
DevID in the DT (breaking the existing platforms in the process).

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
@ 2016-04-13 12:08         ` Marc Zyngier
  0 siblings, 0 replies; 33+ messages in thread
From: Marc Zyngier @ 2016-04-13 12:08 UTC (permalink / raw)
  To: Matthias Brugger, gregkh, robh+dt, frowand.list, grant.likely,
	German.Rivera, jiang.liu, tglx
  Cc: devel, devicetree, bp, bhaktipriya96, stuart.yoder, agraf,
	jroedel, linux-arm-kernel, matthias.bgg, treding, linux-kernel

On 13/04/16 12:23, Matthias Brugger wrote:
> 
> 
> On 13/04/16 12:56, Marc Zyngier wrote:
>> On 13/04/16 11:30, Matthias Brugger wrote:
>>> From: Matthias Brugger <matthias.bgg@gmail.com>
>>>
>>> The fsl-mc driver can't be build as a module because it uses msi_*
>>> functions directly. Port the driver to use the platform_msi_*
>>> infrastructure instead, to allow it to be build as a module.
>>>
>>> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
>>> ---
>>>   .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   5 +-
>>>   drivers/staging/fsl-mc/bus/mc-allocator.c          |   9 +-
>>>   drivers/staging/fsl-mc/bus/mc-msi.c                | 169 +--------------------
>>>   drivers/staging/fsl-mc/include/mc-sys.h            |   3 +
>>>   4 files changed, 14 insertions(+), 172 deletions(-)
>>>
>>> diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>>> index 720e2b0..0eecb7e 100644
>>> --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>>> +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>>> @@ -25,7 +25,6 @@ static struct irq_chip its_msi_irq_chip = {
>>>   	.irq_mask = irq_chip_mask_parent,
>>>   	.irq_unmask = irq_chip_unmask_parent,
>>>   	.irq_eoi = irq_chip_eoi_parent,
>>> -	.irq_set_affinity = msi_domain_set_affinity
>>>   };
>>>
>>>   static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
>>> @@ -86,7 +85,7 @@ int __init its_fsl_mc_msi_init(void)
>>>   			continue;
>>>   		}
>>>
>>> -		mc_msi_domain = fsl_mc_msi_create_irq_domain(
>>> +		mc_msi_domain = platform_msi_create_irq_domain(
>>>   						 of_node_to_fwnode(np),
>>>   						 &its_fsl_mc_msi_domain_info,
>>>   						 parent);
>>
>> What? We are already creating a platform MSI domain for the ITS. How is
>> that going to work? If you want to convert this set of drivers to
>> platform ITS, fine. But you can't randomly hack in the ITS code and pray
>> for things not to fall apart.
>>
> 
>  From what I see, the difference between irq-gic-v3-its-fsl-mc-msi and 
> the irq-gic-v3-its-platform-msi is the way ITS specific DeviceID is 
> created in msi_prepare.

It is not "created". It is extracted from the HW, either by looking at
the RequesterID (PCI), at the DT (platform MSI), or a bus-specific method.

> German, is there a reason why you use the ICID read from the DPRC as dev_id?

Because that's what is presented to the ITS as a DevID. This is a HW
constraint, and you can't just change it.

If you want to use platform MSI for that, you also need to describe the
DevID in the DT (breaking the existing platforms in the process).

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
@ 2016-04-13 12:08         ` Marc Zyngier
  0 siblings, 0 replies; 33+ messages in thread
From: Marc Zyngier @ 2016-04-13 12:08 UTC (permalink / raw)
  To: linux-arm-kernel

On 13/04/16 12:23, Matthias Brugger wrote:
> 
> 
> On 13/04/16 12:56, Marc Zyngier wrote:
>> On 13/04/16 11:30, Matthias Brugger wrote:
>>> From: Matthias Brugger <matthias.bgg@gmail.com>
>>>
>>> The fsl-mc driver can't be build as a module because it uses msi_*
>>> functions directly. Port the driver to use the platform_msi_*
>>> infrastructure instead, to allow it to be build as a module.
>>>
>>> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
>>> ---
>>>   .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   5 +-
>>>   drivers/staging/fsl-mc/bus/mc-allocator.c          |   9 +-
>>>   drivers/staging/fsl-mc/bus/mc-msi.c                | 169 +--------------------
>>>   drivers/staging/fsl-mc/include/mc-sys.h            |   3 +
>>>   4 files changed, 14 insertions(+), 172 deletions(-)
>>>
>>> diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>>> index 720e2b0..0eecb7e 100644
>>> --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>>> +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
>>> @@ -25,7 +25,6 @@ static struct irq_chip its_msi_irq_chip = {
>>>   	.irq_mask = irq_chip_mask_parent,
>>>   	.irq_unmask = irq_chip_unmask_parent,
>>>   	.irq_eoi = irq_chip_eoi_parent,
>>> -	.irq_set_affinity = msi_domain_set_affinity
>>>   };
>>>
>>>   static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
>>> @@ -86,7 +85,7 @@ int __init its_fsl_mc_msi_init(void)
>>>   			continue;
>>>   		}
>>>
>>> -		mc_msi_domain = fsl_mc_msi_create_irq_domain(
>>> +		mc_msi_domain = platform_msi_create_irq_domain(
>>>   						 of_node_to_fwnode(np),
>>>   						 &its_fsl_mc_msi_domain_info,
>>>   						 parent);
>>
>> What? We are already creating a platform MSI domain for the ITS. How is
>> that going to work? If you want to convert this set of drivers to
>> platform ITS, fine. But you can't randomly hack in the ITS code and pray
>> for things not to fall apart.
>>
> 
>  From what I see, the difference between irq-gic-v3-its-fsl-mc-msi and 
> the irq-gic-v3-its-platform-msi is the way ITS specific DeviceID is 
> created in msi_prepare.

It is not "created". It is extracted from the HW, either by looking at
the RequesterID (PCI), at the DT (platform MSI), or a bus-specific method.

> German, is there a reason why you use the ICID read from the DPRC as dev_id?

Because that's what is presented to the ITS as a DevID. This is a HW
constraint, and you can't just change it.

If you want to use platform MSI for that, you also need to describe the
DevID in the DT (breaking the existing platforms in the process).

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 1/6] of/irq: Export of_msi_get_domain
@ 2016-04-13 12:32     ` Rob Herring
  0 siblings, 0 replies; 33+ messages in thread
From: Rob Herring @ 2016-04-13 12:32 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: Greg Kroah-Hartman, Frank Rowand, Grant Likely, German.Rivera,
	Jiang Liu, Marc Zyngier, Thomas Gleixner, Thierry Reding,
	stuart.yoder, Joerg Roedel, Alexander Graf, bp, Matthias Brugger,
	bhaktipriya96, linux-kernel, devicetree, devel, linux-arm-kernel

On Wed, Apr 13, 2016 at 5:30 AM, Matthias Brugger <mbrugger@suse.com> wrote:
> From: Matthias Brugger <matthias.bgg@gmail.com>
>
> Export of_mis_get_domain to enable it for users from outside.
>
> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
> ---
>  drivers/of/irq.c | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 1/6] of/irq: Export of_msi_get_domain
@ 2016-04-13 12:32     ` Rob Herring
  0 siblings, 0 replies; 33+ messages in thread
From: Rob Herring @ 2016-04-13 12:32 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: Greg Kroah-Hartman, Frank Rowand, Grant Likely,
	German.Rivera-KZfg59tc24xl57MIdRCFDg, Jiang Liu, Marc Zyngier,
	Thomas Gleixner, Thierry Reding, stuart.yoder-3arQi8VN3Tc,
	Joerg Roedel, Alexander Graf, bp-l3A5Bk7waGM, Matthias Brugger,
	bhaktipriya96-Re5JQEeQqe8AvxtiuMwx3w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wed, Apr 13, 2016 at 5:30 AM, Matthias Brugger <mbrugger-IBi9RG/b67k@public.gmane.org> wrote:
> From: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> Export of_mis_get_domain to enable it for users from outside.
>
> Signed-off-by: Matthias Brugger <mbrugger-IBi9RG/b67k@public.gmane.org>
> ---
>  drivers/of/irq.c | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 1/6] of/irq: Export of_msi_get_domain
@ 2016-04-13 12:32     ` Rob Herring
  0 siblings, 0 replies; 33+ messages in thread
From: Rob Herring @ 2016-04-13 12:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 13, 2016 at 5:30 AM, Matthias Brugger <mbrugger@suse.com> wrote:
> From: Matthias Brugger <matthias.bgg@gmail.com>
>
> Export of_mis_get_domain to enable it for users from outside.
>
> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
> ---
>  drivers/of/irq.c | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 33+ messages in thread

* RE: [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
  2016-04-13 11:23       ` Matthias Brugger
  (?)
@ 2016-04-13 14:57         ` Stuart Yoder
  -1 siblings, 0 replies; 33+ messages in thread
From: Stuart Yoder @ 2016-04-13 14:57 UTC (permalink / raw)
  To: Matthias Brugger, Marc Zyngier, gregkh, robh+dt, frowand.list,
	grant.likely, German.Rivera, jiang.liu, tglx
  Cc: treding, jroedel, agraf, bp, matthias.bgg, bhaktipriya96,
	linux-kernel, devicetree, devel, linux-arm-kernel



> -----Original Message-----
> From: Matthias Brugger [mailto:mbrugger@suse.com]
> Sent: Wednesday, April 13, 2016 6:23 AM
> To: Marc Zyngier <marc.zyngier@arm.com>; gregkh@linuxfoundation.org; robh+dt@kernel.org;
> frowand.list@gmail.com; grant.likely@linaro.org; German.Rivera@freescale.com;
> jiang.liu@linux.intel.com; tglx@linutronix.de
> Cc: treding@nvidia.com; Stuart Yoder <stuart.yoder@nxp.com>; jroedel@suse.de; agraf@suse.de;
> bp@suse.de; matthias.bgg@gmail.com; bhaktipriya96@gmail.com; linux-kernel@vger.kernel.org;
> devicetree@vger.kernel.org; devel@driverdev.osuosl.org; linux-arm-kernel@lists.infradead.org
> Subject: Re: [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
> 
> 
> 
> On 13/04/16 12:56, Marc Zyngier wrote:
> > On 13/04/16 11:30, Matthias Brugger wrote:
> >> From: Matthias Brugger <matthias.bgg@gmail.com>
> >>
> >> The fsl-mc driver can't be build as a module because it uses msi_*
> >> functions directly. Port the driver to use the platform_msi_*
> >> infrastructure instead, to allow it to be build as a module.
> >>
> >> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
> >> ---
> >>   .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   5 +-
> >>   drivers/staging/fsl-mc/bus/mc-allocator.c          |   9 +-
> >>   drivers/staging/fsl-mc/bus/mc-msi.c                | 169 +--------------------
> >>   drivers/staging/fsl-mc/include/mc-sys.h            |   3 +
> >>   4 files changed, 14 insertions(+), 172 deletions(-)
> >>
> >> diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-
> mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> >> index 720e2b0..0eecb7e 100644
> >> --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> >> +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> >> @@ -25,7 +25,6 @@ static struct irq_chip its_msi_irq_chip = {
> >>   	.irq_mask = irq_chip_mask_parent,
> >>   	.irq_unmask = irq_chip_unmask_parent,
> >>   	.irq_eoi = irq_chip_eoi_parent,
> >> -	.irq_set_affinity = msi_domain_set_affinity
> >>   };
> >>
> >>   static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
> >> @@ -86,7 +85,7 @@ int __init its_fsl_mc_msi_init(void)
> >>   			continue;
> >>   		}
> >>
> >> -		mc_msi_domain = fsl_mc_msi_create_irq_domain(
> >> +		mc_msi_domain = platform_msi_create_irq_domain(
> >>   						 of_node_to_fwnode(np),
> >>   						 &its_fsl_mc_msi_domain_info,
> >>   						 parent);
> >
> > What? We are already creating a platform MSI domain for the ITS. How is
> > that going to work? If you want to convert this set of drivers to
> > platform ITS, fine. But you can't randomly hack in the ITS code and pray
> > for things not to fall apart.
> >
> 
>  From what I see, the difference between irq-gic-v3-its-fsl-mc-msi and
> the irq-gic-v3-its-platform-msi is the way ITS specific DeviceID is
> created in msi_prepare.
> 
> German, is there a reason why you use the ICID read from the DPRC as dev_id?

Because it _is_ the dev_id at the hardware level.  There is an fsl-mc bus
specific mechanism to get that id...it's not in the device tree.

Stuart

^ permalink raw reply	[flat|nested] 33+ messages in thread

* RE: [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
@ 2016-04-13 14:57         ` Stuart Yoder
  0 siblings, 0 replies; 33+ messages in thread
From: Stuart Yoder @ 2016-04-13 14:57 UTC (permalink / raw)
  To: Matthias Brugger, Marc Zyngier, gregkh, robh+dt, frowand.list,
	grant.likely, German.Rivera, jiang.liu, tglx
  Cc: devel, devicetree, bp, bhaktipriya96, agraf, linux-kernel,
	jroedel, matthias.bgg, treding, linux-arm-kernel



> -----Original Message-----
> From: Matthias Brugger [mailto:mbrugger@suse.com]
> Sent: Wednesday, April 13, 2016 6:23 AM
> To: Marc Zyngier <marc.zyngier@arm.com>; gregkh@linuxfoundation.org; robh+dt@kernel.org;
> frowand.list@gmail.com; grant.likely@linaro.org; German.Rivera@freescale.com;
> jiang.liu@linux.intel.com; tglx@linutronix.de
> Cc: treding@nvidia.com; Stuart Yoder <stuart.yoder@nxp.com>; jroedel@suse.de; agraf@suse.de;
> bp@suse.de; matthias.bgg@gmail.com; bhaktipriya96@gmail.com; linux-kernel@vger.kernel.org;
> devicetree@vger.kernel.org; devel@driverdev.osuosl.org; linux-arm-kernel@lists.infradead.org
> Subject: Re: [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
> 
> 
> 
> On 13/04/16 12:56, Marc Zyngier wrote:
> > On 13/04/16 11:30, Matthias Brugger wrote:
> >> From: Matthias Brugger <matthias.bgg@gmail.com>
> >>
> >> The fsl-mc driver can't be build as a module because it uses msi_*
> >> functions directly. Port the driver to use the platform_msi_*
> >> infrastructure instead, to allow it to be build as a module.
> >>
> >> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
> >> ---
> >>   .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   5 +-
> >>   drivers/staging/fsl-mc/bus/mc-allocator.c          |   9 +-
> >>   drivers/staging/fsl-mc/bus/mc-msi.c                | 169 +--------------------
> >>   drivers/staging/fsl-mc/include/mc-sys.h            |   3 +
> >>   4 files changed, 14 insertions(+), 172 deletions(-)
> >>
> >> diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-
> mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> >> index 720e2b0..0eecb7e 100644
> >> --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> >> +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> >> @@ -25,7 +25,6 @@ static struct irq_chip its_msi_irq_chip = {
> >>   	.irq_mask = irq_chip_mask_parent,
> >>   	.irq_unmask = irq_chip_unmask_parent,
> >>   	.irq_eoi = irq_chip_eoi_parent,
> >> -	.irq_set_affinity = msi_domain_set_affinity
> >>   };
> >>
> >>   static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
> >> @@ -86,7 +85,7 @@ int __init its_fsl_mc_msi_init(void)
> >>   			continue;
> >>   		}
> >>
> >> -		mc_msi_domain = fsl_mc_msi_create_irq_domain(
> >> +		mc_msi_domain = platform_msi_create_irq_domain(
> >>   						 of_node_to_fwnode(np),
> >>   						 &its_fsl_mc_msi_domain_info,
> >>   						 parent);
> >
> > What? We are already creating a platform MSI domain for the ITS. How is
> > that going to work? If you want to convert this set of drivers to
> > platform ITS, fine. But you can't randomly hack in the ITS code and pray
> > for things not to fall apart.
> >
> 
>  From what I see, the difference between irq-gic-v3-its-fsl-mc-msi and
> the irq-gic-v3-its-platform-msi is the way ITS specific DeviceID is
> created in msi_prepare.
> 
> German, is there a reason why you use the ICID read from the DPRC as dev_id?

Because it _is_ the dev_id at the hardware level.  There is an fsl-mc bus
specific mechanism to get that id...it's not in the device tree.

Stuart

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
@ 2016-04-13 14:57         ` Stuart Yoder
  0 siblings, 0 replies; 33+ messages in thread
From: Stuart Yoder @ 2016-04-13 14:57 UTC (permalink / raw)
  To: linux-arm-kernel



> -----Original Message-----
> From: Matthias Brugger [mailto:mbrugger at suse.com]
> Sent: Wednesday, April 13, 2016 6:23 AM
> To: Marc Zyngier <marc.zyngier@arm.com>; gregkh at linuxfoundation.org; robh+dt at kernel.org;
> frowand.list at gmail.com; grant.likely at linaro.org; German.Rivera at freescale.com;
> jiang.liu at linux.intel.com; tglx at linutronix.de
> Cc: treding at nvidia.com; Stuart Yoder <stuart.yoder@nxp.com>; jroedel at suse.de; agraf at suse.de;
> bp at suse.de; matthias.bgg at gmail.com; bhaktipriya96 at gmail.com; linux-kernel at vger.kernel.org;
> devicetree at vger.kernel.org; devel at driverdev.osuosl.org; linux-arm-kernel at lists.infradead.org
> Subject: Re: [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure
> 
> 
> 
> On 13/04/16 12:56, Marc Zyngier wrote:
> > On 13/04/16 11:30, Matthias Brugger wrote:
> >> From: Matthias Brugger <matthias.bgg@gmail.com>
> >>
> >> The fsl-mc driver can't be build as a module because it uses msi_*
> >> functions directly. Port the driver to use the platform_msi_*
> >> infrastructure instead, to allow it to be build as a module.
> >>
> >> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
> >> ---
> >>   .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   5 +-
> >>   drivers/staging/fsl-mc/bus/mc-allocator.c          |   9 +-
> >>   drivers/staging/fsl-mc/bus/mc-msi.c                | 169 +--------------------
> >>   drivers/staging/fsl-mc/include/mc-sys.h            |   3 +
> >>   4 files changed, 14 insertions(+), 172 deletions(-)
> >>
> >> diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-
> mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> >> index 720e2b0..0eecb7e 100644
> >> --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> >> +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> >> @@ -25,7 +25,6 @@ static struct irq_chip its_msi_irq_chip = {
> >>   	.irq_mask = irq_chip_mask_parent,
> >>   	.irq_unmask = irq_chip_unmask_parent,
> >>   	.irq_eoi = irq_chip_eoi_parent,
> >> -	.irq_set_affinity = msi_domain_set_affinity
> >>   };
> >>
> >>   static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
> >> @@ -86,7 +85,7 @@ int __init its_fsl_mc_msi_init(void)
> >>   			continue;
> >>   		}
> >>
> >> -		mc_msi_domain = fsl_mc_msi_create_irq_domain(
> >> +		mc_msi_domain = platform_msi_create_irq_domain(
> >>   						 of_node_to_fwnode(np),
> >>   						 &its_fsl_mc_msi_domain_info,
> >>   						 parent);
> >
> > What? We are already creating a platform MSI domain for the ITS. How is
> > that going to work? If you want to convert this set of drivers to
> > platform ITS, fine. But you can't randomly hack in the ITS code and pray
> > for things not to fall apart.
> >
> 
>  From what I see, the difference between irq-gic-v3-its-fsl-mc-msi and
> the irq-gic-v3-its-platform-msi is the way ITS specific DeviceID is
> created in msi_prepare.
> 
> German, is there a reason why you use the ICID read from the DPRC as dev_id?

Because it _is_ the dev_id at the hardware level.  There is an fsl-mc bus
specific mechanism to get that id...it's not in the device tree.

Stuart

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2016-04-13 14:57 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-13 10:30 staging: fsl-mc: Convert to use platform_msi infrastrucutre Matthias Brugger
2016-04-13 10:30 ` Matthias Brugger
2016-04-13 10:30 ` Matthias Brugger
2016-04-13 10:30 ` [PATCH 1/6] of/irq: Export of_msi_get_domain Matthias Brugger
2016-04-13 10:30   ` Matthias Brugger
2016-04-13 10:30   ` Matthias Brugger
2016-04-13 12:32   ` Rob Herring
2016-04-13 12:32     ` Rob Herring
2016-04-13 12:32     ` Rob Herring
2016-04-13 10:30 ` [PATCH 2/6] base: Export platform_msi_create_irq_domain Matthias Brugger
2016-04-13 10:30   ` Matthias Brugger
2016-04-13 10:30 ` [PATCH 3/6] genirq/msi: Export msi_get_domain_info Matthias Brugger
2016-04-13 10:30   ` Matthias Brugger
2016-04-13 10:30   ` Matthias Brugger
2016-04-13 10:30 ` [PATCH 4/6] staging: fsl-mc: Use platform_msi_* infrastructure Matthias Brugger
2016-04-13 10:30   ` Matthias Brugger
2016-04-13 10:56   ` Marc Zyngier
2016-04-13 10:56     ` Marc Zyngier
2016-04-13 10:56     ` Marc Zyngier
2016-04-13 11:23     ` Matthias Brugger
2016-04-13 11:23       ` Matthias Brugger
2016-04-13 11:23       ` Matthias Brugger
2016-04-13 12:08       ` Marc Zyngier
2016-04-13 12:08         ` Marc Zyngier
2016-04-13 12:08         ` Marc Zyngier
2016-04-13 14:57       ` Stuart Yoder
2016-04-13 14:57         ` Stuart Yoder
2016-04-13 14:57         ` Stuart Yoder
2016-04-13 10:30 ` [PATCH 5/6] staging: fsl-mc: Clean up of irq_chip callbacks Matthias Brugger
2016-04-13 10:30   ` Matthias Brugger
2016-04-13 10:30 ` [PATCH 6/6] Revert "staging: fsl-mc: Do not allow building as a module" Matthias Brugger
2016-04-13 10:30   ` Matthias Brugger
2016-04-13 10:30   ` Matthias Brugger

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.