All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-09-26 17:49 ` Khuong Dinh
  0 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-09-26 17:49 UTC (permalink / raw)
  To: lorenzo.pieralisi, marc.zyngier, msalter, bhelgaas, linux-pci, jcm
  Cc: patches, linux-kernel, linux-arm-kernel, rjw, Khuong Dinh

This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
and provides the proper MSI driver initialization ordering.

Signed-off-by: Khuong Dinh <kdinh@apm.com>
---
v4:
 - Remove Marc Zyngier ACK in v2
 - Use acpi_bus_scan on MSI controller handle when MSI device is found
 - Register ACPI MSI driver when MSI device is found instead of using
 subsys_initcall
 - Split ACPI MSI driver support into two patches - one to enable MSI
support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
before PCIe controller driver in ACPI boot mode
v3:
 - Input X-Gene MSI base address for irq_domain_alloc_fwnode
 - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
v2:
 - Verify with BIOS version 3.06.25 and 3.07.09
v1:
 - Initial version
---

Khuong Dinh (2):
  PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
  PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot

 drivers/acpi/Makefile            |    2 +-
 drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpi_platform.c     |    3 +-
 drivers/acpi/internal.h          |    1 +
 drivers/acpi/scan.c              |    1 +
 drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
 include/linux/acpi_msi.h         |   37 ++++++++++++++++
 7 files changed, 183 insertions(+), 7 deletions(-)
 create mode 100644 drivers/acpi/acpi_msi.c
 create mode 100644 include/linux/acpi_msi.h

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

* [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-09-26 17:49 ` Khuong Dinh
  0 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-09-26 17:49 UTC (permalink / raw)
  To: lorenzo.pieralisi, marc.zyngier, msalter, bhelgaas, linux-pci, jcm
  Cc: rjw, Khuong Dinh, patches, linux-kernel, linux-arm-kernel

This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
and provides the proper MSI driver initialization ordering.

Signed-off-by: Khuong Dinh <kdinh@apm.com>
---
v4:
 - Remove Marc Zyngier ACK in v2
 - Use acpi_bus_scan on MSI controller handle when MSI device is found
 - Register ACPI MSI driver when MSI device is found instead of using
 subsys_initcall
 - Split ACPI MSI driver support into two patches - one to enable MSI
support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
before PCIe controller driver in ACPI boot mode
v3:
 - Input X-Gene MSI base address for irq_domain_alloc_fwnode
 - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
v2:
 - Verify with BIOS version 3.06.25 and 3.07.09
v1:
 - Initial version
---

Khuong Dinh (2):
  PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
  PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot

 drivers/acpi/Makefile            |    2 +-
 drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpi_platform.c     |    3 +-
 drivers/acpi/internal.h          |    1 +
 drivers/acpi/scan.c              |    1 +
 drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
 include/linux/acpi_msi.h         |   37 ++++++++++++++++
 7 files changed, 183 insertions(+), 7 deletions(-)
 create mode 100644 drivers/acpi/acpi_msi.c
 create mode 100644 include/linux/acpi_msi.h


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-09-26 17:49 ` Khuong Dinh
  0 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-09-26 17:49 UTC (permalink / raw)
  To: linux-arm-kernel

This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
and provides the proper MSI driver initialization ordering.

Signed-off-by: Khuong Dinh <kdinh@apm.com>
---
v4:
 - Remove Marc Zyngier ACK in v2
 - Use acpi_bus_scan on MSI controller handle when MSI device is found
 - Register ACPI MSI driver when MSI device is found instead of using
 subsys_initcall
 - Split ACPI MSI driver support into two patches - one to enable MSI
support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
before PCIe controller driver in ACPI boot mode
v3:
 - Input X-Gene MSI base address for irq_domain_alloc_fwnode
 - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
v2:
 - Verify with BIOS version 3.06.25 and 3.07.09
v1:
 - Initial version
---

Khuong Dinh (2):
  PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
  PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot

 drivers/acpi/Makefile            |    2 +-
 drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpi_platform.c     |    3 +-
 drivers/acpi/internal.h          |    1 +
 drivers/acpi/scan.c              |    1 +
 drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
 include/linux/acpi_msi.h         |   37 ++++++++++++++++
 7 files changed, 183 insertions(+), 7 deletions(-)
 create mode 100644 drivers/acpi/acpi_msi.c
 create mode 100644 include/linux/acpi_msi.h

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

* [PATCH v4 pci 1/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
  2017-09-26 17:49 ` Khuong Dinh
  (?)
@ 2017-09-26 17:49   ` Khuong Dinh
  -1 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-09-26 17:49 UTC (permalink / raw)
  To: lorenzo.pieralisi, marc.zyngier, msalter, bhelgaas, linux-pci, jcm
  Cc: patches, linux-kernel, linux-arm-kernel, rjw, Khuong Dinh

This patch makes pci-xgene-msi driver ACPI-aware and provides
MSI capability for X-Gene v1 PCIe controllers in ACPI boot mode.

Signed-off-by: Khuong Dinh <kdinh@apm.com>
        [Take over from Duc Dang]
---
 drivers/pci/host/pci-xgene-msi.c |   38 +++++++++++++++++++++++++++++++++++---
 1 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pci-xgene-msi.c b/drivers/pci/host/pci-xgene-msi.c
index 1f42a20..d657248 100644
--- a/drivers/pci/host/pci-xgene-msi.c
+++ b/drivers/pci/host/pci-xgene-msi.c
@@ -4,6 +4,7 @@
  * Copyright (c) 2014, Applied Micro Circuits Corporation
  * Author: Tanmay Inamdar <tinamdar@apm.com>
  *	   Duc Dang <dhdang@apm.com>
+ *	   Khuong Dinh <kdinh@apm.com>
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -24,6 +25,7 @@
 #include <linux/pci.h>
 #include <linux/platform_device.h>
 #include <linux/of_pci.h>
+#include <linux/acpi.h>
 
 #define MSI_IR0			0x000000
 #define MSI_INT0		0x800000
@@ -39,7 +41,7 @@ struct xgene_msi_group {
 };
 
 struct xgene_msi {
-	struct device_node	*node;
+	struct fwnode_handle	*fwnode;
 	struct irq_domain	*inner_domain;
 	struct irq_domain	*msi_domain;
 	u64			msi_addr;
@@ -249,6 +251,13 @@ static void xgene_irq_domain_free(struct irq_domain *domain,
 	.free   = xgene_irq_domain_free,
 };
 
+#ifdef CONFIG_ACPI
+static struct fwnode_handle *xgene_msi_get_fwnode(struct device *dev)
+{
+	return xgene_msi_ctrl.fwnode;
+}
+#endif
+
 static int xgene_allocate_domains(struct xgene_msi *msi)
 {
 	msi->inner_domain = irq_domain_add_linear(NULL, NR_MSI_VEC,
@@ -256,7 +265,7 @@ static int xgene_allocate_domains(struct xgene_msi *msi)
 	if (!msi->inner_domain)
 		return -ENOMEM;
 
-	msi->msi_domain = pci_msi_create_irq_domain(of_node_to_fwnode(msi->node),
+	msi->msi_domain = pci_msi_create_irq_domain(msi->fwnode,
 						    &xgene_msi_domain_info,
 						    msi->inner_domain);
 
@@ -265,6 +274,9 @@ static int xgene_allocate_domains(struct xgene_msi *msi)
 		return -ENOMEM;
 	}
 
+#ifdef CONFIG_ACPI
+	pci_msi_register_fwnode_provider(&xgene_msi_get_fwnode);
+#endif
 	return 0;
 }
 
@@ -449,6 +461,14 @@ static int xgene_msi_hwirq_free(unsigned int cpu)
 	{},
 };
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id xgene_msi_acpi_ids[] = {
+	{"APMC0D0E", 0},
+	{ },
+};
+MODULE_DEVICE_TABLE(acpi, xgene_msi_acpi_ids);
+#endif
+
 static int xgene_msi_probe(struct platform_device *pdev)
 {
 	struct resource *res;
@@ -469,7 +489,18 @@ static int xgene_msi_probe(struct platform_device *pdev)
 		goto error;
 	}
 	xgene_msi->msi_addr = res->start;
-	xgene_msi->node = pdev->dev.of_node;
+
+	xgene_msi->fwnode = of_node_to_fwnode(pdev->dev.of_node);
+	if (!xgene_msi->fwnode) {
+		xgene_msi->fwnode =
+			irq_domain_alloc_fwnode((void *)xgene_msi->msi_addr);
+		if (!xgene_msi->fwnode) {
+			dev_err(&pdev->dev, "Failed to create fwnode\n");
+			rc = ENOMEM;
+			goto error;
+		}
+	}
+
 	xgene_msi->num_cpus = num_possible_cpus();
 
 	rc = xgene_msi_init_allocator(xgene_msi);
@@ -540,6 +571,7 @@ static int xgene_msi_probe(struct platform_device *pdev)
 	.driver = {
 		.name = "xgene-msi",
 		.of_match_table = xgene_msi_match_table,
+		.acpi_match_table = ACPI_PTR(xgene_msi_acpi_ids),
 	},
 	.probe = xgene_msi_probe,
 	.remove = xgene_msi_remove,
-- 
1.7.1

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

* [PATCH v4 pci 1/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-09-26 17:49   ` Khuong Dinh
  0 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-09-26 17:49 UTC (permalink / raw)
  To: lorenzo.pieralisi, marc.zyngier, msalter, bhelgaas, linux-pci, jcm
  Cc: rjw, Khuong Dinh, patches, linux-kernel, linux-arm-kernel

This patch makes pci-xgene-msi driver ACPI-aware and provides
MSI capability for X-Gene v1 PCIe controllers in ACPI boot mode.

Signed-off-by: Khuong Dinh <kdinh@apm.com>
        [Take over from Duc Dang]
---
 drivers/pci/host/pci-xgene-msi.c |   38 +++++++++++++++++++++++++++++++++++---
 1 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pci-xgene-msi.c b/drivers/pci/host/pci-xgene-msi.c
index 1f42a20..d657248 100644
--- a/drivers/pci/host/pci-xgene-msi.c
+++ b/drivers/pci/host/pci-xgene-msi.c
@@ -4,6 +4,7 @@
  * Copyright (c) 2014, Applied Micro Circuits Corporation
  * Author: Tanmay Inamdar <tinamdar@apm.com>
  *	   Duc Dang <dhdang@apm.com>
+ *	   Khuong Dinh <kdinh@apm.com>
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -24,6 +25,7 @@
 #include <linux/pci.h>
 #include <linux/platform_device.h>
 #include <linux/of_pci.h>
+#include <linux/acpi.h>
 
 #define MSI_IR0			0x000000
 #define MSI_INT0		0x800000
