All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ThunderX external PCI fixes for legacy&new ACPI firmware
@ 2017-03-15  7:49 ` Tomasz Nowicki
  0 siblings, 0 replies; 24+ messages in thread
From: Tomasz Nowicki @ 2017-03-15  7:49 UTC (permalink / raw)
  To: helgaas, Lorenzo.Pieralisi, robert.richter, ddaney,
	Vadim.Lomovtsev, rafael
  Cc: Sunil.Goutham, geethasowjanya.akula, linu.cherian, linux-pci,
	linux-arm-kernel, linux-acpi, Tomasz Nowicki

This patch series update ThunderX PEM driver to be able to boot with legacy
and new ACPI firmware:
1. New firmware uses registered Cavium harware ID "CAV", but kernel instead
   uses "THRX". Fix kernel to use "CAV".
2. Legacy firmware misses PEM quirks information so for this case kernel
   should not assume anything from FW and figure out PEM resources on its own.

Fix this all together in the following branch:
git@github.com:semihalf-nowicki-tomasz/linux.git (thunderx-pci-legacy-fw-v1)

Tomasz Nowicki (2):
  PCI: Use Cavium assigned hardware ID for ThunderX host controller
  PCI: Add legacy firmware support for Cavium ThunderX host controller

 drivers/pci/host/pci-thunder-pem.c | 58 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 55 insertions(+), 3 deletions(-)

-- 
2.7.4

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

* [PATCH 0/2] ThunderX external PCI fixes for legacy&new ACPI firmware
@ 2017-03-15  7:49 ` Tomasz Nowicki
  0 siblings, 0 replies; 24+ messages in thread
From: Tomasz Nowicki @ 2017-03-15  7:49 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series update ThunderX PEM driver to be able to boot with legacy
and new ACPI firmware:
1. New firmware uses registered Cavium harware ID "CAV", but kernel instead
   uses "THRX". Fix kernel to use "CAV".
2. Legacy firmware misses PEM quirks information so for this case kernel
   should not assume anything from FW and figure out PEM resources on its own.

Fix this all together in the following branch:
git at github.com:semihalf-nowicki-tomasz/linux.git (thunderx-pci-legacy-fw-v1)

Tomasz Nowicki (2):
  PCI: Use Cavium assigned hardware ID for ThunderX host controller
  PCI: Add legacy firmware support for Cavium ThunderX host controller

 drivers/pci/host/pci-thunder-pem.c | 58 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 55 insertions(+), 3 deletions(-)

-- 
2.7.4

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

* [PATCH 1/2] PCI: Use Cavium assigned hardware ID for ThunderX host controller
  2017-03-15  7:49 ` Tomasz Nowicki
@ 2017-03-15  7:49   ` Tomasz Nowicki
  -1 siblings, 0 replies; 24+ messages in thread
From: Tomasz Nowicki @ 2017-03-15  7:49 UTC (permalink / raw)
  To: helgaas, Lorenzo.Pieralisi, robert.richter, ddaney,
	Vadim.Lomovtsev, rafael
  Cc: Sunil.Goutham, geethasowjanya.akula, linu.cherian, linux-pci,
	linux-arm-kernel, linux-acpi, Tomasz Nowicki

"CAV" is the only PNP/ACPI hardware ID vendor prefix assigned to Cavium
so fix this as it should be from day one.

Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
---
 drivers/pci/host/pci-thunder-pem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/host/pci-thunder-pem.c b/drivers/pci/host/pci-thunder-pem.c
index af722eb..e354010 100644
--- a/drivers/pci/host/pci-thunder-pem.c
+++ b/drivers/pci/host/pci-thunder-pem.c
@@ -331,7 +331,7 @@ static int thunder_pem_acpi_init(struct pci_config_window *cfg)
 	if (!res_pem)
 		return -ENOMEM;
 
-	ret = acpi_get_rc_resources(dev, "THRX0002", root->segment, res_pem);
+	ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem);
 	if (ret) {
 		dev_err(dev, "can't get rc base address\n");
 		return ret;
-- 
2.7.4


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

* [PATCH 1/2] PCI: Use Cavium assigned hardware ID for ThunderX host controller
@ 2017-03-15  7:49   ` Tomasz Nowicki
  0 siblings, 0 replies; 24+ messages in thread
From: Tomasz Nowicki @ 2017-03-15  7:49 UTC (permalink / raw)
  To: linux-arm-kernel

"CAV" is the only PNP/ACPI hardware ID vendor prefix assigned to Cavium
so fix this as it should be from day one.

Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
---
 drivers/pci/host/pci-thunder-pem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/host/pci-thunder-pem.c b/drivers/pci/host/pci-thunder-pem.c
index af722eb..e354010 100644
--- a/drivers/pci/host/pci-thunder-pem.c
+++ b/drivers/pci/host/pci-thunder-pem.c
@@ -331,7 +331,7 @@ static int thunder_pem_acpi_init(struct pci_config_window *cfg)
 	if (!res_pem)
 		return -ENOMEM;
 
-	ret = acpi_get_rc_resources(dev, "THRX0002", root->segment, res_pem);
+	ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem);
 	if (ret) {
 		dev_err(dev, "can't get rc base address\n");
 		return ret;
-- 
2.7.4

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

* [PATCH 2/2] PCI: Add legacy firmware support for Cavium ThunderX host controller
  2017-03-15  7:49 ` Tomasz Nowicki
@ 2017-03-15  7:49   ` Tomasz Nowicki
  -1 siblings, 0 replies; 24+ messages in thread
From: Tomasz Nowicki @ 2017-03-15  7:49 UTC (permalink / raw)
  To: helgaas, Lorenzo.Pieralisi, robert.richter, ddaney,
	Vadim.Lomovtsev, rafael
  Cc: Sunil.Goutham, geethasowjanya.akula, linu.cherian, linux-pci,
	linux-arm-kernel, linux-acpi, Tomasz Nowicki

During early days of PCI quirks support ThunderX firmware did not provide
PNP0c02 node with PCI configuration space and PEM-specific register ranges.
This means that for legacy FW we are not reserving these resources and
cannot gather PEM-specific resources for further PEM initialization.

In order to support already deployed legacy FW calculate PEM-specific ranges
and provide resources reservation as fallback scenario into PEM driver when
we could not gather PEM reg base from ACPI tables.

Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
---
 drivers/pci/host/pci-thunder-pem.c | 56 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 54 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pci-thunder-pem.c b/drivers/pci/host/pci-thunder-pem.c
index e354010..e0aa194 100644
--- a/drivers/pci/host/pci-thunder-pem.c
+++ b/drivers/pci/host/pci-thunder-pem.c
@@ -14,6 +14,7 @@
  * Copyright (C) 2015 - 2016 Cavium, Inc.
  */
 
+#include <linux/bitfield.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/of_address.h>
@@ -319,6 +320,50 @@ static int thunder_pem_init(struct device *dev, struct pci_config_window *cfg,
 
 #if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)
 
+#define PEM_RES_BASE		0x87e0c0000000UL
+#define PEM_NODE_MASK		GENMASK(45, 44)
+#define PEM_INDX_MASK		GENMASK(26, 24)
+#define PEM_MIN_DOM_IN_NODE	4
+#define PEM_MAX_DOM_IN_NODE	10
+
+static void thunder_pem_reserve_range(struct device *dev, int seg,
+				      struct resource *r)
+{
+	resource_size_t start = r->start, end = r->end;
+	struct resource *res;
+	const char *regionid;
+
+	regionid = kasprintf(GFP_KERNEL, "PEM RC:%d", seg);
+	if (!regionid)
+		return;
+
+	res = request_mem_region(start, end - start + 1, regionid);
+	if (res)
+		res->flags &= ~IORESOURCE_BUSY;
+	else
+		kfree(regionid);
+
+	dev_info(dev, "%pR %s reserved\n", r,
+		 res ? "has been" : "could not be");
+}
+
+static void thunder_pem_legacy_fw(struct acpi_pci_root *root,
+				 struct resource *res_pem)
+{
+	int node = acpi_get_node(root->device->handle);
+	int index;
+
+	if (node == NUMA_NO_NODE)
+		node = 0;
+
+	index = root->segment - PEM_MIN_DOM_IN_NODE;
+	index -= node * PEM_MAX_DOM_IN_NODE;
+	res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) |
+					FIELD_PREP(PEM_INDX_MASK, index);
+	res_pem->end = res_pem->start + SZ_16M - 1;
+	res_pem->flags = IORESOURCE_MEM;
+}
+
 static int thunder_pem_acpi_init(struct pci_config_window *cfg)
 {
 	struct device *dev = cfg->parent;
@@ -332,9 +377,16 @@ static int thunder_pem_acpi_init(struct pci_config_window *cfg)
 		return -ENOMEM;
 
 	ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem);
+
+	/*
+	 * If we fail to gather resources it means that we run with old
+	 * FW where we need to calculate PEM-specific resources manually.
+	 */
 	if (ret) {
-		dev_err(dev, "can't get rc base address\n");
-		return ret;
+		thunder_pem_legacy_fw(root, res_pem);
+		/* Reserve PEM specific resources and PCI configuration space */
+		thunder_pem_reserve_range(dev, root->segment, res_pem);
+		thunder_pem_reserve_range(dev, root->segment, &cfg->res);
 	}
 
 	return thunder_pem_init(dev, cfg, res_pem);
-- 
2.7.4


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

* [PATCH 2/2] PCI: Add legacy firmware support for Cavium ThunderX host controller
@ 2017-03-15  7:49   ` Tomasz Nowicki
  0 siblings, 0 replies; 24+ messages in thread
From: Tomasz Nowicki @ 2017-03-15  7:49 UTC (permalink / raw)
  To: linux-arm-kernel

During early days of PCI quirks support ThunderX firmware did not provide
PNP0c02 node with PCI configuration space and PEM-specific register ranges.
This means that for legacy FW we are not reserving these resources and
cannot gather PEM-specific resources for further PEM initialization.

In order to support already deployed legacy FW calculate PEM-specific ranges
and provide resources reservation as fallback scenario into PEM driver when
we could not gather PEM reg base from ACPI tables.

Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
---
 drivers/pci/host/pci-thunder-pem.c | 56 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 54 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pci-thunder-pem.c b/drivers/pci/host/pci-thunder-pem.c
index e354010..e0aa194 100644
--- a/drivers/pci/host/pci-thunder-pem.c
+++ b/drivers/pci/host/pci-thunder-pem.c
@@ -14,6 +14,7 @@
  * Copyright (C) 2015 - 2016 Cavium, Inc.
  */
 
+#include <linux/bitfield.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/of_address.h>
@@ -319,6 +320,50 @@ static int thunder_pem_init(struct device *dev, struct pci_config_window *cfg,
 
 #if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)
 
+#define PEM_RES_BASE		0x87e0c0000000UL
+#define PEM_NODE_MASK		GENMASK(45, 44)
+#define PEM_INDX_MASK		GENMASK(26, 24)
+#define PEM_MIN_DOM_IN_NODE	4
+#define PEM_MAX_DOM_IN_NODE	10
+
+static void thunder_pem_reserve_range(struct device *dev, int seg,
+				      struct resource *r)
+{
+	resource_size_t start = r->start, end = r->end;
+	struct resource *res;
+	const char *regionid;
+
+	regionid = kasprintf(GFP_KERNEL, "PEM RC:%d", seg);
+	if (!regionid)
+		return;
+
+	res = request_mem_region(start, end - start + 1, regionid);
+	if (res)
+		res->flags &= ~IORESOURCE_BUSY;
+	else
+		kfree(regionid);
+
+	dev_info(dev, "%pR %s reserved\n", r,
+		 res ? "has been" : "could not be");
+}
+
+static void thunder_pem_legacy_fw(struct acpi_pci_root *root,
+				 struct resource *res_pem)
+{
+	int node = acpi_get_node(root->device->handle);
+	int index;
+
+	if (node == NUMA_NO_NODE)
+		node = 0;
+
+	index = root->segment - PEM_MIN_DOM_IN_NODE;
+	index -= node * PEM_MAX_DOM_IN_NODE;
+	res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) |
+					FIELD_PREP(PEM_INDX_MASK, index);
+	res_pem->end = res_pem->start + SZ_16M - 1;
+	res_pem->flags = IORESOURCE_MEM;
+}
+
 static int thunder_pem_acpi_init(struct pci_config_window *cfg)
 {
 	struct device *dev = cfg->parent;
@@ -332,9 +377,16 @@ static int thunder_pem_acpi_init(struct pci_config_window *cfg)
 		return -ENOMEM;
 
 	ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem);
+
+	/*
+	 * If we fail to gather resources it means that we run with old
+	 * FW where we need to calculate PEM-specific resources manually.
+	 */
 	if (ret) {
-		dev_err(dev, "can't get rc base address\n");
-		return ret;
+		thunder_pem_legacy_fw(root, res_pem);
+		/* Reserve PEM specific resources and PCI configuration space */
+		thunder_pem_reserve_range(dev, root->segment, res_pem);
+		thunder_pem_reserve_range(dev, root->segment, &cfg->res);
 	}
 
 	return thunder_pem_init(dev, cfg, res_pem);
-- 
2.7.4

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

* Re: [PATCH 1/2] PCI: Use Cavium assigned hardware ID for ThunderX host controller
  2017-03-15  7:49   ` Tomasz Nowicki
  (?)
@ 2017-03-20 10:49     ` Robert Richter
  -1 siblings, 0 replies; 24+ messages in thread
From: Robert Richter @ 2017-03-20 10:49 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Lorenzo.Pieralisi, Sunil.Goutham, rafael, Tomasz Nowicki,
	linu.cherian, linux-pci, ddaney, geethasowjanya.akula,
	linux-acpi, robert.richter, Vadim.Lomovtsev, linux-arm-kernel

Bjorn,

On 15.03.17 08:49:14, Tomasz Nowicki wrote:
> "CAV" is the only PNP/ACPI hardware ID vendor prefix assigned to Cavium
> so fix this as it should be from day one.
> 
> Signed-off-by: Tomasz Nowicki <tn@semihalf.com>

there is no firmware with 'THRX0002', so tagging this as
stable. Tested with latest firmware.

Fixes: 44f22bd91e88 ("PCI: Add MCFG quirks for Cavium ThunderX pass2.x host controller")
Cc: <stable@vger.kernel.org> # v4.10
Tested-by: Robert Richter <rrichter@cavium.com>
Acked-by: Robert Richter <rrichter@cavium.com>

Please apply.

Thanks,

-Robert

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

* Re: [PATCH 1/2] PCI: Use Cavium assigned hardware ID for ThunderX host controller
@ 2017-03-20 10:49     ` Robert Richter
  0 siblings, 0 replies; 24+ messages in thread
From: Robert Richter @ 2017-03-20 10:49 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Lorenzo.Pieralisi, Sunil.Goutham, rafael, Tomasz Nowicki,
	linu.cherian, linux-pci, ddaney, geethasowjanya.akula,
	linux-acpi, robert.richter, Vadim.Lomovtsev, linux-arm-kernel

Bjorn,

On 15.03.17 08:49:14, Tomasz Nowicki wrote:
> "CAV" is the only PNP/ACPI hardware ID vendor prefix assigned to Cavium
> so fix this as it should be from day one.
> 
> Signed-off-by: Tomasz Nowicki <tn@semihalf.com>

there is no firmware with 'THRX0002', so tagging this as
stable. Tested with latest firmware.

Fixes: 44f22bd91e88 ("PCI: Add MCFG quirks for Cavium ThunderX pass2.x host controller")
Cc: <stable@vger.kernel.org> # v4.10
Tested-by: Robert Richter <rrichter@cavium.com>
Acked-by: Robert Richter <rrichter@cavium.com>

Please apply.

Thanks,

-Robert

_______________________________________________
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] 24+ messages in thread

* [PATCH 1/2] PCI: Use Cavium assigned hardware ID for ThunderX host controller
@ 2017-03-20 10:49     ` Robert Richter
  0 siblings, 0 replies; 24+ messages in thread
From: Robert Richter @ 2017-03-20 10:49 UTC (permalink / raw)
  To: linux-arm-kernel

Bjorn,

On 15.03.17 08:49:14, Tomasz Nowicki wrote:
> "CAV" is the only PNP/ACPI hardware ID vendor prefix assigned to Cavium
> so fix this as it should be from day one.
> 
> Signed-off-by: Tomasz Nowicki <tn@semihalf.com>

there is no firmware with 'THRX0002', so tagging this as
stable. Tested with latest firmware.

Fixes: 44f22bd91e88 ("PCI: Add MCFG quirks for Cavium ThunderX pass2.x host controller")
Cc: <stable@vger.kernel.org> # v4.10
Tested-by: Robert Richter <rrichter@cavium.com>
Acked-by: Robert Richter <rrichter@cavium.com>

Please apply.

Thanks,

-Robert

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

* Re: [PATCH 2/2] PCI: Add legacy firmware support for Cavium ThunderX host controller
  2017-03-15  7:49   ` Tomasz Nowicki
  (?)
@ 2017-03-20 11:02     ` Robert Richter
  -1 siblings, 0 replies; 24+ messages in thread
From: Robert Richter @ 2017-03-20 11:02 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Lorenzo.Pieralisi, Sunil.Goutham, rafael, Tomasz Nowicki,
	linu.cherian, linux-pci, ddaney, geethasowjanya.akula,
	linux-acpi, Vadim.Lomovtsev, linux-arm-kernel

On 15.03.17 08:49:15, Tomasz Nowicki wrote:
> During early days of PCI quirks support ThunderX firmware did not provide
> PNP0c02 node with PCI configuration space and PEM-specific register ranges.
> This means that for legacy FW we are not reserving these resources and
> cannot gather PEM-specific resources for further PEM initialization.
> 
> In order to support already deployed legacy FW calculate PEM-specific ranges
> and provide resources reservation as fallback scenario into PEM driver when
> we could not gather PEM reg base from ACPI tables.
> 
> Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
> Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>

Works with old and new firmware.

Tested-by: Robert Richter <rrichter@cavium.com>
Acked-by: Robert Richter <rrichter@cavium.com>

-Robert

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

* Re: [PATCH 2/2] PCI: Add legacy firmware support for Cavium ThunderX host controller
@ 2017-03-20 11:02     ` Robert Richter
  0 siblings, 0 replies; 24+ messages in thread
From: Robert Richter @ 2017-03-20 11:02 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Lorenzo.Pieralisi, Sunil.Goutham, rafael, Tomasz Nowicki,
	linu.cherian, linux-pci, ddaney, geethasowjanya.akula,
	linux-acpi, Vadim.Lomovtsev, linux-arm-kernel

On 15.03.17 08:49:15, Tomasz Nowicki wrote:
> During early days of PCI quirks support ThunderX firmware did not provide
> PNP0c02 node with PCI configuration space and PEM-specific register ranges.
> This means that for legacy FW we are not reserving these resources and
> cannot gather PEM-specific resources for further PEM initialization.
> 
> In order to support already deployed legacy FW calculate PEM-specific ranges
> and provide resources reservation as fallback scenario into PEM driver when
> we could not gather PEM reg base from ACPI tables.
> 
> Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
> Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>

Works with old and new firmware.

Tested-by: Robert Richter <rrichter@cavium.com>
Acked-by: Robert Richter <rrichter@cavium.com>

-Robert

_______________________________________________
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] 24+ messages in thread

* [PATCH 2/2] PCI: Add legacy firmware support for Cavium ThunderX host controller
@ 2017-03-20 11:02     ` Robert Richter
  0 siblings, 0 replies; 24+ messages in thread
From: Robert Richter @ 2017-03-20 11:02 UTC (permalink / raw)
  To: linux-arm-kernel

On 15.03.17 08:49:15, Tomasz Nowicki wrote:
> During early days of PCI quirks support ThunderX firmware did not provide
> PNP0c02 node with PCI configuration space and PEM-specific register ranges.
> This means that for legacy FW we are not reserving these resources and
> cannot gather PEM-specific resources for further PEM initialization.
> 
> In order to support already deployed legacy FW calculate PEM-specific ranges
> and provide resources reservation as fallback scenario into PEM driver when
> we could not gather PEM reg base from ACPI tables.
> 
> Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
> Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>

Works with old and new firmware.

Tested-by: Robert Richter <rrichter@cavium.com>
Acked-by: Robert Richter <rrichter@cavium.com>

-Robert

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

* Re: [PATCH 0/2] ThunderX external PCI fixes for legacy&new ACPI firmware
  2017-03-15  7:49 ` Tomasz Nowicki
  (?)
@ 2017-03-21 17:43   ` Bjorn Helgaas
  -1 siblings, 0 replies; 24+ messages in thread
From: Bjorn Helgaas @ 2017-03-21 17:43 UTC (permalink / raw)
  To: Tomasz Nowicki
  Cc: Lorenzo.Pieralisi, Sunil.Goutham, rafael, linux-pci,
	linu.cherian, ddaney, geethasowjanya.akula, linux-acpi,
	robert.richter, Vadim.Lomovtsev, linux-arm-kernel

On Wed, Mar 15, 2017 at 08:49:13AM +0100, Tomasz Nowicki wrote:
> This patch series update ThunderX PEM driver to be able to boot with legacy
> and new ACPI firmware:
> 1. New firmware uses registered Cavium harware ID "CAV", but kernel instead
>    uses "THRX". Fix kernel to use "CAV".
> 2. Legacy firmware misses PEM quirks information so for this case kernel
>    should not assume anything from FW and figure out PEM resources on its own.
> 
> Fix this all together in the following branch:
> git@github.com:semihalf-nowicki-tomasz/linux.git (thunderx-pci-legacy-fw-v1)
> 
> Tomasz Nowicki (2):
>   PCI: Use Cavium assigned hardware ID for ThunderX host controller
>   PCI: Add legacy firmware support for Cavium ThunderX host controller
> 
>  drivers/pci/host/pci-thunder-pem.c | 58 ++++++++++++++++++++++++++++++++++++--
>  1 file changed, 55 insertions(+), 3 deletions(-)

Applied with Robert's acks to pci/host-thunder for v4.12, thanks!

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

* Re: [PATCH 0/2] ThunderX external PCI fixes for legacy&new ACPI firmware
@ 2017-03-21 17:43   ` Bjorn Helgaas
  0 siblings, 0 replies; 24+ messages in thread
From: Bjorn Helgaas @ 2017-03-21 17:43 UTC (permalink / raw)
  To: Tomasz Nowicki
  Cc: Lorenzo.Pieralisi, Sunil.Goutham, rafael, linux-pci,
	linu.cherian, ddaney, geethasowjanya.akula, linux-acpi,
	robert.richter, Vadim.Lomovtsev, linux-arm-kernel

On Wed, Mar 15, 2017 at 08:49:13AM +0100, Tomasz Nowicki wrote:
> This patch series update ThunderX PEM driver to be able to boot with legacy
> and new ACPI firmware:
> 1. New firmware uses registered Cavium harware ID "CAV", but kernel instead
>    uses "THRX". Fix kernel to use "CAV".
> 2. Legacy firmware misses PEM quirks information so for this case kernel
>    should not assume anything from FW and figure out PEM resources on its own.
> 
> Fix this all together in the following branch:
> git@github.com:semihalf-nowicki-tomasz/linux.git (thunderx-pci-legacy-fw-v1)
> 
> Tomasz Nowicki (2):
>   PCI: Use Cavium assigned hardware ID for ThunderX host controller
>   PCI: Add legacy firmware support for Cavium ThunderX host controller
> 
>  drivers/pci/host/pci-thunder-pem.c | 58 ++++++++++++++++++++++++++++++++++++--
>  1 file changed, 55 insertions(+), 3 deletions(-)

Applied with Robert's acks to pci/host-thunder for v4.12, thanks!

_______________________________________________
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] 24+ messages in thread

* [PATCH 0/2] ThunderX external PCI fixes for legacy&new ACPI firmware
@ 2017-03-21 17:43   ` Bjorn Helgaas
  0 siblings, 0 replies; 24+ messages in thread
From: Bjorn Helgaas @ 2017-03-21 17:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 15, 2017 at 08:49:13AM +0100, Tomasz Nowicki wrote:
> This patch series update ThunderX PEM driver to be able to boot with legacy
> and new ACPI firmware:
> 1. New firmware uses registered Cavium harware ID "CAV", but kernel instead
>    uses "THRX". Fix kernel to use "CAV".
> 2. Legacy firmware misses PEM quirks information so for this case kernel
>    should not assume anything from FW and figure out PEM resources on its own.
> 
> Fix this all together in the following branch:
> git at github.com:semihalf-nowicki-tomasz/linux.git (thunderx-pci-legacy-fw-v1)
> 
> Tomasz Nowicki (2):
>   PCI: Use Cavium assigned hardware ID for ThunderX host controller
>   PCI: Add legacy firmware support for Cavium ThunderX host controller
> 
>  drivers/pci/host/pci-thunder-pem.c | 58 ++++++++++++++++++++++++++++++++++++--
>  1 file changed, 55 insertions(+), 3 deletions(-)

Applied with Robert's acks to pci/host-thunder for v4.12, thanks!

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

* Re: [PATCH 0/2] ThunderX external PCI fixes for legacy&new ACPI firmware
  2017-03-21 17:43   ` Bjorn Helgaas
@ 2017-03-22 14:19     ` Tomasz Nowicki
  -1 siblings, 0 replies; 24+ messages in thread
From: Tomasz Nowicki @ 2017-03-22 14:19 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Lorenzo.Pieralisi, robert.richter, ddaney, Vadim.Lomovtsev,
	rafael, Sunil.Goutham, geethasowjanya.akula, linu.cherian,
	linux-pci, linux-arm-kernel, linux-acpi

On 21.03.2017 18:43, Bjorn Helgaas wrote:
> On Wed, Mar 15, 2017 at 08:49:13AM +0100, Tomasz Nowicki wrote:
>> This patch series update ThunderX PEM driver to be able to boot with legacy
>> and new ACPI firmware:
>> 1. New firmware uses registered Cavium harware ID "CAV", but kernel instead
>>    uses "THRX". Fix kernel to use "CAV".
>> 2. Legacy firmware misses PEM quirks information so for this case kernel
>>    should not assume anything from FW and figure out PEM resources on its own.
>>
>> Fix this all together in the following branch:
>> git@github.com:semihalf-nowicki-tomasz/linux.git (thunderx-pci-legacy-fw-v1)
>>
>> Tomasz Nowicki (2):
>>   PCI: Use Cavium assigned hardware ID for ThunderX host controller
>>   PCI: Add legacy firmware support for Cavium ThunderX host controller
>>
>>  drivers/pci/host/pci-thunder-pem.c | 58 ++++++++++++++++++++++++++++++++++++--
>>  1 file changed, 55 insertions(+), 3 deletions(-)
>
> Applied with Robert's acks to pci/host-thunder for v4.12, thanks!
>

Thanks Bjorn!

Tomasz

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

* [PATCH 0/2] ThunderX external PCI fixes for legacy&new ACPI firmware
@ 2017-03-22 14:19     ` Tomasz Nowicki
  0 siblings, 0 replies; 24+ messages in thread
From: Tomasz Nowicki @ 2017-03-22 14:19 UTC (permalink / raw)
  To: linux-arm-kernel

On 21.03.2017 18:43, Bjorn Helgaas wrote:
> On Wed, Mar 15, 2017 at 08:49:13AM +0100, Tomasz Nowicki wrote:
>> This patch series update ThunderX PEM driver to be able to boot with legacy
>> and new ACPI firmware:
>> 1. New firmware uses registered Cavium harware ID "CAV", but kernel instead
>>    uses "THRX". Fix kernel to use "CAV".
>> 2. Legacy firmware misses PEM quirks information so for this case kernel
>>    should not assume anything from FW and figure out PEM resources on its own.
>>
>> Fix this all together in the following branch:
>> git at github.com:semihalf-nowicki-tomasz/linux.git (thunderx-pci-legacy-fw-v1)
>>
>> Tomasz Nowicki (2):
>>   PCI: Use Cavium assigned hardware ID for ThunderX host controller
>>   PCI: Add legacy firmware support for Cavium ThunderX host controller
>>
>>  drivers/pci/host/pci-thunder-pem.c | 58 ++++++++++++++++++++++++++++++++++++--
>>  1 file changed, 55 insertions(+), 3 deletions(-)
>
> Applied with Robert's acks to pci/host-thunder for v4.12, thanks!
>

Thanks Bjorn!

Tomasz

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

* Re: [PATCH 2/2] PCI: Add legacy firmware support for Cavium ThunderX host controller
  2017-03-15  7:49   ` Tomasz Nowicki
  (?)
@ 2017-03-24 15:55     ` Tomasz Nowicki
  -1 siblings, 0 replies; 24+ messages in thread
From: Tomasz Nowicki @ 2017-03-24 15:55 UTC (permalink / raw)
  To: helgaas, Lorenzo.Pieralisi, robert.richter, ddaney,
	Vadim.Lomovtsev, rafael
  Cc: Sunil.Goutham, linux-pci, geethasowjanya.akula, linux-acpi,
	linu.cherian, linux-arm-kernel

On 15.03.2017 08:49, Tomasz Nowicki wrote:
> During early days of PCI quirks support ThunderX firmware did not provide
> PNP0c02 node with PCI configuration space and PEM-specific register ranges.
> This means that for legacy FW we are not reserving these resources and
> cannot gather PEM-specific resources for further PEM initialization.
>
> In order to support already deployed legacy FW calculate PEM-specific ranges
> and provide resources reservation as fallback scenario into PEM driver when
> we could not gather PEM reg base from ACPI tables.
>
> Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
> Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
> ---
>  drivers/pci/host/pci-thunder-pem.c | 56 ++++++++++++++++++++++++++++++++++++--
>  1 file changed, 54 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/host/pci-thunder-pem.c b/drivers/pci/host/pci-thunder-pem.c
> index e354010..e0aa194 100644
> --- a/drivers/pci/host/pci-thunder-pem.c
> +++ b/drivers/pci/host/pci-thunder-pem.c
> @@ -14,6 +14,7 @@
>   * Copyright (C) 2015 - 2016 Cavium, Inc.
>   */
>
> +#include <linux/bitfield.h>
>  #include <linux/kernel.h>
>  #include <linux/init.h>
>  #include <linux/of_address.h>
> @@ -319,6 +320,50 @@ static int thunder_pem_init(struct device *dev, struct pci_config_window *cfg,
>
>  #if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)
>
> +#define PEM_RES_BASE		0x87e0c0000000UL
> +#define PEM_NODE_MASK		GENMASK(45, 44)
> +#define PEM_INDX_MASK		GENMASK(26, 24)
> +#define PEM_MIN_DOM_IN_NODE	4
> +#define PEM_MAX_DOM_IN_NODE	10
> +
> +static void thunder_pem_reserve_range(struct device *dev, int seg,
> +				      struct resource *r)
> +{
> +	resource_size_t start = r->start, end = r->end;
> +	struct resource *res;
> +	const char *regionid;
> +
> +	regionid = kasprintf(GFP_KERNEL, "PEM RC:%d", seg);
> +	if (!regionid)
> +		return;
> +
> +	res = request_mem_region(start, end - start + 1, regionid);
> +	if (res)
> +		res->flags &= ~IORESOURCE_BUSY;
> +	else
> +		kfree(regionid);
> +
> +	dev_info(dev, "%pR %s reserved\n", r,
> +		 res ? "has been" : "could not be");
> +}
> +
> +static void thunder_pem_legacy_fw(struct acpi_pci_root *root,
> +				 struct resource *res_pem)
> +{
> +	int node = acpi_get_node(root->device->handle);
> +	int index;
> +
> +	if (node == NUMA_NO_NODE)
> +		node = 0;
> +
> +	index = root->segment - PEM_MIN_DOM_IN_NODE;
> +	index -= node * PEM_MAX_DOM_IN_NODE;
> +	res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) |
> +					FIELD_PREP(PEM_INDX_MASK, index);
> +	res_pem->end = res_pem->start + SZ_16M - 1;
> +	res_pem->flags = IORESOURCE_MEM;
> +}
> +
>  static int thunder_pem_acpi_init(struct pci_config_window *cfg)
>  {
>  	struct device *dev = cfg->parent;
> @@ -332,9 +377,16 @@ static int thunder_pem_acpi_init(struct pci_config_window *cfg)
>  		return -ENOMEM;
>
>  	ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem);
> +
> +	/*
> +	 * If we fail to gather resources it means that we run with old
> +	 * FW where we need to calculate PEM-specific resources manually.
> +	 */
>  	if (ret) {
> -		dev_err(dev, "can't get rc base address\n");
> -		return ret;
> +		thunder_pem_legacy_fw(root, res_pem);
> +		/* Reserve PEM specific resources and PCI configuration space */
> +		thunder_pem_reserve_range(dev, root->segment, res_pem);


Looks like I screwed up PEM resource size for reservation. We cannot 
reserve full 16M here since devices will not able to request their 
resources later on:
pcieport 0004:1f:00.0: can't enable device: BAR 0 [mem 
0x87e0c0f00000-0x87e0c0ffffff 64bit] not claimed

SZ_64K is what we need to reserve.

Bjorn can you please apply below fix:

@@ -327,21 +327,20 @@ static void thunder_pem_legacy_fw(struct 
acpi_pci_root *root,
  	int node = acpi_get_node(root->device->handle);
  	int index;

  	if (node == NUMA_NO_NODE)
  		node = 0;

  	index = root->segment - PEM_MIN_DOM_IN_NODE;
  	index -= node * PEM_MAX_DOM_IN_NODE;
  	res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) |
  					FIELD_PREP(PEM_INDX_MASK, index);
-	res_pem->end = res_pem->start + SZ_16M - 1;
  	res_pem->flags = IORESOURCE_MEM;
  }

  static int thunder_pem_acpi_init(struct pci_config_window *cfg)
  {
  	struct device *dev = cfg->parent;
  	struct acpi_device *adev = to_acpi_device(dev);
  	struct acpi_pci_root *root = acpi_driver_data(adev);
  	struct resource *res_pem;
  	int ret;
@@ -351,22 +350,29 @@ static int thunder_pem_acpi_init(struct 
pci_config_window *cfg)
  		return -ENOMEM;

  	ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem);

  	/*
  	 * If we fail to gather resources it means that we run with old
  	 * FW where we need to calculate PEM-specific resources manually.
  	 */
  	if (ret) {
  		thunder_pem_legacy_fw(root, res_pem);
-		/* Reserve PEM specific resources and PCI configuration space */
+		/*
+		 * Reserve 64K size PEM specific resources. The full 16M range
+		 * size is required for thunder_pem_init() call.
+		 */
+		res_pem->end = res_pem->start + SZ_64K - 1;
  		thunder_pem_reserve_range(dev, root->segment, res_pem);
+		res_pem->end = res_pem->start + SZ_16M - 1;
+
+		/* and PCI configuration space */
  		thunder_pem_reserve_range(dev, root->segment, &cfg->res);
  	}

  	return thunder_pem_init(dev, cfg, res_pem);
  }

My apology for not paying attention.

Thanks,
Tomasz

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

* Re: [PATCH 2/2] PCI: Add legacy firmware support for Cavium ThunderX host controller
@ 2017-03-24 15:55     ` Tomasz Nowicki
  0 siblings, 0 replies; 24+ messages in thread
From: Tomasz Nowicki @ 2017-03-24 15:55 UTC (permalink / raw)
  To: helgaas, Lorenzo.Pieralisi, robert.richter, ddaney,
	Vadim.Lomovtsev, rafael
  Cc: Sunil.Goutham, geethasowjanya.akula, linu.cherian, linux-pci,
	linux-arm-kernel, linux-acpi

On 15.03.2017 08:49, Tomasz Nowicki wrote:
> During early days of PCI quirks support ThunderX firmware did not provide
> PNP0c02 node with PCI configuration space and PEM-specific register ranges.
> This means that for legacy FW we are not reserving these resources and
> cannot gather PEM-specific resources for further PEM initialization.
>
> In order to support already deployed legacy FW calculate PEM-specific ranges
> and provide resources reservation as fallback scenario into PEM driver when
> we could not gather PEM reg base from ACPI tables.
>
> Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
> Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
> ---
>  drivers/pci/host/pci-thunder-pem.c | 56 ++++++++++++++++++++++++++++++++++++--
>  1 file changed, 54 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/host/pci-thunder-pem.c b/drivers/pci/host/pci-thunder-pem.c
> index e354010..e0aa194 100644
> --- a/drivers/pci/host/pci-thunder-pem.c
> +++ b/drivers/pci/host/pci-thunder-pem.c
> @@ -14,6 +14,7 @@
>   * Copyright (C) 2015 - 2016 Cavium, Inc.
>   */
>
> +#include <linux/bitfield.h>
>  #include <linux/kernel.h>
>  #include <linux/init.h>
>  #include <linux/of_address.h>
> @@ -319,6 +320,50 @@ static int thunder_pem_init(struct device *dev, struct pci_config_window *cfg,
>
>  #if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)
>
> +#define PEM_RES_BASE		0x87e0c0000000UL
> +#define PEM_NODE_MASK		GENMASK(45, 44)
> +#define PEM_INDX_MASK		GENMASK(26, 24)
> +#define PEM_MIN_DOM_IN_NODE	4
> +#define PEM_MAX_DOM_IN_NODE	10
> +
> +static void thunder_pem_reserve_range(struct device *dev, int seg,
> +				      struct resource *r)
> +{
> +	resource_size_t start = r->start, end = r->end;
> +	struct resource *res;
> +	const char *regionid;
> +
> +	regionid = kasprintf(GFP_KERNEL, "PEM RC:%d", seg);
> +	if (!regionid)
> +		return;
> +
> +	res = request_mem_region(start, end - start + 1, regionid);
> +	if (res)
> +		res->flags &= ~IORESOURCE_BUSY;
> +	else
> +		kfree(regionid);
> +
> +	dev_info(dev, "%pR %s reserved\n", r,
> +		 res ? "has been" : "could not be");
> +}
> +
> +static void thunder_pem_legacy_fw(struct acpi_pci_root *root,
> +				 struct resource *res_pem)
> +{
> +	int node = acpi_get_node(root->device->handle);
> +	int index;
> +
> +	if (node == NUMA_NO_NODE)
> +		node = 0;
> +
> +	index = root->segment - PEM_MIN_DOM_IN_NODE;
> +	index -= node * PEM_MAX_DOM_IN_NODE;
> +	res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) |
> +					FIELD_PREP(PEM_INDX_MASK, index);
> +	res_pem->end = res_pem->start + SZ_16M - 1;
> +	res_pem->flags = IORESOURCE_MEM;
> +}
> +
>  static int thunder_pem_acpi_init(struct pci_config_window *cfg)
>  {
>  	struct device *dev = cfg->parent;
> @@ -332,9 +377,16 @@ static int thunder_pem_acpi_init(struct pci_config_window *cfg)
>  		return -ENOMEM;
>
>  	ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem);
> +
> +	/*
> +	 * If we fail to gather resources it means that we run with old
> +	 * FW where we need to calculate PEM-specific resources manually.
> +	 */
>  	if (ret) {
> -		dev_err(dev, "can't get rc base address\n");
> -		return ret;
> +		thunder_pem_legacy_fw(root, res_pem);
> +		/* Reserve PEM specific resources and PCI configuration space */
> +		thunder_pem_reserve_range(dev, root->segment, res_pem);


Looks like I screwed up PEM resource size for reservation. We cannot 
reserve full 16M here since devices will not able to request their 
resources later on:
pcieport 0004:1f:00.0: can't enable device: BAR 0 [mem 
0x87e0c0f00000-0x87e0c0ffffff 64bit] not claimed

SZ_64K is what we need to reserve.

Bjorn can you please apply below fix:

@@ -327,21 +327,20 @@ static void thunder_pem_legacy_fw(struct 
acpi_pci_root *root,
  	int node = acpi_get_node(root->device->handle);
  	int index;

  	if (node == NUMA_NO_NODE)
  		node = 0;

  	index = root->segment - PEM_MIN_DOM_IN_NODE;
  	index -= node * PEM_MAX_DOM_IN_NODE;
  	res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) |
  					FIELD_PREP(PEM_INDX_MASK, index);
-	res_pem->end = res_pem->start + SZ_16M - 1;
  	res_pem->flags = IORESOURCE_MEM;
  }

  static int thunder_pem_acpi_init(struct pci_config_window *cfg)
  {
  	struct device *dev = cfg->parent;
  	struct acpi_device *adev = to_acpi_device(dev);
  	struct acpi_pci_root *root = acpi_driver_data(adev);
  	struct resource *res_pem;
  	int ret;
@@ -351,22 +350,29 @@ static int thunder_pem_acpi_init(struct 
pci_config_window *cfg)
  		return -ENOMEM;

  	ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem);

  	/*
  	 * If we fail to gather resources it means that we run with old
  	 * FW where we need to calculate PEM-specific resources manually.
  	 */
  	if (ret) {
  		thunder_pem_legacy_fw(root, res_pem);
-		/* Reserve PEM specific resources and PCI configuration space */
+		/*
+		 * Reserve 64K size PEM specific resources. The full 16M range
+		 * size is required for thunder_pem_init() call.
+		 */
+		res_pem->end = res_pem->start + SZ_64K - 1;
  		thunder_pem_reserve_range(dev, root->segment, res_pem);
+		res_pem->end = res_pem->start + SZ_16M - 1;
+
+		/* and PCI configuration space */
  		thunder_pem_reserve_range(dev, root->segment, &cfg->res);
  	}

  	return thunder_pem_init(dev, cfg, res_pem);
  }