@@ -39,7 +41,7 @@ struct xgene_msi_group {
 };
 
 struct xgene_msi {
-	struct device_node	*node;
+	struct fwnode_handle	*fwnode;
 	struct irq_domain	*inner_domain;
 	struct irq_domain	*msi_domain;
 	u64			msi_addr;
@@ -249,6 +251,13 @@ static void xgene_irq_domain_free(struct irq_domain *domain,
 	.free   = xgene_irq_domain_free,
 };
 
+#ifdef CONFIG_ACPI
+static struct fwnode_handle *xgene_msi_get_fwnode(struct device *dev)
+{
+	return xgene_msi_ctrl.fwnode;
+}
+#endif
+
 static int xgene_allocate_domains(struct xgene_msi *msi)
 {
 	msi->inner_domain = irq_domain_add_linear(NULL, NR_MSI_VEC,
@@ -256,7 +265,7 @@ static int xgene_allocate_domains(struct xgene_msi *msi)
 	if (!msi->inner_domain)
 		return -ENOMEM;
 
-	msi->msi_domain = pci_msi_create_irq_domain(of_node_to_fwnode(msi->node),
+	msi->msi_domain = pci_msi_create_irq_domain(msi->fwnode,
 						    &xgene_msi_domain_info,
 						    msi->inner_domain);
 
@@ -265,6 +274,9 @@ static int xgene_allocate_domains(struct xgene_msi *msi)
 		return -ENOMEM;
 	}
 
+#ifdef CONFIG_ACPI
+	pci_msi_register_fwnode_provider(&xgene_msi_get_fwnode);
+#endif
 	return 0;
 }
 
@@ -449,6 +461,14 @@ static int xgene_msi_hwirq_free(unsigned int cpu)
 	{},
 };
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id xgene_msi_acpi_ids[] = {
+	{"APMC0D0E", 0},
+	{ },
+};
+MODULE_DEVICE_TABLE(acpi, xgene_msi_acpi_ids);
+#endif
+
 static int xgene_msi_probe(struct platform_device *pdev)
 {
 	struct resource *res;
@@ -469,7 +489,18 @@ static int xgene_msi_probe(struct platform_device *pdev)
 		goto error;
 	}
 	xgene_msi->msi_addr = res->start;
-	xgene_msi->node = pdev->dev.of_node;
+
+	xgene_msi->fwnode = of_node_to_fwnode(pdev->dev.of_node);
+	if (!xgene_msi->fwnode) {
+		xgene_msi->fwnode =
+			irq_domain_alloc_fwnode((void *)xgene_msi->msi_addr);
+		if (!xgene_msi->fwnode) {
+			dev_err(&pdev->dev, "Failed to create fwnode\n");
+			rc = ENOMEM;
+			goto error;
+		}
+	}
+
 	xgene_msi->num_cpus = num_possible_cpus();
 
 	rc = xgene_msi_init_allocator(xgene_msi);
@@ -540,6 +571,7 @@ static int xgene_msi_probe(struct platform_device *pdev)
 	.driver = {
 		.name = "xgene-msi",
 		.of_match_table = xgene_msi_match_table,
+		.acpi_match_table = ACPI_PTR(xgene_msi_acpi_ids),
 	},
 	.probe = xgene_msi_probe,
 	.remove = xgene_msi_remove,
-- 
1.7.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v4 pci 1/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-09-26 17:49   ` Khuong Dinh
  0 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-09-26 17:49 UTC (permalink / raw)
  To: linux-arm-kernel

This patch makes pci-xgene-msi driver ACPI-aware and provides
MSI capability for X-Gene v1 PCIe controllers in ACPI boot mode.

Signed-off-by: Khuong Dinh <kdinh@apm.com>
        [Take over from Duc Dang]
---
 drivers/pci/host/pci-xgene-msi.c |   38 +++++++++++++++++++++++++++++++++++---
 1 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pci-xgene-msi.c b/drivers/pci/host/pci-xgene-msi.c
index 1f42a20..d657248 100644
--- a/drivers/pci/host/pci-xgene-msi.c
+++ b/drivers/pci/host/pci-xgene-msi.c
@@ -4,6 +4,7 @@
  * Copyright (c) 2014, Applied Micro Circuits Corporation
  * Author: Tanmay Inamdar <tinamdar@apm.com>
  *	   Duc Dang <dhdang@apm.com>
+ *	   Khuong Dinh <kdinh@apm.com>
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -24,6 +25,7 @@
 #include <linux/pci.h>
 #include <linux/platform_device.h>
 #include <linux/of_pci.h>
+#include <linux/acpi.h>
 
 #define MSI_IR0			0x000000
 #define MSI_INT0		0x800000
@@ -39,7 +41,7 @@ struct xgene_msi_group {
 };
 
 struct xgene_msi {
-	struct device_node	*node;
+	struct fwnode_handle	*fwnode;
 	struct irq_domain	*inner_domain;
 	struct irq_domain	*msi_domain;
 	u64			msi_addr;
@@ -249,6 +251,13 @@ static void xgene_irq_domain_free(struct irq_domain *domain,
 	.free   = xgene_irq_domain_free,
 };
 
+#ifdef CONFIG_ACPI
+static struct fwnode_handle *xgene_msi_get_fwnode(struct device *dev)
+{
+	return xgene_msi_ctrl.fwnode;
+}
+#endif
+
 static int xgene_allocate_domains(struct xgene_msi *msi)
 {
 	msi->inner_domain = irq_domain_add_linear(NULL, NR_MSI_VEC,
@@ -256,7 +265,7 @@ static int xgene_allocate_domains(struct xgene_msi *msi)
 	if (!msi->inner_domain)
 		return -ENOMEM;
 
-	msi->msi_domain = pci_msi_create_irq_domain(of_node_to_fwnode(msi->node),
+	msi->msi_domain = pci_msi_create_irq_domain(msi->fwnode,
 						    &xgene_msi_domain_info,
 						    msi->inner_domain);
 
@@ -265,6 +274,9 @@ static int xgene_allocate_domains(struct xgene_msi *msi)
 		return -ENOMEM;
 	}
 
+#ifdef CONFIG_ACPI
+	pci_msi_register_fwnode_provider(&xgene_msi_get_fwnode);
+#endif
 	return 0;
 }
 
@@ -449,6 +461,14 @@ static int xgene_msi_hwirq_free(unsigned int cpu)
 	{},
 };
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id xgene_msi_acpi_ids[] = {
+	{"APMC0D0E", 0},
+	{ },
+};
+MODULE_DEVICE_TABLE(acpi, xgene_msi_acpi_ids);
+#endif
+
 static int xgene_msi_probe(struct platform_device *pdev)
 {
 	struct resource *res;
@@ -469,7 +489,18 @@ static int xgene_msi_probe(struct platform_device *pdev)
 		goto error;
 	}
 	xgene_msi->msi_addr = res->start;
-	xgene_msi->node = pdev->dev.of_node;
+
+	xgene_msi->fwnode = of_node_to_fwnode(pdev->dev.of_node);
+	if (!xgene_msi->fwnode) {
+		xgene_msi->fwnode =
+			irq_domain_alloc_fwnode((void *)xgene_msi->msi_addr);
+		if (!xgene_msi->fwnode) {
+			dev_err(&pdev->dev, "Failed to create fwnode\n");
+			rc = ENOMEM;
+			goto error;
+		}
+	}
+
 	xgene_msi->num_cpus = num_possible_cpus();
 
 	rc = xgene_msi_init_allocator(xgene_msi);
@@ -540,6 +571,7 @@ static int xgene_msi_probe(struct platform_device *pdev)
 	.driver = {
 		.name = "xgene-msi",
 		.of_match_table = xgene_msi_match_table,
+		.acpi_match_table = ACPI_PTR(xgene_msi_acpi_ids),
 	},
 	.probe = xgene_msi_probe,
 	.remove = xgene_msi_remove,
-- 
1.7.1

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

* [PATCH v4 pci 2/2] PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
  2017-09-26 17:49 ` Khuong Dinh
  (?)
@ 2017-09-26 17:49   ` Khuong Dinh
  -1 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-09-26 17:49 UTC (permalink / raw)
  To: lorenzo.pieralisi, marc.zyngier, msalter, bhelgaas, linux-pci, jcm
  Cc: patches, linux-kernel, linux-arm-kernel, rjw, Khuong Dinh

This patch enforces MSI driver loaded before PCIe controller driver
in ACPI boot mode.

Signed-off-by: Khuong Dinh <kdinh@apm.com>
---
 drivers/acpi/Makefile            |    2 +-
 drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpi_platform.c     |    3 +-
 drivers/acpi/internal.h          |    1 +
 drivers/acpi/scan.c              |    1 +
 drivers/pci/host/pci-xgene-msi.c |   22 +++++++++-
 include/linux/acpi_msi.h         |   37 ++++++++++++++++
 7 files changed, 148 insertions(+), 4 deletions(-)
 create mode 100644 drivers/acpi/acpi_msi.c
 create mode 100644 include/linux/acpi_msi.h

diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index 90265ab..b33247e 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -40,7 +40,7 @@ acpi-y				+= ec.o
 acpi-$(CONFIG_ACPI_DOCK)	+= dock.o
 acpi-y				+= pci_root.o pci_link.o pci_irq.o
 obj-$(CONFIG_ACPI_MCFG)		+= pci_mcfg.o
-acpi-y				+= acpi_lpss.o acpi_apd.o
+acpi-y				+= acpi_lpss.o acpi_apd.o acpi_msi.o
 acpi-y				+= acpi_platform.o
 acpi-y				+= acpi_pnp.o
 acpi-$(CONFIG_ARM_AMBA)	+= acpi_amba.o
diff --git a/drivers/acpi/acpi_msi.c b/drivers/acpi/acpi_msi.c
new file mode 100644
index 0000000..a254e84
--- /dev/null
+++ b/drivers/acpi/acpi_msi.c
@@ -0,0 +1,86 @@
+/*
+ * Enforce MSI driver loaded before PCIe controller driver
+ *
+ * Copyright (c) 2017, MACOM Technology Solutions Corporation
+ * Author: Khuong Dinh <kdinh@apm.com>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/acpi.h>
+#include "internal.h"
+#include <linux/acpi_msi.h>
+
+struct msi_driver_item {
+	struct list_head msi_drv_list;
+	struct platform_driver *addr;
+	unsigned char id[ACPI_ID_LEN];
+};
+
+static LIST_HEAD(msi_drv_list);
+
+static acpi_status acpi_create_msi_device(acpi_handle handle, u32 Level,
+					void *context, void **retval)
+{
+	acpi_status status = AE_OK;
+	int result;
+
+	acpi_scan_lock_acquire();
+	result = acpi_bus_scan(handle);
+	acpi_scan_lock_release();
+	if (result) {
+		status = AE_ERROR;
+		goto out;
+	}
+	result = platform_driver_register((struct platform_driver *) context);
+	if (result) {
+		status = AE_ERROR;
+		goto out;
+	}
+out:
+	return status;
+}
+
+void __init acpi_msi_init(void)
+{
+	struct msi_driver_item *current_msi;
+	struct list_head *pos;
+
+	list_for_each(pos, &msi_drv_list) {
+		current_msi = list_entry(pos, struct msi_driver_item,
+					msi_drv_list);
+		if (!current_msi)
+			return;
+
+		acpi_get_devices(current_msi->id,
+			acpi_create_msi_device,
+			(void *) current_msi->addr,
+			NULL);
+	}
+}
+
+void acpi_msi_drv_subscribe(struct acpi_device_id msi_acpi_ids,
+					struct platform_driver *msi)
+{
+	struct msi_driver_item *new_msi;
+
+	if (!msi)
+		return;
+
+	new_msi = kmalloc(sizeof(*new_msi), GFP_KERNEL);
+	if (!new_msi)
+		return;
+
+	list_add(&(new_msi->msi_drv_list), &msi_drv_list);
+	new_msi->addr = msi;
+	strncpy(new_msi->id, msi_acpi_ids.id, sizeof(new_msi->id));
+	new_msi->id[sizeof(new_msi->id) - 1] = '\0';
+}
diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
index 88cd949..a546076 100644
--- a/drivers/acpi/acpi_platform.c
+++ b/drivers/acpi/acpi_platform.c
@@ -44,7 +44,8 @@ static void acpi_platform_fill_resource(struct acpi_device *adev,
 	 * If the device has parent we need to take its resources into
 	 * account as well because this device might consume part of those.
 	 */
-	parent = acpi_get_first_physical_node(adev->parent);
+	parent = adev->parent ?
+			acpi_get_first_physical_node(adev->parent) : NULL;
 	if (parent && dev_is_pci(parent))
 		dest->parent = pci_find_resource(to_pci_dev(parent), dest);
 }
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index 4361c44..ec81801 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -80,6 +80,7 @@ int acpi_scan_add_handler_with_hotplug(struct acpi_scan_handler *handler,
 void acpi_lpss_init(void);
 
 void acpi_apd_init(void);
+void acpi_msi_init(void);
 
 acpi_status acpi_hotplug_schedule(struct acpi_device *adev, u32 src);
 bool acpi_queue_hotplug_work(struct work_struct *work);
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 602f8ff..f1d7b96 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -2110,6 +2110,7 @@ int __init acpi_scan_init(void)
 	acpi_status status;
 	struct acpi_table_stao *stao_ptr;
 
+	acpi_msi_init();
 	acpi_pci_root_init();
 	acpi_pci_link_init();
 	acpi_processor_init();
diff --git a/drivers/pci/host/pci-xgene-msi.c b/drivers/pci/host/pci-xgene-msi.c
index d657248..327e663 100644
--- a/drivers/pci/host/pci-xgene-msi.c
+++ b/drivers/pci/host/pci-xgene-msi.c
@@ -26,6 +26,7 @@
 #include <linux/platform_device.h>
 #include <linux/of_pci.h>
 #include <linux/acpi.h>
+#include <linux/acpi_msi.h>
 
 #define MSI_IR0			0x000000
 #define MSI_INT0		0x800000
@@ -577,8 +578,25 @@ static int xgene_msi_probe(struct platform_device *pdev)
 	.remove = xgene_msi_remove,
 };
 
-static int __init xgene_pcie_msi_init(void)
+static int __init xgene_pcie_msi_subscribe(void)
 {
+	int i;
+
+	for (i = 0; i < sizeof(xgene_msi_acpi_ids)
+			/ sizeof(xgene_msi_acpi_ids[0]) - 1; i++)
+		acpi_msi_drv_subscribe(xgene_msi_acpi_ids[i],
+						&xgene_msi_driver);
+	return 0;
+}
+
+static int __init xgene_pcie_msi_register(void)
+{
+	if (driver_find(xgene_msi_driver.driver.name, &platform_bus_type))
+		return -EBUSY;
+
 	return platform_driver_register(&xgene_msi_driver);
 }
-subsys_initcall(xgene_pcie_msi_init);
+
+pure_initcall(xgene_pcie_msi_subscribe);
+
+module_init(xgene_pcie_msi_register);
diff --git a/include/linux/acpi_msi.h b/include/linux/acpi_msi.h
new file mode 100644
index 0000000..f132416
--- /dev/null
+++ b/include/linux/acpi_msi.h
@@ -0,0 +1,37 @@
+/*
+ * Enforce MSI driver loaded before PCIe controller driver library
+ *
+ * Copyright (c) 2017, MACOM Technology Solutions Corporation
+ * Author: Khuong Dinh <kdinh@apm.com>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ACPI_MSI_H__
+#define __ACPI_MSI_H__
+
+#include <linux/platform_device.h>
+
+/**
+ * acpi_msi_drv_subscribe - Allow MSI drivers to subscribe its driver
+ * information (acpi device id and platform driver address) such that
+ * the ACPI driver layer probes its first before the controller
+ * enumerated. This enforce that the MSI driver is always probed
+ * before the PCIe controller driver.
+ *
+ * @msi_acpi_ids: The MSI ACPI devive.
+ * @msi: The MSI platform driver.
+ *
+ */
+void acpi_msi_drv_subscribe(struct acpi_device_id msi_acpi_ids,
+					struct platform_driver *msi);
+
+#endif				/* __ACPI_MSI_H__ */
-- 
1.7.1

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

* [PATCH v4 pci 2/2] PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
@ 2017-09-26 17:49   ` Khuong Dinh
  0 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-09-26 17:49 UTC (permalink / raw)
  To: lorenzo.pieralisi, marc.zyngier, msalter, bhelgaas, linux-pci, jcm
  Cc: rjw, Khuong Dinh, patches, linux-kernel, linux-arm-kernel

This patch enforces MSI driver loaded before PCIe controller driver
in ACPI boot mode.

Signed-off-by: Khuong Dinh <kdinh@apm.com>
---
 drivers/acpi/Makefile            |    2 +-
 drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpi_platform.c     |    3 +-
 drivers/acpi/internal.h          |    1 +
 drivers/acpi/scan.c              |    1 +
 drivers/pci/host/pci-xgene-msi.c |   22 +++++++++-
 include/linux/acpi_msi.h         |   37 ++++++++++++++++
 7 files changed, 148 insertions(+), 4 deletions(-)
 create mode 100644 drivers/acpi/acpi_msi.c
 create mode 100644 include/linux/acpi_msi.h

diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index 90265ab..b33247e 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -40,7 +40,7 @@ acpi-y				+= ec.o
 acpi-$(CONFIG_ACPI_DOCK)	+= dock.o
 acpi-y				+= pci_root.o pci_link.o pci_irq.o
 obj-$(CONFIG_ACPI_MCFG)		+= pci_mcfg.o
-acpi-y				+= acpi_lpss.o acpi_apd.o
+acpi-y				+= acpi_lpss.o acpi_apd.o acpi_msi.o
 acpi-y				+= acpi_platform.o
 acpi-y				+= acpi_pnp.o
 acpi-$(CONFIG_ARM_AMBA)	+= acpi_amba.o
diff --git a/drivers/acpi/acpi_msi.c b/drivers/acpi/acpi_msi.c
new file mode 100644
index 0000000..a254e84
--- /dev/null
+++ b/drivers/acpi/acpi_msi.c
@@ -0,0 +1,86 @@
+/*
+ * Enforce MSI driver loaded before PCIe controller driver
+ *
+ * Copyright (c) 2017, MACOM Technology Solutions Corporation
+ * Author: Khuong Dinh <kdinh@apm.com>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/acpi.h>
+#include "internal.h"
+#include <linux/acpi_msi.h>
+
+struct msi_driver_item {
+	struct list_head msi_drv_list;
+	struct platform_driver *addr;
+	unsigned char id[ACPI_ID_LEN];
+};
+
+static LIST_HEAD(msi_drv_list);
+
+static acpi_status acpi_create_msi_device(acpi_handle handle, u32 Level,
+					void *context, void **retval)
+{
+	acpi_status status = AE_OK;
+	int result;
+
+	acpi_scan_lock_acquire();
+	result = acpi_bus_scan(handle);
+	acpi_scan_lock_release();
+	if (result) {
+		status = AE_ERROR;
+		goto out;
+	}
+	result = platform_driver_register((struct platform_driver *) context);
+	if (result) {
+		status = AE_ERROR;
+		goto out;
+	}
+out:
+	return status;
+}
+
+void __init acpi_msi_init(void)
+{
+	struct msi_driver_item *current_msi;
+	struct list_head *pos;
+
+	list_for_each(pos, &msi_drv_list) {
+		current_msi = list_entry(pos, struct msi_driver_item,
+					msi_drv_list);
+		if (!current_msi)
+			return;
+
+		acpi_get_devices(current_msi->id,
+			acpi_create_msi_device,
+			(void *) current_msi->addr,
+			NULL);
+	}
+}
+
+void acpi_msi_drv_subscribe(struct acpi_device_id msi_acpi_ids,
+					struct platform_driver *msi)
+{
+	struct msi_driver_item *new_msi;
+
+	if (!msi)
+		return;
+
+	new_msi = kmalloc(sizeof(*new_msi), GFP_KERNEL);
+	if (!new_msi)
+		return;
+
+	list_add(&(new_msi->msi_drv_list), &msi_drv_list);
+	new_msi->addr = msi;
+	strncpy(new_msi->id, msi_acpi_ids.id, sizeof(new_msi->id));
+	new_msi->id[sizeof(new_msi->id) - 1] = '\0';
+}
diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
index 88cd949..a546076 100644
--- a/drivers/acpi/acpi_platform.c
+++ b/drivers/acpi/acpi_platform.c
@@ -44,7 +44,8 @@ static void acpi_platform_fill_resource(struct acpi_device *adev,
 	 * If the device has parent we need to take its resources into
 	 * account as well because this device might consume part of those.
 	 */
-	parent = acpi_get_first_physical_node(adev->parent);
+	parent = adev->parent ?
+			acpi_get_first_physical_node(adev->parent) : NULL;
 	if (parent && dev_is_pci(parent))
 		dest->parent = pci_find_resource(to_pci_dev(parent), dest);
 }
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index 4361c44..ec81801 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -80,6 +80,7 @@ int acpi_scan_add_handler_with_hotplug(struct acpi_scan_handler *handler,
 void acpi_lpss_init(void);
 
 void acpi_apd_init(void);
+void acpi_msi_init(void);
 
 acpi_status acpi_hotplug_schedule(struct acpi_device *adev, u32 src);
 bool acpi_queue_hotplug_work(struct work_struct *work);
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 602f8ff..f1d7b96 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -2110,6 +2110,7 @@ int __init acpi_scan_init(void)
 	acpi_status status;
 	struct acpi_table_stao *stao_ptr;
 
+	acpi_msi_init();
 	acpi_pci_root_init();
 	acpi_pci_link_init();
 	acpi_processor_init();
diff --git a/drivers/pci/host/pci-xgene-msi.c b/drivers/pci/host/pci-xgene-msi.c
index d657248..327e663 100644
--- a/drivers/pci/host/pci-xgene-msi.c
+++ b/drivers/pci/host/pci-xgene-msi.c
@@ -26,6 +26,7 @@
 #include <linux/platform_device.h>
 #include <linux/of_pci.h>
 #include <linux/acpi.h>
+#include <linux/acpi_msi.h>
 
 #define MSI_IR0			0x000000
 #define MSI_INT0		0x800000
@@ -577,8 +578,25 @@ static int xgene_msi_probe(struct platform_device *pdev)
 	.remove = xgene_msi_remove,
 };
 
-static int __init xgene_pcie_msi_init(void)
+static int __init xgene_pcie_msi_subscribe(void)
 {
+	int i;
+
+	for (i = 0; i < sizeof(xgene_msi_acpi_ids)
+			/ sizeof(xgene_msi_acpi_ids[0]) - 1; i++)
+		acpi_msi_drv_subscribe(xgene_msi_acpi_ids[i],
+						&xgene_msi_driver);
+	return 0;
+}
+
+static int __init xgene_pcie_msi_register(void)
+{
+	if (driver_find(xgene_msi_driver.driver.name, &platform_bus_type))
+		return -EBUSY;
+
 	return platform_driver_register(&xgene_msi_driver);
 }
-subsys_initcall(xgene_pcie_msi_init);
+
+pure_initcall(xgene_pcie_msi_subscribe);
+
+module_init(xgene_pcie_msi_register);
diff --git a/include/linux/acpi_msi.h b/include/linux/acpi_msi.h
new file mode 100644
index 0000000..f132416
--- /dev/null
+++ b/include/linux/acpi_msi.h
@@ -0,0 +1,37 @@
+/*
+ * Enforce MSI driver loaded before PCIe controller driver library
+ *
+ * Copyright (c) 2017, MACOM Technology Solutions Corporation
+ * Author: Khuong Dinh <kdinh@apm.com>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ACPI_MSI_H__
+#define __ACPI_MSI_H__
+
+#include <linux/platform_device.h>
+
+/**
+ * acpi_msi_drv_subscribe - Allow MSI drivers to subscribe its driver
+ * information (acpi device id and platform driver address) such that
+ * the ACPI driver layer probes its first before the controller
+ * enumerated. This enforce that the MSI driver is always probed
+ * before the PCIe controller driver.
+ *
+ * @msi_acpi_ids: The MSI ACPI devive.
+ * @msi: The MSI platform driver.
+ *
+ */
+void acpi_msi_drv_subscribe(struct acpi_device_id msi_acpi_ids,
+					struct platform_driver *msi);
+
+#endif				/* __ACPI_MSI_H__ */
-- 
1.7.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v4 pci 2/2] PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
@ 2017-09-26 17:49   ` Khuong Dinh
  0 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-09-26 17:49 UTC (permalink / raw)
  To: linux-arm-kernel

This patch enforces MSI driver loaded before PCIe controller driver
in ACPI boot mode.

Signed-off-by: Khuong Dinh <kdinh@apm.com>
---
 drivers/acpi/Makefile            |    2 +-
 drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpi_platform.c     |    3 +-
 drivers/acpi/internal.h          |    1 +
 drivers/acpi/scan.c              |    1 +
 drivers/pci/host/pci-xgene-msi.c |   22 +++++++++-
 include/linux/acpi_msi.h         |   37 ++++++++++++++++
 7 files changed, 148 insertions(+), 4 deletions(-)
 create mode 100644 drivers/acpi/acpi_msi.c
 create mode 100644 include/linux/acpi_msi.h

diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index 90265ab..b33247e 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -40,7 +40,7 @@ acpi-y				+= ec.o
 acpi-$(CONFIG_ACPI_DOCK)	+= dock.o
 acpi-y				+= pci_root.o pci_link.o pci_irq.o
 obj-$(CONFIG_ACPI_MCFG)		+= pci_mcfg.o
-acpi-y				+= acpi_lpss.o acpi_apd.o
+acpi-y				+= acpi_lpss.o acpi_apd.o acpi_msi.o
 acpi-y				+= acpi_platform.o
 acpi-y				+= acpi_pnp.o
 acpi-$(CONFIG_ARM_AMBA)	+= acpi_amba.o
diff --git a/drivers/acpi/acpi_msi.c b/drivers/acpi/acpi_msi.c
new file mode 100644
index 0000000..a254e84
--- /dev/null
+++ b/drivers/acpi/acpi_msi.c
@@ -0,0 +1,86 @@
+/*
+ * Enforce MSI driver loaded before PCIe controller driver
+ *
+ * Copyright (c) 2017, MACOM Technology Solutions Corporation
+ * Author: Khuong Dinh <kdinh@apm.com>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/acpi.h>
+#include "internal.h"
+#include <linux/acpi_msi.h>
+
+struct msi_driver_item {
+	struct list_head msi_drv_list;
+	struct platform_driver *addr;
+	unsigned char id[ACPI_ID_LEN];
+};
+
+static LIST_HEAD(msi_drv_list);
+
+static acpi_status acpi_create_msi_device(acpi_handle handle, u32 Level,
+					void *context, void **retval)
+{
+	acpi_status status = AE_OK;
+	int result;
+
+	acpi_scan_lock_acquire();
+	result = acpi_bus_scan(handle);
+	acpi_scan_lock_release();
+	if (result) {
+		status = AE_ERROR;
+		goto out;
+	}
+	result = platform_driver_register((struct platform_driver *) context);
+	if (result) {
+		status = AE_ERROR;
+		goto out;
+	}
+out:
+	return status;
+}
+
+void __init acpi_msi_init(void)
+{
+	struct msi_driver_item *current_msi;
+	struct list_head *pos;
+
+	list_for_each(pos, &msi_drv_list) {
+		current_msi = list_entry(pos, struct msi_driver_item,
+					msi_drv_list);
+		if (!current_msi)
+			return;
+
+		acpi_get_devices(current_msi->id,
+			acpi_create_msi_device,
+			(void *) current_msi->addr,
+			NULL);
+	}
+}
+
+void acpi_msi_drv_subscribe(struct acpi_device_id msi_acpi_ids,
+					struct platform_driver *msi)
+{
+	struct msi_driver_item *new_msi;
+
+	if (!msi)
+		return;
+
+	new_msi = kmalloc(sizeof(*new_msi), GFP_KERNEL);
+	if (!new_msi)
+		return;
+
+	list_add(&(new_msi->msi_drv_list), &msi_drv_list);
+	new_msi->addr = msi;
+	strncpy(new_msi->id, msi_acpi_ids.id, sizeof(new_msi->id));
+	new_msi->id[sizeof(new_msi->id) - 1] = '\0';
+}
diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
index 88cd949..a546076 100644
--- a/drivers/acpi/acpi_platform.c
+++ b/drivers/acpi/acpi_platform.c
@@ -44,7 +44,8 @@ static void acpi_platform_fill_resource(struct acpi_device *adev,
 	 * If the device has parent we need to take its resources into
 	 * account as well because this device might consume part of those.
 	 */
-	parent = acpi_get_first_physical_node(adev->parent);
+	parent = adev->parent ?
+			acpi_get_first_physical_node(adev->parent) : NULL;
 	if (parent && dev_is_pci(parent))
 		dest->parent = pci_find_resource(to_pci_dev(parent), dest);
 }
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index 4361c44..ec81801 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -80,6 +80,7 @@ int acpi_scan_add_handler_with_hotplug(struct acpi_scan_handler *handler,
 void acpi_lpss_init(void);
 
 void acpi_apd_init(void);
+void acpi_msi_init(void);
 
 acpi_status acpi_hotplug_schedule(struct acpi_device *adev, u32 src);
 bool acpi_queue_hotplug_work(struct work_struct *work);
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 602f8ff..f1d7b96 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -2110,6 +2110,7 @@ int __init acpi_scan_init(void)
 	acpi_status status;
 	struct acpi_table_stao *stao_ptr;
 
+	acpi_msi_init();
 	acpi_pci_root_init();
 	acpi_pci_link_init();
 	acpi_processor_init();
diff --git a/drivers/pci/host/pci-xgene-msi.c b/drivers/pci/host/pci-xgene-msi.c
index d657248..327e663 100644
--- a/drivers/pci/host/pci-xgene-msi.c
+++ b/drivers/pci/host/pci-xgene-msi.c
@@ -26,6 +26,7 @@
 #include <linux/platform_device.h>
 #include <linux/of_pci.h>
 #include <linux/acpi.h>
+#include <linux/acpi_msi.h>
 
 #define MSI_IR0			0x000000
 #define MSI_INT0		0x800000
@@ -577,8 +578,25 @@ static int xgene_msi_probe(struct platform_device *pdev)
 	.remove = xgene_msi_remove,
 };
 
-static int __init xgene_pcie_msi_init(void)
+static int __init xgene_pcie_msi_subscribe(void)
 {
+	int i;
+
+	for (i = 0; i < sizeof(xgene_msi_acpi_ids)
+			/ sizeof(xgene_msi_acpi_ids[0]) - 1; i++)
+		acpi_msi_drv_subscribe(xgene_msi_acpi_ids[i],
+						&xgene_msi_driver);
+	return 0;
+}
+
+static int __init xgene_pcie_msi_register(void)
+{
+	if (driver_find(xgene_msi_driver.driver.name, &platform_bus_type))
+		return -EBUSY;
+
 	return platform_driver_register(&xgene_msi_driver);
 }
-subsys_initcall(xgene_pcie_msi_init);
+
+pure_initcall(xgene_pcie_msi_subscribe);
+
+module_init(xgene_pcie_msi_register);
diff --git a/include/linux/acpi_msi.h b/include/linux/acpi_msi.h
new file mode 100644
index 0000000..f132416
--- /dev/null
+++ b/include/linux/acpi_msi.h
@@ -0,0 +1,37 @@
+/*
+ * Enforce MSI driver loaded before PCIe controller driver library
+ *
+ * Copyright (c) 2017, MACOM Technology Solutions Corporation
+ * Author: Khuong Dinh <kdinh@apm.com>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ACPI_MSI_H__
+#define __ACPI_MSI_H__
+
+#include <linux/platform_device.h>
+
+/**
+ * acpi_msi_drv_subscribe - Allow MSI drivers to subscribe its driver
+ * information (acpi device id and platform driver address) such that
+ * the ACPI driver layer probes its first before the controller
+ * enumerated. This enforce that the MSI driver is always probed
+ * before the PCIe controller driver.
+ *
+ * @msi_acpi_ids: The MSI ACPI devive.
+ * @msi: The MSI platform driver.
+ *
+ */
+void acpi_msi_drv_subscribe(struct acpi_device_id msi_acpi_ids,
+					struct platform_driver *msi);
+
+#endif				/* __ACPI_MSI_H__ */
-- 
1.7.1

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

* Re: [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
  2017-09-26 17:49 ` Khuong Dinh
  (?)