My apology for not paying attention.

Thanks,
Tomasz

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

* [PATCH 2/2] PCI: Add legacy firmware support for Cavium ThunderX host controller
@ 2017-03-24 15:55     ` Tomasz Nowicki
  0 siblings, 0 replies; 24+ messages in thread
From: Tomasz Nowicki @ 2017-03-24 15:55 UTC (permalink / raw)
  To: linux-arm-kernel

On 15.03.2017 08:49, Tomasz Nowicki wrote:
> During early days of PCI quirks support ThunderX firmware did not provide
> PNP0c02 node with PCI configuration space and PEM-specific register ranges.
> This means that for legacy FW we are not reserving these resources and
> cannot gather PEM-specific resources for further PEM initialization.
>
> In order to support already deployed legacy FW calculate PEM-specific ranges
> and provide resources reservation as fallback scenario into PEM driver when
> we could not gather PEM reg base from ACPI tables.
>
> Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
> Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
> ---
>  drivers/pci/host/pci-thunder-pem.c | 56 ++++++++++++++++++++++++++++++++++++--
>  1 file changed, 54 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/host/pci-thunder-pem.c b/drivers/pci/host/pci-thunder-pem.c
> index e354010..e0aa194 100644
> --- a/drivers/pci/host/pci-thunder-pem.c
> +++ b/drivers/pci/host/pci-thunder-pem.c
> @@ -14,6 +14,7 @@
>   * Copyright (C) 2015 - 2016 Cavium, Inc.
>   */
>
> +#include <linux/bitfield.h>
>  #include <linux/kernel.h>
>  #include <linux/init.h>
>  #include <linux/of_address.h>
> @@ -319,6 +320,50 @@ static int thunder_pem_init(struct device *dev, struct pci_config_window *cfg,
>
>  #if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)
>
> +#define PEM_RES_BASE		0x87e0c0000000UL
> +#define PEM_NODE_MASK		GENMASK(45, 44)
> +#define PEM_INDX_MASK		GENMASK(26, 24)
> +#define PEM_MIN_DOM_IN_NODE	4
> +#define PEM_MAX_DOM_IN_NODE	10
> +
> +static void thunder_pem_reserve_range(struct device *dev, int seg,
> +				      struct resource *r)
> +{
> +	resource_size_t start = r->start, end = r->end;
> +	struct resource *res;
> +	const char *regionid;
> +
> +	regionid = kasprintf(GFP_KERNEL, "PEM RC:%d", seg);
> +	if (!regionid)
> +		return;
> +
> +	res = request_mem_region(start, end - start + 1, regionid);
> +	if (res)
> +		res->flags &= ~IORESOURCE_BUSY;
> +	else
> +		kfree(regionid);
> +
> +	dev_info(dev, "%pR %s reserved\n", r,
> +		 res ? "has been" : "could not be");
> +}
> +
> +static void thunder_pem_legacy_fw(struct acpi_pci_root *root,
> +				 struct resource *res_pem)
> +{
> +	int node = acpi_get_node(root->device->handle);
> +	int index;
> +
> +	if (node == NUMA_NO_NODE)
> +		node = 0;
> +
> +	index = root->segment - PEM_MIN_DOM_IN_NODE;
> +	index -= node * PEM_MAX_DOM_IN_NODE;
> +	res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) |
> +					FIELD_PREP(PEM_INDX_MASK, index);
> +	res_pem->end = res_pem->start + SZ_16M - 1;
> +	res_pem->flags = IORESOURCE_MEM;
> +}
> +
>  static int thunder_pem_acpi_init(struct pci_config_window *cfg)
>  {
>  	struct device *dev = cfg->parent;
> @@ -332,9 +377,16 @@ static int thunder_pem_acpi_init(struct pci_config_window *cfg)
>  		return -ENOMEM;
>
>  	ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem);
> +
> +	/*
> +	 * If we fail to gather resources it means that we run with old
> +	 * FW where we need to calculate PEM-specific resources manually.
> +	 */
>  	if (ret) {
> -		dev_err(dev, "can't get rc base address\n");
> -		return ret;
> +		thunder_pem_legacy_fw(root, res_pem);
> +		/* Reserve PEM specific resources and PCI configuration space */
> +		thunder_pem_reserve_range(dev, root->segment, res_pem);


Looks like I screwed up PEM resource size for reservation. We cannot 
reserve full 16M here since devices will not able to request their 
resources later on:
pcieport 0004:1f:00.0: can't enable device: BAR 0 [mem 
0x87e0c0f00000-0x87e0c0ffffff 64bit] not claimed

SZ_64K is what we need to reserve.

Bjorn can you please apply below fix:

@@ -327,21 +327,20 @@ static void thunder_pem_legacy_fw(struct 
acpi_pci_root *root,
  	int node = acpi_get_node(root->device->handle);
  	int index;

  	if (node == NUMA_NO_NODE)
  		node = 0;

  	index = root->segment - PEM_MIN_DOM_IN_NODE;
  	index -= node * PEM_MAX_DOM_IN_NODE;
  	res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) |
  					FIELD_PREP(PEM_INDX_MASK, index);
-	res_pem->end = res_pem->start + SZ_16M - 1;
  	res_pem->flags = IORESOURCE_MEM;
  }

  static int thunder_pem_acpi_init(struct pci_config_window *cfg)
  {
  	struct device *dev = cfg->parent;
  	struct acpi_device *adev = to_acpi_device(dev);
  	struct acpi_pci_root *root = acpi_driver_data(adev);
  	struct resource *res_pem;
  	int ret;
@@ -351,22 +350,29 @@ static int thunder_pem_acpi_init(struct 
pci_config_window *cfg)
  		return -ENOMEM;

  	ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem);

  	/*
  	 * If we fail to gather resources it means that we run with old
  	 * FW where we need to calculate PEM-specific resources manually.
  	 */
  	if (ret) {
  		thunder_pem_legacy_fw(root, res_pem);
-		/* Reserve PEM specific resources and PCI configuration space */
+		/*
+		 * Reserve 64K size PEM specific resources. The full 16M range
+		 * size is required for thunder_pem_init() call.
+		 */
+		res_pem->end = res_pem->start + SZ_64K - 1;
  		thunder_pem_reserve_range(dev, root->segment, res_pem);
+		res_pem->end = res_pem->start + SZ_16M - 1;
+
+		/* and PCI configuration space */
  		thunder_pem_reserve_range(dev, root->segment, &cfg->res);
  	}

  	return thunder_pem_init(dev, cfg, res_pem);
  }

My apology for not paying attention.

Thanks,
Tomasz

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

* [PATCH 2/2] PCI: Add legacy firmware support for Cavium ThunderX host controller
  2017-03-15  7:49   ` Tomasz Nowicki