@ 2017-10-16 21:19   ` Khuong Dinh
  -1 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-10-16 21:19 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Marc Zyngier, msalter, Bjorn Helgaas, linux-pci, jcm
  Cc: patches, linux-kernel, linux-arm-kernel, rjw, Khuong Dinh

Hi Lorenzo,
  Do you have any comments for this patch?

Best regards,
Khuong Dinh

On Tue, Sep 26, 2017 at 10:49 AM, Khuong Dinh <kdinh@apm.com> wrote:
> This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
> and provides the proper MSI driver initialization ordering.
>
> Signed-off-by: Khuong Dinh <kdinh@apm.com>
> ---
> v4:
>  - Remove Marc Zyngier ACK in v2
>  - Use acpi_bus_scan on MSI controller handle when MSI device is found
>  - Register ACPI MSI driver when MSI device is found instead of using
>  subsys_initcall
>  - Split ACPI MSI driver support into two patches - one to enable MSI
> support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
> before PCIe controller driver in ACPI boot mode
> v3:
>  - Input X-Gene MSI base address for irq_domain_alloc_fwnode
>  - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
> v2:
>  - Verify with BIOS version 3.06.25 and 3.07.09
> v1:
>  - Initial version
> ---
>
> Khuong Dinh (2):
>   PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
>   PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
>
>  drivers/acpi/Makefile            |    2 +-
>  drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
>  drivers/acpi/acpi_platform.c     |    3 +-
>  drivers/acpi/internal.h          |    1 +
>  drivers/acpi/scan.c              |    1 +
>  drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
>  include/linux/acpi_msi.h         |   37 ++++++++++++++++
>  7 files changed, 183 insertions(+), 7 deletions(-)
>  create mode 100644 drivers/acpi/acpi_msi.c
>  create mode 100644 include/linux/acpi_msi.h
>

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

* Re: [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-10-16 21:19   ` Khuong Dinh
  0 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-10-16 21:19 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Marc Zyngier, msalter, Bjorn Helgaas, linux-pci, jcm
  Cc: rjw, Khuong Dinh, patches, linux-kernel, linux-arm-kernel

Hi Lorenzo,
  Do you have any comments for this patch?

Best regards,
Khuong Dinh

On Tue, Sep 26, 2017 at 10:49 AM, Khuong Dinh <kdinh@apm.com> wrote:
> This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
> and provides the proper MSI driver initialization ordering.
>
> Signed-off-by: Khuong Dinh <kdinh@apm.com>
> ---
> v4:
>  - Remove Marc Zyngier ACK in v2
>  - Use acpi_bus_scan on MSI controller handle when MSI device is found
>  - Register ACPI MSI driver when MSI device is found instead of using
>  subsys_initcall
>  - Split ACPI MSI driver support into two patches - one to enable MSI
> support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
> before PCIe controller driver in ACPI boot mode
> v3:
>  - Input X-Gene MSI base address for irq_domain_alloc_fwnode
>  - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
> v2:
>  - Verify with BIOS version 3.06.25 and 3.07.09
> v1:
>  - Initial version
> ---
>
> Khuong Dinh (2):
>   PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
>   PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
>
>  drivers/acpi/Makefile            |    2 +-
>  drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
>  drivers/acpi/acpi_platform.c     |    3 +-
>  drivers/acpi/internal.h          |    1 +
>  drivers/acpi/scan.c              |    1 +
>  drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
>  include/linux/acpi_msi.h         |   37 ++++++++++++++++
>  7 files changed, 183 insertions(+), 7 deletions(-)
>  create mode 100644 drivers/acpi/acpi_msi.c
>  create mode 100644 include/linux/acpi_msi.h
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-10-16 21:19   ` Khuong Dinh
  0 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-10-16 21:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lorenzo,
  Do you have any comments for this patch?

Best regards,
Khuong Dinh

On Tue, Sep 26, 2017 at 10:49 AM, Khuong Dinh <kdinh@apm.com> wrote:
> This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
> and provides the proper MSI driver initialization ordering.
>
> Signed-off-by: Khuong Dinh <kdinh@apm.com>
> ---
> v4:
>  - Remove Marc Zyngier ACK in v2
>  - Use acpi_bus_scan on MSI controller handle when MSI device is found
>  - Register ACPI MSI driver when MSI device is found instead of using
>  subsys_initcall
>  - Split ACPI MSI driver support into two patches - one to enable MSI
> support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
> before PCIe controller driver in ACPI boot mode
> v3:
>  - Input X-Gene MSI base address for irq_domain_alloc_fwnode
>  - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
> v2:
>  - Verify with BIOS version 3.06.25 and 3.07.09
> v1:
>  - Initial version
> ---
>
> Khuong Dinh (2):
>   PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
>   PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
>
>  drivers/acpi/Makefile            |    2 +-
>  drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
>  drivers/acpi/acpi_platform.c     |    3 +-
>  drivers/acpi/internal.h          |    1 +
>  drivers/acpi/scan.c              |    1 +
>  drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
>  include/linux/acpi_msi.h         |   37 ++++++++++++++++
>  7 files changed, 183 insertions(+), 7 deletions(-)
>  create mode 100644 drivers/acpi/acpi_msi.c
>  create mode 100644 include/linux/acpi_msi.h
>

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

* Re: [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
  2017-10-16 21:19   ` Khuong Dinh
  (?)
@ 2017-10-17 13:38     ` Lorenzo Pieralisi
  -1 siblings, 0 replies; 31+ messages in thread
From: Lorenzo Pieralisi @ 2017-10-17 13:38 UTC (permalink / raw)
  To: Khuong Dinh
  Cc: Marc Zyngier, msalter, Bjorn Helgaas, linux-pci, jcm, patches,
	linux-kernel, linux-arm-kernel, rjw

Hi Khuong,

On Mon, Oct 16, 2017 at 02:19:50PM -0700, Khuong Dinh wrote:
> Hi Lorenzo,
>   Do you have any comments for this patch?

I'd have some comments but given that there are related issues with ACPI
probe ordering that Marc is trying to solve on his side - I will work
with him to see if we can accommodate changes that can solve this issue
too.

Again - I recognize it is a complex problem (that is not even
contemplated by the current ACPI specs), we have to try to make
the solution as generic as we can to prevent reinventing the wheel
anytime a sligthly different issue (related to ACPI probe ordering)
comes up.

Leave it to me (us) and I will get back to you on this.

Thanks,
Lorenzo

> Best regards,
> Khuong Dinh
> 
> On Tue, Sep 26, 2017 at 10:49 AM, Khuong Dinh <kdinh@apm.com> wrote:
> > This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
> > and provides the proper MSI driver initialization ordering.
> >
> > Signed-off-by: Khuong Dinh <kdinh@apm.com>
> > ---
> > v4:
> >  - Remove Marc Zyngier ACK in v2
> >  - Use acpi_bus_scan on MSI controller handle when MSI device is found
> >  - Register ACPI MSI driver when MSI device is found instead of using
> >  subsys_initcall
> >  - Split ACPI MSI driver support into two patches - one to enable MSI
> > support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
> > before PCIe controller driver in ACPI boot mode
> > v3:
> >  - Input X-Gene MSI base address for irq_domain_alloc_fwnode
> >  - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
> > v2:
> >  - Verify with BIOS version 3.06.25 and 3.07.09
> > v1:
> >  - Initial version
> > ---
> >
> > Khuong Dinh (2):
> >   PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
> >   PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
> >
> >  drivers/acpi/Makefile            |    2 +-
> >  drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
> >  drivers/acpi/acpi_platform.c     |    3 +-
> >  drivers/acpi/internal.h          |    1 +
> >  drivers/acpi/scan.c              |    1 +
> >  drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
> >  include/linux/acpi_msi.h         |   37 ++++++++++++++++
> >  7 files changed, 183 insertions(+), 7 deletions(-)
> >  create mode 100644 drivers/acpi/acpi_msi.c
> >  create mode 100644 include/linux/acpi_msi.h
> >

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

* Re: [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-10-17 13:38     ` Lorenzo Pieralisi
  0 siblings, 0 replies; 31+ messages in thread
From: Lorenzo Pieralisi @ 2017-10-17 13:38 UTC (permalink / raw)
  To: Khuong Dinh
  Cc: rjw, Marc Zyngier, linux-pci, msalter, patches, linux-kernel,
	jcm, Bjorn Helgaas, linux-arm-kernel

Hi Khuong,

On Mon, Oct 16, 2017 at 02:19:50PM -0700, Khuong Dinh wrote:
> Hi Lorenzo,
>   Do you have any comments for this patch?

I'd have some comments but given that there are related issues with ACPI
probe ordering that Marc is trying to solve on his side - I will work
with him to see if we can accommodate changes that can solve this issue
too.

Again - I recognize it is a complex problem (that is not even
contemplated by the current ACPI specs), we have to try to make
the solution as generic as we can to prevent reinventing the wheel
anytime a sligthly different issue (related to ACPI probe ordering)
comes up.

Leave it to me (us) and I will get back to you on this.

Thanks,
Lorenzo

> Best regards,
> Khuong Dinh
> 
> On Tue, Sep 26, 2017 at 10:49 AM, Khuong Dinh <kdinh@apm.com> wrote:
> > This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
> > and provides the proper MSI driver initialization ordering.
> >
> > Signed-off-by: Khuong Dinh <kdinh@apm.com>
> > ---
> > v4:
> >  - Remove Marc Zyngier ACK in v2
> >  - Use acpi_bus_scan on MSI controller handle when MSI device is found
> >  - Register ACPI MSI driver when MSI device is found instead of using
> >  subsys_initcall
> >  - Split ACPI MSI driver support into two patches - one to enable MSI
> > support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
> > before PCIe controller driver in ACPI boot mode
> > v3:
> >  - Input X-Gene MSI base address for irq_domain_alloc_fwnode
> >  - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
> > v2:
> >  - Verify with BIOS version 3.06.25 and 3.07.09
> > v1:
> >  - Initial version
> > ---
> >
> > Khuong Dinh (2):
> >   PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
> >   PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
> >
> >  drivers/acpi/Makefile            |    2 +-
> >  drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
> >  drivers/acpi/acpi_platform.c     |    3 +-
> >  drivers/acpi/internal.h          |    1 +
> >  drivers/acpi/scan.c              |    1 +
> >  drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
> >  include/linux/acpi_msi.h         |   37 ++++++++++++++++
> >  7 files changed, 183 insertions(+), 7 deletions(-)
> >  create mode 100644 drivers/acpi/acpi_msi.c
> >  create mode 100644 include/linux/acpi_msi.h
> >

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-10-17 13:38     ` Lorenzo Pieralisi
  0 siblings, 0 replies; 31+ messages in thread
From: Lorenzo Pieralisi @ 2017-10-17 13:38 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Khuong,

On Mon, Oct 16, 2017 at 02:19:50PM -0700, Khuong Dinh wrote:
> Hi Lorenzo,
>   Do you have any comments for this patch?

I'd have some comments but given that there are related issues with ACPI
probe ordering that Marc is trying to solve on his side - I will work
with him to see if we can accommodate changes that can solve this issue
too.

Again - I recognize it is a complex problem (that is not even
contemplated by the current ACPI specs), we have to try to make
the solution as generic as we can to prevent reinventing the wheel
anytime a sligthly different issue (related to ACPI probe ordering)
comes up.

Leave it to me (us) and I will get back to you on this.

Thanks,
Lorenzo

> Best regards,
> Khuong Dinh
> 
> On Tue, Sep 26, 2017 at 10:49 AM, Khuong Dinh <kdinh@apm.com> wrote:
> > This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
> > and provides the proper MSI driver initialization ordering.
> >
> > Signed-off-by: Khuong Dinh <kdinh@apm.com>
> > ---
> > v4:
> >  - Remove Marc Zyngier ACK in v2
> >  - Use acpi_bus_scan on MSI controller handle when MSI device is found
> >  - Register ACPI MSI driver when MSI device is found instead of using
> >  subsys_initcall
> >  - Split ACPI MSI driver support into two patches - one to enable MSI
> > support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
> > before PCIe controller driver in ACPI boot mode
> > v3:
> >  - Input X-Gene MSI base address for irq_domain_alloc_fwnode
> >  - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
> > v2:
> >  - Verify with BIOS version 3.06.25 and 3.07.09
> > v1:
> >  - Initial version
> > ---
> >
> > Khuong Dinh (2):
> >   PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
> >   PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
> >
> >  drivers/acpi/Makefile            |    2 +-
> >  drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
> >  drivers/acpi/acpi_platform.c     |    3 +-
> >  drivers/acpi/internal.h          |    1 +
> >  drivers/acpi/scan.c              |    1 +
> >  drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
> >  include/linux/acpi_msi.h         |   37 ++++++++++++++++
> >  7 files changed, 183 insertions(+), 7 deletions(-)
> >  create mode 100644 drivers/acpi/acpi_msi.c
> >  create mode 100644 include/linux/acpi_msi.h
> >

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

* Re: [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
  2017-09-26 17:49 ` Khuong Dinh
  (?)
@ 2017-10-17 17:05   ` Bjorn Helgaas
  -1 siblings, 0 replies; 31+ messages in thread
From: Bjorn Helgaas @ 2017-10-17 17:05 UTC (permalink / raw)
  To: Khuong Dinh
  Cc: lorenzo.pieralisi, marc.zyngier, msalter, bhelgaas, linux-pci,
	jcm, rjw, patches, linux-kernel, linux-arm-kernel

On Tue, Sep 26, 2017 at 11:49:19AM -0600, Khuong Dinh wrote:
> This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
> and provides the proper MSI driver initialization ordering.
> 
> Signed-off-by: Khuong Dinh <kdinh@apm.com>
> ---
> v4:
>  - Remove Marc Zyngier ACK in v2
>  - Use acpi_bus_scan on MSI controller handle when MSI device is found
>  - Register ACPI MSI driver when MSI device is found instead of using
>  subsys_initcall
>  - Split ACPI MSI driver support into two patches - one to enable MSI
> support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
> before PCIe controller driver in ACPI boot mode
> v3:
>  - Input X-Gene MSI base address for irq_domain_alloc_fwnode
>  - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
> v2:
>  - Verify with BIOS version 3.06.25 and 3.07.09
> v1:
>  - Initial version
> ---
> 
> Khuong Dinh (2):
>   PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
>   PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
> 
>  drivers/acpi/Makefile            |    2 +-
>  drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
>  drivers/acpi/acpi_platform.c     |    3 +-
>  drivers/acpi/internal.h          |    1 +
>  drivers/acpi/scan.c              |    1 +
>  drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
>  include/linux/acpi_msi.h         |   37 ++++++++++++++++
>  7 files changed, 183 insertions(+), 7 deletions(-)
>  create mode 100644 drivers/acpi/acpi_msi.c
>  create mode 100644 include/linux/acpi_msi.h

The changelogs don't really give the nitty-gritty details of the
problem, e.g., apparently the host bridge and the MSI controller are
enumerated as two separate devices and there's an ordering issue with
binding drivers to them.

They should also contrast the X-Gene situation with other systems so we
can see why X-Gene has this problem when other systems don't.

I'm not thrilled about all the ACPI code this adds, but I'm guessing
there'll be some better solution eventually.

I'm going to mark these as "changes requested" even though I haven't
asked for anything specific to be changed because it sounds like
Lorenzo et al. may have more concrete proposals soon.

Are there currently systems that do not work and need to be fixed
ASAP?

Bjorn

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

* Re: [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-10-17 17:05   ` Bjorn Helgaas
  0 siblings, 0 replies; 31+ messages in thread
From: Bjorn Helgaas @ 2017-10-17 17:05 UTC (permalink / raw)
  To: Khuong Dinh
  Cc: lorenzo.pieralisi, marc.zyngier, linux-pci, msalter, rjw,
	linux-kernel, patches, jcm, bhelgaas, linux-arm-kernel

On Tue, Sep 26, 2017 at 11:49:19AM -0600, Khuong Dinh wrote:
> This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
> and provides the proper MSI driver initialization ordering.
> 
> Signed-off-by: Khuong Dinh <kdinh@apm.com>
> ---
> v4:
>  - Remove Marc Zyngier ACK in v2
>  - Use acpi_bus_scan on MSI controller handle when MSI device is found
>  - Register ACPI MSI driver when MSI device is found instead of using
>  subsys_initcall
>  - Split ACPI MSI driver support into two patches - one to enable MSI
> support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
> before PCIe controller driver in ACPI boot mode
> v3:
>  - Input X-Gene MSI base address for irq_domain_alloc_fwnode
>  - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
> v2:
>  - Verify with BIOS version 3.06.25 and 3.07.09
> v1:
>  - Initial version
> ---
> 
> Khuong Dinh (2):
>   PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
>   PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
> 
>  drivers/acpi/Makefile            |    2 +-
>  drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
>  drivers/acpi/acpi_platform.c     |    3 +-
>  drivers/acpi/internal.h          |    1 +
>  drivers/acpi/scan.c              |    1 +
>  drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
>  include/linux/acpi_msi.h         |   37 ++++++++++++++++
>  7 files changed, 183 insertions(+), 7 deletions(-)
>  create mode 100644 drivers/acpi/acpi_msi.c
>  create mode 100644 include/linux/acpi_msi.h