@ 2017-03-28 19:21     ` Tomasz Nowicki
  -1 siblings, 0 replies; 24+ messages in thread
From: Tomasz Nowicki @ 2017-03-28 19:21 UTC (permalink / raw)
  To: helgaas, Lorenzo.Pieralisi, robert.richter, ddaney,
	Vadim.Lomovtsev, rafael
  Cc: Sunil.Goutham, geethasowjanya.akula, linu.cherian, linux-pci,
	linux-arm-kernel, linux-acpi, Tomasz Nowicki

During early days of PCI quirks support ThunderX firmware did not provide
PNP0c02 node with PCI configuration space and PEM-specific register ranges.
This means that for legacy FW we are not reserving these resources and
cannot gather PEM-specific resources for further PEM initialization.

In order to support already deployed legacy FW calculate PEM-specific ranges
and provide resources reservation as fallback scenario into PEM driver when
we could not gather PEM reg base from ACPI tables.

Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
---
 drivers/pci/host/pci-thunder-pem.c | 62 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 60 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pci-thunder-pem.c b/drivers/pci/host/pci-thunder-pem.c
index e354010..cea5814 100644
--- a/drivers/pci/host/pci-thunder-pem.c
+++ b/drivers/pci/host/pci-thunder-pem.c
@@ -14,6 +14,7 @@
  * Copyright (C) 2015 - 2016 Cavium, Inc.
  */
 
+#include <linux/bitfield.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/of_address.h>
@@ -319,6 +320,49 @@ static int thunder_pem_init(struct device *dev, struct pci_config_window *cfg,
 
 #if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)
 
+#define PEM_RES_BASE		0x87e0c0000000UL
+#define PEM_NODE_MASK		GENMASK(45, 44)
+#define PEM_INDX_MASK		GENMASK(26, 24)
+#define PEM_MIN_DOM_IN_NODE	4
+#define PEM_MAX_DOM_IN_NODE	10
+
+static void thunder_pem_reserve_range(struct device *dev, int seg,
+				      struct resource *r)
+{
+	resource_size_t start = r->start, end = r->end;
+	struct resource *res;
+	const char *regionid;
+
+	regionid = kasprintf(GFP_KERNEL, "PEM RC:%d", seg);
+	if (!regionid)
+		return;
+
+	res = request_mem_region(start, end - start + 1, regionid);
+	if (res)
+		res->flags &= ~IORESOURCE_BUSY;
+	else
+		kfree(regionid);
+
+	dev_info(dev, "%pR %s reserved\n", r,
+		 res ? "has been" : "could not be");
+}
+
+static void thunder_pem_legacy_fw(struct acpi_pci_root *root,
+				 struct resource *res_pem)
+{
+	int node = acpi_get_node(root->device->handle);
+	int index;
+
+	if (node == NUMA_NO_NODE)
+		node = 0;
+
+	index = root->segment - PEM_MIN_DOM_IN_NODE;
+	index -= node * PEM_MAX_DOM_IN_NODE;
+	res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) |
+					FIELD_PREP(PEM_INDX_MASK, index);
+	res_pem->flags = IORESOURCE_MEM;
+}
+
 static int thunder_pem_acpi_init(struct pci_config_window *cfg)
 {
 	struct device *dev = cfg->parent;
@@ -332,9 +376,23 @@ static int thunder_pem_acpi_init(struct pci_config_window *cfg)
 		return -ENOMEM;
 
 	ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem);
+
+	/*
+	 * If we fail to gather resources it means that we run with old
+	 * FW where we need to calculate PEM-specific resources manually.
+	 */
 	if (ret) {
-		dev_err(dev, "can't get rc base address\n");
-		return ret;
+		thunder_pem_legacy_fw(root, res_pem);
+		/*
+		 * Reserve 64K size PEM specific resources. The full 16M range
+		 * size is required for thunder_pem_init() call.
+		 */
+		res_pem->end = res_pem->start + SZ_64K - 1;
+		thunder_pem_reserve_range(dev, root->segment, res_pem);
+		res_pem->end = res_pem->start + SZ_16M - 1;
+
+		/* Reserve PCI configuration space as well. */
+		thunder_pem_reserve_range(dev, root->segment, &cfg->res);
 	}
 
 	return thunder_pem_init(dev, cfg, res_pem);
-- 
2.7.4

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

* [PATCH 2/2] PCI: Add legacy firmware support for Cavium ThunderX host controller
@ 2017-03-28 19:21     ` Tomasz Nowicki
  0 siblings, 0 replies; 24+ messages in thread
From: Tomasz Nowicki @ 2017-03-28 19:21 UTC (permalink / raw)
  To: linux-arm-kernel

During early days of PCI quirks support ThunderX firmware did not provide
PNP0c02 node with PCI configuration space and PEM-specific register ranges.
This means that for legacy FW we are not reserving these resources and
cannot gather PEM-specific resources for further PEM initialization.

In order to support already deployed legacy FW calculate PEM-specific ranges
and provide resources reservation as fallback scenario into PEM driver when
we could not gather PEM reg base from ACPI tables.

Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
---
 drivers/pci/host/pci-thunder-pem.c | 62 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 60 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pci-thunder-pem.c b/drivers/pci/host/pci-thunder-pem.c
index e354010..cea5814 100644
--- a/drivers/pci/host/pci-thunder-pem.c
+++ b/drivers/pci/host/pci-thunder-pem.c
@@ -14,6 +14,7 @@
  * Copyright (C) 2015 - 2016 Cavium, Inc.
  */
 
+#include <linux/bitfield.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/of_address.h>
@@ -319,6 +320,49 @@ static int thunder_pem_init(struct device *dev, struct pci_config_window *cfg,
 
 #if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)
 
+#define PEM_RES_BASE		0x87e0c0000000UL
+#define PEM_NODE_MASK		GENMASK(45, 44)
+#define PEM_INDX_MASK		GENMASK(26, 24)
+#define PEM_MIN_DOM_IN_NODE	4
+#define PEM_MAX_DOM_IN_NODE	10
+
+static void thunder_pem_reserve_range(struct device *dev, int seg,
+				      struct resource *r)
+{
+	resource_size_t start = r->start, end = r->end;
+	struct resource *res;
+	const char *regionid;
+
+	regionid = kasprintf(GFP_KERNEL, "PEM RC:%d", seg);
+	if (!regionid)
+		return;
+
+	res = request_mem_region(start, end - start + 1, regionid);
+	if (res)
+		res->flags &= ~IORESOURCE_BUSY;
+	else
+		kfree(regionid);
+
+	dev_info(dev, "%pR %s reserved\n", r,
+		 res ? "has been" : "could not be");
+}
+
+static void thunder_pem_legacy_fw(struct acpi_pci_root *root,
+				 struct resource *res_pem)
+{
+	int node = acpi_get_node(root->device->handle);
+	int index;
+
+	if (node == NUMA_NO_NODE)
+		node = 0;
+
+	index = root->segment - PEM_MIN_DOM_IN_NODE;
+	index -= node * PEM_MAX_DOM_IN_NODE;
+	res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) |
+					FIELD_PREP(PEM_INDX_MASK, index);
+	res_pem->flags = IORESOURCE_MEM;
+}
+
 static int thunder_pem_acpi_init(struct pci_config_window *cfg)
 {
 	struct device *dev = cfg->parent;
@@ -332,9 +376,23 @@ static int thunder_pem_acpi_init(struct pci_config_window *cfg)
 		return -ENOMEM;
 
 	ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem);