The changelogs don't really give the nitty-gritty details of the
problem, e.g., apparently the host bridge and the MSI controller are
enumerated as two separate devices and there's an ordering issue with
binding drivers to them.

They should also contrast the X-Gene situation with other systems so we
can see why X-Gene has this problem when other systems don't.

I'm not thrilled about all the ACPI code this adds, but I'm guessing
there'll be some better solution eventually.

I'm going to mark these as "changes requested" even though I haven't
asked for anything specific to be changed because it sounds like
Lorenzo et al. may have more concrete proposals soon.

Are there currently systems that do not work and need to be fixed
ASAP?

Bjorn

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-10-17 17:05   ` Bjorn Helgaas
  0 siblings, 0 replies; 31+ messages in thread
From: Bjorn Helgaas @ 2017-10-17 17:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 26, 2017 at 11:49:19AM -0600, Khuong Dinh wrote:
> This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
> and provides the proper MSI driver initialization ordering.
> 
> Signed-off-by: Khuong Dinh <kdinh@apm.com>
> ---
> v4:
>  - Remove Marc Zyngier ACK in v2
>  - Use acpi_bus_scan on MSI controller handle when MSI device is found
>  - Register ACPI MSI driver when MSI device is found instead of using
>  subsys_initcall
>  - Split ACPI MSI driver support into two patches - one to enable MSI
> support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
> before PCIe controller driver in ACPI boot mode
> v3:
>  - Input X-Gene MSI base address for irq_domain_alloc_fwnode
>  - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
> v2:
>  - Verify with BIOS version 3.06.25 and 3.07.09
> v1:
>  - Initial version
> ---
> 
> Khuong Dinh (2):
>   PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
>   PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
> 
>  drivers/acpi/Makefile            |    2 +-
>  drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
>  drivers/acpi/acpi_platform.c     |    3 +-
>  drivers/acpi/internal.h          |    1 +
>  drivers/acpi/scan.c              |    1 +
>  drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
>  include/linux/acpi_msi.h         |   37 ++++++++++++++++
>  7 files changed, 183 insertions(+), 7 deletions(-)
>  create mode 100644 drivers/acpi/acpi_msi.c
>  create mode 100644 include/linux/acpi_msi.h

The changelogs don't really give the nitty-gritty details of the
problem, e.g., apparently the host bridge and the MSI controller are
enumerated as two separate devices and there's an ordering issue with
binding drivers to them.

They should also contrast the X-Gene situation with other systems so we
can see why X-Gene has this problem when other systems don't.

I'm not thrilled about all the ACPI code this adds, but I'm guessing
there'll be some better solution eventually.

I'm going to mark these as "changes requested" even though I haven't
asked for anything specific to be changed because it sounds like
Lorenzo et al. may have more concrete proposals soon.

Are there currently systems that do not work and need to be fixed
ASAP?

Bjorn

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

* Re: [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
  2017-10-17 17:05   ` Bjorn Helgaas
  (?)
  (?)
@ 2017-10-17 17:33   ` Jon Masters
  -1 siblings, 0 replies; 31+ messages in thread
From: Jon Masters @ 2017-10-17 17:33 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Khuong Dinh, lorenzo.pieralisi, marc.zyngier, msalter, bhelgaas,
	linux-pci, rjw, patches, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 3103 bytes --]

Quick reply - this patch series happened at my request to ensure that upstream is taken care of properly. X-Gene1 is SBSA Level 0 aka they were the first vendor and so we allowed them to have a non-standard ITS (MSI) solution. You won’t see this in any other future Arm server SoC, even from AppliedMicro. It’s a one time historical artifact and we long since took care of having a standard MSI solution BUT we still heavily use X-Gene1 systems and want upstream cleaned up.

Excuse terse Phone reply.

-- 
Computer Architect | Sent from my 64-bit #ARM Powered phone

> On Oct 17, 2017, at 13:05, Bjorn Helgaas <helgaas@kernel.org> wrote:
> 
>> On Tue, Sep 26, 2017 at 11:49:19AM -0600, Khuong Dinh wrote:
>> This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
>> and provides the proper MSI driver initialization ordering.
>> 
>> Signed-off-by: Khuong Dinh <kdinh@apm.com>
>> ---
>> v4:
>> - Remove Marc Zyngier ACK in v2
>> - Use acpi_bus_scan on MSI controller handle when MSI device is found
>> - Register ACPI MSI driver when MSI device is found instead of using
>> subsys_initcall
>> - Split ACPI MSI driver support into two patches - one to enable MSI
>> support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
>> before PCIe controller driver in ACPI boot mode
>> v3:
>> - Input X-Gene MSI base address for irq_domain_alloc_fwnode
>> - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
>> v2:
>> - Verify with BIOS version 3.06.25 and 3.07.09
>> v1:
>> - Initial version
>> ---
>> 
>> Khuong Dinh (2):
>>  PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
>>  PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
>> 
>> drivers/acpi/Makefile            |    2 +-
>> drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
>> drivers/acpi/acpi_platform.c     |    3 +-
>> drivers/acpi/internal.h          |    1 +
>> drivers/acpi/scan.c              |    1 +
>> drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
>> include/linux/acpi_msi.h         |   37 ++++++++++++++++
>> 7 files changed, 183 insertions(+), 7 deletions(-)
>> create mode 100644 drivers/acpi/acpi_msi.c
>> create mode 100644 include/linux/acpi_msi.h
> 
> The changelogs don't really give the nitty-gritty details of the
> problem, e.g., apparently the host bridge and the MSI controller are
> enumerated as two separate devices and there's an ordering issue with
> binding drivers to them.
> 
> They should also contrast the X-Gene situation with other systems so we
> can see why X-Gene has this problem when other systems don't.
> 
> I'm not thrilled about all the ACPI code this adds, but I'm guessing
> there'll be some better solution eventually.
> 
> I'm going to mark these as "changes requested" even though I haven't
> asked for anything specific to be changed because it sounds like
> Lorenzo et al. may have more concrete proposals soon.
> 
> Are there currently systems that do not work and need to be fixed
> ASAP?
> 
> Bjorn

[-- Attachment #2: Type: text/html, Size: 5868 bytes --]

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

* Re: [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
  2017-10-17 13:38     ` Lorenzo Pieralisi
  (?)
@ 2017-10-18  5:45       ` Khuong Dinh
  -1 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-10-18  5:45 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Marc Zyngier, msalter, Bjorn Helgaas, linux-pci, jcm, patches,
	linux-kernel, linux-arm-kernel, rjw

Hi Lorenzo,

On Tue, Oct 17, 2017 at 6:38 AM, Lorenzo Pieralisi
<lorenzo.pieralisi@arm.com> wrote:
> Hi Khuong,
>
> On Mon, Oct 16, 2017 at 02:19:50PM -0700, Khuong Dinh wrote:
>> Hi Lorenzo,
>>   Do you have any comments for this patch?
>
> I'd have some comments but given that there are related issues with ACPI
> probe ordering that Marc is trying to solve on his side - I will work
> with him to see if we can accommodate changes that can solve this issue
> too.
>
> Again - I recognize it is a complex problem (that is not even
> contemplated by the current ACPI specs), we have to try to make
> the solution as generic as we can to prevent reinventing the wheel
> anytime a sligthly different issue (related to ACPI probe ordering)
> comes up.
>
> Leave it to me (us) and I will get back to you on this.

Thanks for helping to take care of the generic ACPI probe ordering issue.
Given that the patch 'PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI
boot for X-Gene v1" adds only the ACPI ID, can you pull in this patch
independently from the ACPI probe ordering issue?

Best regards,
Khuong Dinh

> Thanks,
> Lorenzo
>
>> Best regards,
>> Khuong Dinh
>>
>> On Tue, Sep 26, 2017 at 10:49 AM, Khuong Dinh <kdinh@apm.com> wrote:
>> > This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
>> > and provides the proper MSI driver initialization ordering.
>> >
>> > Signed-off-by: Khuong Dinh <kdinh@apm.com>
>> > ---
>> > v4:
>> >  - Remove Marc Zyngier ACK in v2
>> >  - Use acpi_bus_scan on MSI controller handle when MSI device is found
>> >  - Register ACPI MSI driver when MSI device is found instead of using
>> >  subsys_initcall
>> >  - Split ACPI MSI driver support into two patches - one to enable MSI
>> > support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
>> > before PCIe controller driver in ACPI boot mode
>> > v3:
>> >  - Input X-Gene MSI base address for irq_domain_alloc_fwnode
>> >  - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
>> > v2:
>> >  - Verify with BIOS version 3.06.25 and 3.07.09
>> > v1:
>> >  - Initial version
>> > ---
>> >
>> > Khuong Dinh (2):
>> >   PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
>> >   PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
>> >
>> >  drivers/acpi/Makefile            |    2 +-
>> >  drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
>> >  drivers/acpi/acpi_platform.c     |    3 +-
>> >  drivers/acpi/internal.h          |    1 +
>> >  drivers/acpi/scan.c              |    1 +
>> >  drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
>> >  include/linux/acpi_msi.h         |   37 ++++++++++++++++
>> >  7 files changed, 183 insertions(+), 7 deletions(-)
>> >  create mode 100644 drivers/acpi/acpi_msi.c
>> >  create mode 100644 include/linux/acpi_msi.h
>> >

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

* Re: [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-10-18  5:45       ` Khuong Dinh
  0 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-10-18  5:45 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: rjw, Marc Zyngier, linux-pci, msalter, patches, linux-kernel,
	jcm, Bjorn Helgaas, linux-arm-kernel

Hi Lorenzo,

On Tue, Oct 17, 2017 at 6:38 AM, Lorenzo Pieralisi
<lorenzo.pieralisi@arm.com> wrote:
> Hi Khuong,
>
> On Mon, Oct 16, 2017 at 02:19:50PM -0700, Khuong Dinh wrote:
>> Hi Lorenzo,
>>   Do you have any comments for this patch?
>
> I'd have some comments but given that there are related issues with ACPI
> probe ordering that Marc is trying to solve on his side - I will work
> with him to see if we can accommodate changes that can solve this issue
> too.
>
> Again - I recognize it is a complex problem (that is not even
> contemplated by the current ACPI specs), we have to try to make
> the solution as generic as we can to prevent reinventing the wheel
> anytime a sligthly different issue (related to ACPI probe ordering)
> comes up.
>
> Leave it to me (us) and I will get back to you on this.

Thanks for helping to take care of the generic ACPI probe ordering issue.
Given that the patch 'PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI
boot for X-Gene v1" adds only the ACPI ID, can you pull in this patch
independently from the ACPI probe ordering issue?

Best regards,
Khuong Dinh