+
+	/*
+	 * If we fail to gather resources it means that we run with old
+	 * FW where we need to calculate PEM-specific resources manually.
+	 */
 	if (ret) {
-		dev_err(dev, "can't get rc base address\n");
-		return ret;
+		thunder_pem_legacy_fw(root, res_pem);
+		/*
+		 * Reserve 64K size PEM specific resources. The full 16M range
+		 * size is required for thunder_pem_init() call.
+		 */
+		res_pem->end = res_pem->start + SZ_64K - 1;
+		thunder_pem_reserve_range(dev, root->segment, res_pem);
+		res_pem->end = res_pem->start + SZ_16M - 1;
+
+		/* Reserve PCI configuration space as well. */
+		thunder_pem_reserve_range(dev, root->segment, &cfg->res);
 	}
 
 	return thunder_pem_init(dev, cfg, res_pem);
-- 
2.7.4

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

* Re: [PATCH 2/2] PCI: Add legacy firmware support for Cavium ThunderX host controller
  2017-03-28 19:21     ` Tomasz Nowicki
@ 2017-03-28 19:28       ` Tomasz Nowicki
  -1 siblings, 0 replies; 24+ messages in thread
From: Tomasz Nowicki @ 2017-03-28 19:28 UTC (permalink / raw)
  To: helgaas
  Cc: Lorenzo.Pieralisi, robert.richter, ddaney, Vadim.Lomovtsev,
	rafael, Sunil.Goutham, geethasowjanya.akula, linu.cherian,
	linux-pci, linux-arm-kernel, linux-acpi