> Thanks,
> Lorenzo
>
>> Best regards,
>> Khuong Dinh
>>
>> On Tue, Sep 26, 2017 at 10:49 AM, Khuong Dinh <kdinh@apm.com> wrote:
>> > This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
>> > and provides the proper MSI driver initialization ordering.
>> >
>> > Signed-off-by: Khuong Dinh <kdinh@apm.com>
>> > ---
>> > v4:
>> >  - Remove Marc Zyngier ACK in v2
>> >  - Use acpi_bus_scan on MSI controller handle when MSI device is found
>> >  - Register ACPI MSI driver when MSI device is found instead of using
>> >  subsys_initcall
>> >  - Split ACPI MSI driver support into two patches - one to enable MSI
>> > support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
>> > before PCIe controller driver in ACPI boot mode
>> > v3:
>> >  - Input X-Gene MSI base address for irq_domain_alloc_fwnode
>> >  - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
>> > v2:
>> >  - Verify with BIOS version 3.06.25 and 3.07.09
>> > v1:
>> >  - Initial version
>> > ---
>> >
>> > Khuong Dinh (2):
>> >   PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
>> >   PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
>> >
>> >  drivers/acpi/Makefile            |    2 +-
>> >  drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
>> >  drivers/acpi/acpi_platform.c     |    3 +-
>> >  drivers/acpi/internal.h          |    1 +
>> >  drivers/acpi/scan.c              |    1 +
>> >  drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
>> >  include/linux/acpi_msi.h         |   37 ++++++++++++++++
>> >  7 files changed, 183 insertions(+), 7 deletions(-)
>> >  create mode 100644 drivers/acpi/acpi_msi.c
>> >  create mode 100644 include/linux/acpi_msi.h
>> >

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-10-18  5:45       ` Khuong Dinh
  0 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-10-18  5:45 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lorenzo,

On Tue, Oct 17, 2017 at 6:38 AM, Lorenzo Pieralisi
<lorenzo.pieralisi@arm.com> wrote:
> Hi Khuong,
>
> On Mon, Oct 16, 2017 at 02:19:50PM -0700, Khuong Dinh wrote:
>> Hi Lorenzo,
>>   Do you have any comments for this patch?
>
> I'd have some comments but given that there are related issues with ACPI
> probe ordering that Marc is trying to solve on his side - I will work
> with him to see if we can accommodate changes that can solve this issue
> too.
>
> Again - I recognize it is a complex problem (that is not even
> contemplated by the current ACPI specs), we have to try to make
> the solution as generic as we can to prevent reinventing the wheel
> anytime a sligthly different issue (related to ACPI probe ordering)
> comes up.
>
> Leave it to me (us) and I will get back to you on this.

Thanks for helping to take care of the generic ACPI probe ordering issue.
Given that the patch 'PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI
boot for X-Gene v1" adds only the ACPI ID, can you pull in this patch
independently from the ACPI probe ordering issue?

Best regards,
Khuong Dinh

> Thanks,
> Lorenzo
>
>> Best regards,
>> Khuong Dinh
>>
>> On Tue, Sep 26, 2017 at 10:49 AM, Khuong Dinh <kdinh@apm.com> wrote:
>> > This patch set enables ACPI MSI support for X-Gene PCIe v1 hardware
>> > and provides the proper MSI driver initialization ordering.
>> >
>> > Signed-off-by: Khuong Dinh <kdinh@apm.com>
>> > ---
>> > v4:
>> >  - Remove Marc Zyngier ACK in v2
>> >  - Use acpi_bus_scan on MSI controller handle when MSI device is found
>> >  - Register ACPI MSI driver when MSI device is found instead of using
>> >  subsys_initcall
>> >  - Split ACPI MSI driver support into two patches - one to enable MSI
>> > support for X-Gene PCIe v1 hardware, one to enforce MSI driver loaded
>> > before PCIe controller driver in ACPI boot mode
>> > v3:
>> >  - Input X-Gene MSI base address for irq_domain_alloc_fwnode
>> >  - Add a hook to enforce X-Gene MSI be probed prior acpi_bus_scan happens
>> > v2:
>> >  - Verify with BIOS version 3.06.25 and 3.07.09
>> > v1:
>> >  - Initial version
>> > ---
>> >
>> > Khuong Dinh (2):
>> >   PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
>> >   PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot
>> >
>> >  drivers/acpi/Makefile            |    2 +-
>> >  drivers/acpi/acpi_msi.c          |   86 ++++++++++++++++++++++++++++++++++++++
>> >  drivers/acpi/acpi_platform.c     |    3 +-
>> >  drivers/acpi/internal.h          |    1 +
>> >  drivers/acpi/scan.c              |    1 +
>> >  drivers/pci/host/pci-xgene-msi.c |   60 ++++++++++++++++++++++++--
>> >  include/linux/acpi_msi.h         |   37 ++++++++++++++++
>> >  7 files changed, 183 insertions(+), 7 deletions(-)
>> >  create mode 100644 drivers/acpi/acpi_msi.c
>> >  create mode 100644 include/linux/acpi_msi.h
>> >

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

* Re: [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
  2017-10-18  5:45       ` Khuong Dinh
  (?)
@ 2017-10-18  9:07         ` Lorenzo Pieralisi
  -1 siblings, 0 replies; 31+ messages in thread
From: Lorenzo Pieralisi @ 2017-10-18  9:07 UTC (permalink / raw)
  To: Khuong Dinh
  Cc: Marc Zyngier, msalter, Bjorn Helgaas, linux-pci, jcm, patches,
	linux-kernel, linux-arm-kernel, rjw

On Tue, Oct 17, 2017 at 10:45:35PM -0700, Khuong Dinh wrote:
> Hi Lorenzo,
>
> On Tue, Oct 17, 2017 at 6:38 AM, Lorenzo Pieralisi
> <lorenzo.pieralisi@arm.com> wrote:
> > Hi Khuong,
> >
> > On Mon, Oct 16, 2017 at 02:19:50PM -0700, Khuong Dinh wrote:
> >> Hi Lorenzo,
> >>   Do you have any comments for this patch?
> >
> > I'd have some comments but given that there are related issues with ACPI
> > probe ordering that Marc is trying to solve on his side - I will work
> > with him to see if we can accommodate changes that can solve this issue
> > too.
> >
> > Again - I recognize it is a complex problem (that is not even
> > contemplated by the current ACPI specs), we have to try to make
> > the solution as generic as we can to prevent reinventing the wheel
> > anytime a sligthly different issue (related to ACPI probe ordering)
> > comes up.
> >
> > Leave it to me (us) and I will get back to you on this.
>
> Thanks for helping to take care of the generic ACPI probe ordering issue.
> Given that the patch 'PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI
> boot for X-Gene v1" adds only the ACPI ID, can you pull in this patch
> independently from the ACPI probe ordering issue?

No. For two reasons:

1) It's Bjorn who decides whether that code can be merged or not, not
   me
2) That patch sneaks in ACPI MSI support for X-gene v1 that depends
   on kernel link ordering. As soon as it is pulled in the mainline
   it creates a dependency on pseudo-working code that may break
   anytime and as I said many times before I am not willing to rely
   on that.

Lorenzo
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-10-18  9:07         ` Lorenzo Pieralisi
  0 siblings, 0 replies; 31+ messages in thread
From: Lorenzo Pieralisi @ 2017-10-18  9:07 UTC (permalink / raw)
  To: Khuong Dinh
  Cc: rjw, Marc Zyngier, linux-pci, msalter, patches, linux-kernel,
	jcm, Bjorn Helgaas, linux-arm-kernel

On Tue, Oct 17, 2017 at 10:45:35PM -0700, Khuong Dinh wrote:
> Hi Lorenzo,
>
> On Tue, Oct 17, 2017 at 6:38 AM, Lorenzo Pieralisi
> <lorenzo.pieralisi@arm.com> wrote:
> > Hi Khuong,
> >
> > On Mon, Oct 16, 2017 at 02:19:50PM -0700, Khuong Dinh wrote:
> >> Hi Lorenzo,
> >>   Do you have any comments for this patch?
> >
> > I'd have some comments but given that there are related issues with ACPI
> > probe ordering that Marc is trying to solve on his side - I will work
> > with him to see if we can accommodate changes that can solve this issue
> > too.
> >
> > Again - I recognize it is a complex problem (that is not even
> > contemplated by the current ACPI specs), we have to try to make
> > the solution as generic as we can to prevent reinventing the wheel
> > anytime a sligthly different issue (related to ACPI probe ordering)
> > comes up.
> >
> > Leave it to me (us) and I will get back to you on this.
>
> Thanks for helping to take care of the generic ACPI probe ordering issue.
> Given that the patch 'PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI
> boot for X-Gene v1" adds only the ACPI ID, can you pull in this patch
> independently from the ACPI probe ordering issue?

No. For two reasons:

1) It's Bjorn who decides whether that code can be merged or not, not
   me
2) That patch sneaks in ACPI MSI support for X-gene v1 that depends
   on kernel link ordering. As soon as it is pulled in the mainline
   it creates a dependency on pseudo-working code that may break
   anytime and as I said many times before I am not willing to rely
   on that.

Lorenzo
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-10-18  9:07         ` Lorenzo Pieralisi
  0 siblings, 0 replies; 31+ messages in thread
From: Lorenzo Pieralisi @ 2017-10-18  9:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Oct 17, 2017 at 10:45:35PM -0700, Khuong Dinh wrote:
> Hi Lorenzo,
>
> On Tue, Oct 17, 2017 at 6:38 AM, Lorenzo Pieralisi
> <lorenzo.pieralisi@arm.com> wrote:
> > Hi Khuong,
> >
> > On Mon, Oct 16, 2017 at 02:19:50PM -0700, Khuong Dinh wrote:
> >> Hi Lorenzo,
> >>   Do you have any comments for this patch?
> >
> > I'd have some comments but given that there are related issues with ACPI
> > probe ordering that Marc is trying to solve on his side - I will work
> > with him to see if we can accommodate changes that can solve this issue
> > too.
> >
> > Again - I recognize it is a complex problem (that is not even
> > contemplated by the current ACPI specs), we have to try to make
> > the solution as generic as we can to prevent reinventing the wheel
> > anytime a sligthly different issue (related to ACPI probe ordering)
> > comes up.
> >
> > Leave it to me (us) and I will get back to you on this.
>
> Thanks for helping to take care of the generic ACPI probe ordering issue.
> Given that the patch 'PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI
> boot for X-Gene v1" adds only the ACPI ID, can you pull in this patch
> independently from the ACPI probe ordering issue?

No. For two reasons:

1) It's Bjorn who decides whether that code can be merged or not, not
   me
2) That patch sneaks in ACPI MSI support for X-gene v1 that depends
   on kernel link ordering. As soon as it is pulled in the mainline
   it creates a dependency on pseudo-working code that may break
   anytime and as I said many times before I am not willing to rely
   on that.

Lorenzo
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
  2017-10-18  5:45       ` Khuong Dinh
  (?)
@ 2017-10-18  9:26         ` Lorenzo Pieralisi
  -1 siblings, 0 replies; 31+ messages in thread
From: Lorenzo Pieralisi @ 2017-10-18  9:26 UTC (permalink / raw)
  To: Khuong Dinh
  Cc: Marc Zyngier, msalter, Bjorn Helgaas, linux-pci, jcm, patches,
	linux-kernel, linux-arm-kernel, rjw

[removed unintended disclaimer]

On Tue, Oct 17, 2017 at 10:45:35PM -0700, Khuong Dinh wrote:
> Hi Lorenzo,
> 
> On Tue, Oct 17, 2017 at 6:38 AM, Lorenzo Pieralisi
> <lorenzo.pieralisi@arm.com> wrote:
> > Hi Khuong,
> >
> > On Mon, Oct 16, 2017 at 02:19:50PM -0700, Khuong Dinh wrote:
> >> Hi Lorenzo,
> >>   Do you have any comments for this patch?
> >
> > I'd have some comments but given that there are related issues with ACPI
> > probe ordering that Marc is trying to solve on his side - I will work
> > with him to see if we can accommodate changes that can solve this issue
> > too.
> >
> > Again - I recognize it is a complex problem (that is not even
> > contemplated by the current ACPI specs), we have to try to make
> > the solution as generic as we can to prevent reinventing the wheel
> > anytime a sligthly different issue (related to ACPI probe ordering)
> > comes up.
> >
> > Leave it to me (us) and I will get back to you on this.
> 
> Thanks for helping to take care of the generic ACPI probe ordering issue.
> Given that the patch 'PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI
> boot for X-Gene v1" adds only the ACPI ID, can you pull in this patch
> independently from the ACPI probe ordering issue?

No. For two reasons:

1) It's Bjorn who decides whether that code can be merged or not, not me
2) That patch sneaks in ACPI MSI support for X-gene v1 that depends on
   kernel link ordering. As soon as it is pulled in the mainline it
   creates a dependency on pseudo-working code that may break anytime
   and as I said many times before I am not willing to rely on that.

Lorenzo

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

* Re: [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-10-18  9:26         ` Lorenzo Pieralisi
  0 siblings, 0 replies; 31+ messages in thread
From: Lorenzo Pieralisi @ 2017-10-18  9:26 UTC (permalink / raw)
  To: Khuong Dinh
  Cc: rjw, Marc Zyngier, linux-pci, msalter, patches, linux-kernel,
	jcm, Bjorn Helgaas, linux-arm-kernel

[removed unintended disclaimer]