Hi Bjorn,

Here is a complete patch to avoid manual patching. Please have a look 
and let me know if it is OK.

Thanks,
Tomasz

On 28.03.2017 21:21, Tomasz Nowicki wrote:
> During early days of PCI quirks support ThunderX firmware did not provide
> PNP0c02 node with PCI configuration space and PEM-specific register ranges.
> This means that for legacy FW we are not reserving these resources and
> cannot gather PEM-specific resources for further PEM initialization.
>
> In order to support already deployed legacy FW calculate PEM-specific ranges
> and provide resources reservation as fallback scenario into PEM driver when
> we could not gather PEM reg base from ACPI tables.
>
> Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
> Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
> ---
>  drivers/pci/host/pci-thunder-pem.c | 62 ++++++++++++++++++++++++++++++++++++--
>  1 file changed, 60 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/host/pci-thunder-pem.c b/drivers/pci/host/pci-thunder-pem.c
> index e354010..cea5814 100644
> --- a/drivers/pci/host/pci-thunder-pem.c
> +++ b/drivers/pci/host/pci-thunder-pem.c
> @@ -14,6 +14,7 @@
>   * Copyright (C) 2015 - 2016 Cavium, Inc.
>   */
>
> +#include <linux/bitfield.h>
>  #include <linux/kernel.h>
>  #include <linux/init.h>
>  #include <linux/of_address.h>
> @@ -319,6 +320,49 @@ static int thunder_pem_init(struct device *dev, struct pci_config_window *cfg,
>
>  #if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)
>
> +#define PEM_RES_BASE		0x87e0c0000000UL
> +#define PEM_NODE_MASK		GENMASK(45, 44)
> +#define PEM_INDX_MASK		GENMASK(26, 24)
> +#define PEM_MIN_DOM_IN_NODE	4
> +#define PEM_MAX_DOM_IN_NODE	10
> +
> +static void thunder_pem_reserve_range(struct device *dev, int seg,
> +				      struct resource *r)
> +{
> +	resource_size_t start = r->start, end = r->end;
> +	struct resource *res;
> +	const char *regionid;
> +
> +	regionid = kasprintf(GFP_KERNEL, "PEM RC:%d", seg);
> +	if (!regionid)
> +		return;
> +
> +	res = request_mem_region(start, end - start + 1, regionid);
> +	if (res)
> +		res->flags &= ~IORESOURCE_BUSY;
> +	else
> +		kfree(regionid);
> +
> +	dev_info(dev, "%pR %s reserved\n", r,
> +		 res ? "has been" : "could not be");
> +}
> +
> +static void thunder_pem_legacy_fw(struct acpi_pci_root *root,
> +				 struct resource *res_pem)
> +{
> +	int node = acpi_get_node(root->device->handle);
> +	int index;
> +
> +	if (node == NUMA_NO_NODE)
> +		node = 0;
> +
> +	index = root->segment - PEM_MIN_DOM_IN_NODE;
> +	index -= node * PEM_MAX_DOM_IN_NODE;
> +	res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) |
> +					FIELD_PREP(PEM_INDX_MASK, index);
> +	res_pem->flags = IORESOURCE_MEM;
> +}
> +
>  static int thunder_pem_acpi_init(struct pci_config_window *cfg)
>  {
>  	struct device *dev = cfg->parent;
> @@ -332,9 +376,23 @@ static int thunder_pem_acpi_init(struct pci_config_window *cfg)
>  		return -ENOMEM;
>
>  	ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem);
> +
> +	/*
> +	 * If we fail to gather resources it means that we run with old
> +	 * FW where we need to calculate PEM-specific resources manually.
> +	 */
>  	if (ret) {
> -		dev_err(dev, "can't get rc base address\n");
> -		return ret;
> +		thunder_pem_legacy_fw(root, res_pem);
> +		/*
> +		 * Reserve 64K size PEM specific resources. The full 16M range
> +		 * size is required for thunder_pem_init() call.
> +		 */
> +		res_pem->end = res_pem->start + SZ_64K - 1;
> +		thunder_pem_reserve_range(dev, root->segment, res_pem);
> +		res_pem->end = res_pem->start + SZ_16M - 1;
> +
> +		/* Reserve PCI configuration space as well. */
> +		thunder_pem_reserve_range(dev, root->segment, &cfg->res);
>  	}
>
>  	return thunder_pem_init(dev, cfg, res_pem);
>


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