On Tue, Oct 17, 2017 at 10:45:35PM -0700, Khuong Dinh wrote:
> Hi Lorenzo,
> 
> On Tue, Oct 17, 2017 at 6:38 AM, Lorenzo Pieralisi
> <lorenzo.pieralisi@arm.com> wrote:
> > Hi Khuong,
> >
> > On Mon, Oct 16, 2017 at 02:19:50PM -0700, Khuong Dinh wrote:
> >> Hi Lorenzo,
> >>   Do you have any comments for this patch?
> >
> > I'd have some comments but given that there are related issues with ACPI
> > probe ordering that Marc is trying to solve on his side - I will work
> > with him to see if we can accommodate changes that can solve this issue
> > too.
> >
> > Again - I recognize it is a complex problem (that is not even
> > contemplated by the current ACPI specs), we have to try to make
> > the solution as generic as we can to prevent reinventing the wheel
> > anytime a sligthly different issue (related to ACPI probe ordering)
> > comes up.
> >
> > Leave it to me (us) and I will get back to you on this.
> 
> Thanks for helping to take care of the generic ACPI probe ordering issue.
> Given that the patch 'PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI
> boot for X-Gene v1" adds only the ACPI ID, can you pull in this patch
> independently from the ACPI probe ordering issue?

No. For two reasons:

1) It's Bjorn who decides whether that code can be merged or not, not me
2) That patch sneaks in ACPI MSI support for X-gene v1 that depends on
   kernel link ordering. As soon as it is pulled in the mainline it
   creates a dependency on pseudo-working code that may break anytime
   and as I said many times before I am not willing to rely on that.

Lorenzo

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-10-18  9:26         ` Lorenzo Pieralisi
  0 siblings, 0 replies; 31+ messages in thread
From: Lorenzo Pieralisi @ 2017-10-18  9:26 UTC (permalink / raw)
  To: linux-arm-kernel

[removed unintended disclaimer]

On Tue, Oct 17, 2017 at 10:45:35PM -0700, Khuong Dinh wrote:
> Hi Lorenzo,
> 
> On Tue, Oct 17, 2017 at 6:38 AM, Lorenzo Pieralisi
> <lorenzo.pieralisi@arm.com> wrote:
> > Hi Khuong,
> >
> > On Mon, Oct 16, 2017 at 02:19:50PM -0700, Khuong Dinh wrote:
> >> Hi Lorenzo,
> >>   Do you have any comments for this patch?
> >
> > I'd have some comments but given that there are related issues with ACPI
> > probe ordering that Marc is trying to solve on his side - I will work
> > with him to see if we can accommodate changes that can solve this issue
> > too.
> >
> > Again - I recognize it is a complex problem (that is not even
> > contemplated by the current ACPI specs), we have to try to make
> > the solution as generic as we can to prevent reinventing the wheel
> > anytime a sligthly different issue (related to ACPI probe ordering)
> > comes up.
> >
> > Leave it to me (us) and I will get back to you on this.
> 
> Thanks for helping to take care of the generic ACPI probe ordering issue.
> Given that the patch 'PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI
> boot for X-Gene v1" adds only the ACPI ID, can you pull in this patch
> independently from the ACPI probe ordering issue?

No. For two reasons:

1) It's Bjorn who decides whether that code can be merged or not, not me
2) That patch sneaks in ACPI MSI support for X-gene v1 that depends on
   kernel link ordering. As soon as it is pulled in the mainline it
   creates a dependency on pseudo-working code that may break anytime
   and as I said many times before I am not willing to rely on that.

Lorenzo

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

* Re: [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
  2017-10-18  9:26         ` Lorenzo Pieralisi
  (?)
@ 2017-10-18 21:43           ` Khuong Dinh
  -1 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-10-18 21:43 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Marc Zyngier, msalter, Bjorn Helgaas, linux-pci, jcm, patches,
	linux-kernel, linux-arm-kernel, rjw

Hi Lorenzo,


On Wed, Oct 18, 2017 at 2:26 AM, Lorenzo Pieralisi
<lorenzo.pieralisi@arm.com> wrote:
> [removed unintended disclaimer]
>
> On Tue, Oct 17, 2017 at 10:45:35PM -0700, Khuong Dinh wrote:
>> Hi Lorenzo,
>>
>> On Tue, Oct 17, 2017 at 6:38 AM, Lorenzo Pieralisi
>> <lorenzo.pieralisi@arm.com> wrote:
>> > Hi Khuong,
>> >
>> > On Mon, Oct 16, 2017 at 02:19:50PM -0700, Khuong Dinh wrote:
>> >> Hi Lorenzo,
>> >>   Do you have any comments for this patch?
>> >
>> > I'd have some comments but given that there are related issues with ACPI
>> > probe ordering that Marc is trying to solve on his side - I will work
>> > with him to see if we can accommodate changes that can solve this issue
>> > too.
>> >
>> > Again - I recognize it is a complex problem (that is not even
>> > contemplated by the current ACPI specs), we have to try to make
>> > the solution as generic as we can to prevent reinventing the wheel
>> > anytime a sligthly different issue (related to ACPI probe ordering)
>> > comes up.
>> >
>> > Leave it to me (us) and I will get back to you on this.
>>
>> Thanks for helping to take care of the generic ACPI probe ordering issue.
>> Given that the patch 'PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI
>> boot for X-Gene v1" adds only the ACPI ID, can you pull in this patch
>> independently from the ACPI probe ordering issue?
>
> No. For two reasons:
>
> 1) It's Bjorn who decides whether that code can be merged or not, not me
> 2) That patch sneaks in ACPI MSI support for X-gene v1 that depends on
>    kernel link ordering. As soon as it is pulled in the mainline it
>    creates a dependency on pseudo-working code that may break anytime
>    and as I said many times before I am not willing to rely on that.

Thanks for your information. I got it.
I look forward to hearing your updated information about this generic
ACPI probe ordering issue.


> Lorenzo

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

* Re: [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-10-18 21:43           ` Khuong Dinh
  0 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-10-18 21:43 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: rjw, Marc Zyngier, linux-pci, msalter, patches, linux-kernel,
	jcm, Bjorn Helgaas, linux-arm-kernel

Hi Lorenzo,


On Wed, Oct 18, 2017 at 2:26 AM, Lorenzo Pieralisi
<lorenzo.pieralisi@arm.com> wrote:
> [removed unintended disclaimer]
>
> On Tue, Oct 17, 2017 at 10:45:35PM -0700, Khuong Dinh wrote:
>> Hi Lorenzo,
>>
>> On Tue, Oct 17, 2017 at 6:38 AM, Lorenzo Pieralisi
>> <lorenzo.pieralisi@arm.com> wrote:
>> > Hi Khuong,
>> >
>> > On Mon, Oct 16, 2017 at 02:19:50PM -0700, Khuong Dinh wrote:
>> >> Hi Lorenzo,
>> >>   Do you have any comments for this patch?
>> >
>> > I'd have some comments but given that there are related issues with ACPI
>> > probe ordering that Marc is trying to solve on his side - I will work
>> > with him to see if we can accommodate changes that can solve this issue
>> > too.
>> >
>> > Again - I recognize it is a complex problem (that is not even
>> > contemplated by the current ACPI specs), we have to try to make
>> > the solution as generic as we can to prevent reinventing the wheel
>> > anytime a sligthly different issue (related to ACPI probe ordering)
>> > comes up.
>> >
>> > Leave it to me (us) and I will get back to you on this.
>>
>> Thanks for helping to take care of the generic ACPI probe ordering issue.
>> Given that the patch 'PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI
>> boot for X-Gene v1" adds only the ACPI ID, can you pull in this patch
>> independently from the ACPI probe ordering issue?
>
> No. For two reasons:
>
> 1) It's Bjorn who decides whether that code can be merged or not, not me
> 2) That patch sneaks in ACPI MSI support for X-gene v1 that depends on
>    kernel link ordering. As soon as it is pulled in the mainline it
>    creates a dependency on pseudo-working code that may break anytime
>    and as I said many times before I am not willing to rely on that.

Thanks for your information. I got it.
I look forward to hearing your updated information about this generic
ACPI probe ordering issue.


> Lorenzo

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1
@ 2017-10-18 21:43           ` Khuong Dinh
  0 siblings, 0 replies; 31+ messages in thread
From: Khuong Dinh @ 2017-10-18 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lorenzo,


On Wed, Oct 18, 2017 at 2:26 AM, Lorenzo Pieralisi
<lorenzo.pieralisi@arm.com> wrote:
> [removed unintended disclaimer]
>
> On Tue, Oct 17, 2017 at 10:45:35PM -0700, Khuong Dinh wrote:
>> Hi Lorenzo,
>>
>> On Tue, Oct 17, 2017 at 6:38 AM, Lorenzo Pieralisi
>> <lorenzo.pieralisi@arm.com> wrote:
>> > Hi Khuong,
>> >
>> > On Mon, Oct 16, 2017 at 02:19:50PM -0700, Khuong Dinh wrote:
>> >> Hi Lorenzo,
>> >>   Do you have any comments for this patch?
>> >
>> > I'd have some comments but given that there are related issues with ACPI
>> > probe ordering that Marc is trying to solve on his side - I will work
>> > with him to see if we can accommodate changes that can solve this issue
>> > too.
>> >
>> > Again - I recognize it is a complex problem (that is not even
>> > contemplated by the current ACPI specs), we have to try to make
>> > the solution as generic as we can to prevent reinventing the wheel
>> > anytime a sligthly different issue (related to ACPI probe ordering)
>> > comes up.
>> >
>> > Leave it to me (us) and I will get back to you on this.
>>
>> Thanks for helping to take care of the generic ACPI probe ordering issue.
>> Given that the patch 'PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI
>> boot for X-Gene v1" adds only the ACPI ID, can you pull in this patch
>> independently from the ACPI probe ordering issue?
>
> No. For two reasons:
>
> 1) It's Bjorn who decides whether that code can be merged or not, not me
> 2) That patch sneaks in ACPI MSI support for X-gene v1 that depends on
>    kernel link ordering. As soon as it is pulled in the mainline it
>    creates a dependency on pseudo-working code that may break anytime
>    and as I said many times before I am not willing to rely on that.

Thanks for your information. I got it.
I look forward to hearing your updated information about this generic
ACPI probe ordering issue.


> Lorenzo

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

end of thread, other threads:[~2017-10-18 21:43 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-26 17:49 [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1 Khuong Dinh
2017-09-26 17:49 ` Khuong Dinh
2017-09-26 17:49 ` Khuong Dinh
2017-09-26 17:49 ` [PATCH v4 pci 1/2] " Khuong Dinh
2017-09-26 17:49   ` Khuong Dinh
2017-09-26 17:49   ` Khuong Dinh
2017-09-26 17:49 ` [PATCH v4 pci 2/2] PCI/MSI: Enforce MSI driver loaded before PCIe in ACPI boot Khuong Dinh
2017-09-26 17:49   ` Khuong Dinh
2017-09-26 17:49   ` Khuong Dinh
2017-10-16 21:19 ` [PATCH v4 pci 0/2] PCI/MSI: pci-xgene-msi: Enable MSI support in ACPI boot for X-Gene v1 Khuong Dinh
2017-10-16 21:19   ` Khuong Dinh
2017-10-16 21:19   ` Khuong Dinh
2017-10-17 13:38   ` Lorenzo Pieralisi
2017-10-17 13:38     ` Lorenzo Pieralisi
2017-10-17 13:38     ` Lorenzo Pieralisi
2017-10-18  5:45     ` Khuong Dinh
2017-10-18  5:45       ` Khuong Dinh
2017-10-18  5:45       ` Khuong Dinh
2017-10-18  9:07       ` Lorenzo Pieralisi
2017-10-18  9:07         ` Lorenzo Pieralisi
2017-10-18  9:07         ` Lorenzo Pieralisi
2017-10-18  9:26       ` Lorenzo Pieralisi
2017-10-18  9:26         ` Lorenzo Pieralisi
2017-10-18  9:26         ` Lorenzo Pieralisi
2017-10-18 21:43         ` Khuong Dinh
2017-10-18 21:43           ` Khuong Dinh
2017-10-18 21:43           ` Khuong Dinh
2017-10-17 17:05 ` Bjorn Helgaas
2017-10-17 17:05   ` Bjorn Helgaas
2017-10-17 17:05   ` Bjorn Helgaas
2017-10-17 17:33   ` Jon Masters

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.