* [PATCH 2/2] PCI: Add legacy firmware support for Cavium ThunderX host controller
@ 2017-03-28 19:28       ` Tomasz Nowicki
  0 siblings, 0 replies; 24+ messages in thread
From: Tomasz Nowicki @ 2017-03-28 19:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Bjorn,

Here is a complete patch to avoid manual patching. Please have a look 
and let me know if it is OK.

Thanks,
Tomasz

On 28.03.2017 21:21, Tomasz Nowicki wrote:
> During early days of PCI quirks support ThunderX firmware did not provide
> PNP0c02 node with PCI configuration space and PEM-specific register ranges.
> This means that for legacy FW we are not reserving these resources and
> cannot gather PEM-specific resources for further PEM initialization.
>
> In order to support already deployed legacy FW calculate PEM-specific ranges
> and provide resources reservation as fallback scenario into PEM driver when
> we could not gather PEM reg base from ACPI tables.
>
> Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
> Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
> ---
>  drivers/pci/host/pci-thunder-pem.c | 62 ++++++++++++++++++++++++++++++++++++--
>  1 file changed, 60 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/host/pci-thunder-pem.c b/drivers/pci/host/pci-thunder-pem.c
> index e354010..cea5814 100644
> --- a/drivers/pci/host/pci-thunder-pem.c
> +++ b/drivers/pci/host/pci-thunder-pem.c
> @@ -14,6 +14,7 @@
>   * Copyright (C) 2015 - 2016 Cavium, Inc.
>   */
>
> +#include <linux/bitfield.h>
>  #include <linux/kernel.h>
>  #include <linux/init.h>
>  #include <linux/of_address.h>
> @@ -319,6 +320,49 @@ static int thunder_pem_init(struct device *dev, struct pci_config_window *cfg,
>
>  #if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)
>
> +#define PEM_RES_BASE		0x87e0c0000000UL
> +#define PEM_NODE_MASK		GENMASK(45, 44)
> +#define PEM_INDX_MASK		GENMASK(26, 24)
> +#define PEM_MIN_DOM_IN_NODE	4
> +#define PEM_MAX_DOM_IN_NODE	10
> +
> +static void thunder_pem_reserve_range(struct device *dev, int seg,
> +				      struct resource *r)
> +{
> +	resource_size_t start = r->start, end = r->end;
> +	struct resource *res;
> +	const char *regionid;
> +
> +	regionid = kasprintf(GFP_KERNEL, "PEM RC:%d", seg);
> +	if (!regionid)
> +		return;
> +
> +	res = request_mem_region(start, end - start + 1, regionid);
> +	if (res)
> +		res->flags &= ~IORESOURCE_BUSY;
> +	else
> +		kfree(regionid);
> +
> +	dev_info(dev, "%pR %s reserved\n", r,
> +		 res ? "has been" : "could not be");
> +}
> +
> +static void thunder_pem_legacy_fw(struct acpi_pci_root *root,
> +				 struct resource *res_pem)
> +{
> +	int node = acpi_get_node(root->device->handle);
> +	int index;
> +
> +	if (node == NUMA_NO_NODE)
> +		node = 0;
> +
> +	index = root->segment - PEM_MIN_DOM_IN_NODE;
> +	index -= node * PEM_MAX_DOM_IN_NODE;
> +	res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) |
> +					FIELD_PREP(PEM_INDX_MASK, index);
> +	res_pem->flags = IORESOURCE_MEM;
> +}
> +
>  static int thunder_pem_acpi_init(struct pci_config_window *cfg)
>  {
>  	struct device *dev = cfg->parent;
> @@ -332,9 +376,23 @@ static int thunder_pem_acpi_init(struct pci_config_window *cfg)
>  		return -ENOMEM;
>
>  	ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem);
> +
> +	/*
> +	 * If we fail to gather resources it means that we run with old
> +	 * FW where we need to calculate PEM-specific resources manually.
> +	 */
>  	if (ret) {
> -		dev_err(dev, "can't get rc base address\n");
> -		return ret;
> +		thunder_pem_legacy_fw(root, res_pem);
> +		/*
> +		 * Reserve 64K size PEM specific resources. The full 16M range
> +		 * size is required for thunder_pem_init() call.
> +		 */
> +		res_pem->end = res_pem->start + SZ_64K - 1;
> +		thunder_pem_reserve_range(dev, root->segment, res_pem);
> +		res_pem->end = res_pem->start + SZ_16M - 1;
> +
> +		/* Reserve PCI configuration space as well. */
> +		thunder_pem_reserve_range(dev, root->segment, &cfg->res);
>  	}
>
>  	return thunder_pem_init(dev, cfg, res_pem);
>

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

end of thread, other threads:[~2017-03-28 19:29 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-15  7:49 [PATCH 0/2] ThunderX external PCI fixes for legacy&new ACPI firmware Tomasz Nowicki
2017-03-15  7:49 ` Tomasz Nowicki
2017-03-15  7:49 ` [PATCH 1/2] PCI: Use Cavium assigned hardware ID for ThunderX host controller Tomasz Nowicki
2017-03-15  7:49   ` Tomasz Nowicki
2017-03-20 10:49   ` Robert Richter
2017-03-20 10:49     ` Robert Richter
2017-03-20 10:49     ` Robert Richter
2017-03-15  7:49 ` [PATCH 2/2] PCI: Add legacy firmware support for Cavium " Tomasz Nowicki
2017-03-15  7:49   ` Tomasz Nowicki
2017-03-20 11:02   ` Robert Richter
2017-03-20 11:02     ` Robert Richter
2017-03-20 11:02     ` Robert Richter
2017-03-24 15:55   ` Tomasz Nowicki
2017-03-24 15:55     ` Tomasz Nowicki
2017-03-24 15:55     ` Tomasz Nowicki
2017-03-28 19:21   ` Tomasz Nowicki
2017-03-28 19:21     ` Tomasz Nowicki
2017-03-28 19:28     ` Tomasz Nowicki
2017-03-28 19:28       ` Tomasz Nowicki
2017-03-21 17:43 ` [PATCH 0/2] ThunderX external PCI fixes for legacy&new ACPI firmware Bjorn Helgaas
2017-03-21 17:43   ` Bjorn Helgaas
2017-03-21 17:43   ` Bjorn Helgaas
2017-03-22 14:19   ` Tomasz Nowicki
2017-03-22 14:19     ` Tomasz Nowicki

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.