linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
@ 2015-10-02 10:25 Phil Edworthy
  2015-10-02 10:25 ` [PATCH 1/4] PCI: rcar-pcie: Make PCI aware of the IO resources Phil Edworthy
                   ` (6 more replies)
  0 siblings, 7 replies; 28+ messages in thread
From: Phil Edworthy @ 2015-10-02 10:25 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Simon Horman, Nobuhiro Iwamatsu, Geert Uytterhoeven, linux-pci,
	linux-sh, linux-kernel, Phil Edworthy

Fixes and changes to get PCIe working on ARM64 with mulitple instances.

I've tested these on ARM (Koelsch board), and it works fine.
I've also tested on ARM64 (Salvator-X board), but I currently have an issue
with inbound PCI accesses. I am reasonably sure that this problem is hardware
related.

Phil Edworthy (4):
  PCI: rcar-pcie: Make PCI aware of the IO resources
  PCI: rcar-pcie: Remove dependency on ARM-specific struct hw_pci
  PCI: rcar-pcie: Set root bus nr to that provided in DT
  PCI: rcar-pcie: Fix IO offset for multiple instances

 drivers/pci/host/pcie-rcar.c | 86 ++++++++++++++++++++++++++++----------------
 1 file changed, 55 insertions(+), 31 deletions(-)

-- 
1.9.1


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

* [PATCH 1/4] PCI: rcar-pcie: Make PCI aware of the IO resources
  2015-10-02 10:25 [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances Phil Edworthy
@ 2015-10-02 10:25 ` Phil Edworthy
  2015-10-02 10:25 ` [PATCH 2/4] PCI: rcar-pcie: Remove dependency on ARM-specific struct hw_pci Phil Edworthy
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 28+ messages in thread
From: Phil Edworthy @ 2015-10-02 10:25 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Simon Horman, Nobuhiro Iwamatsu, Geert Uytterhoeven, linux-pci,
	linux-sh, linux-kernel, Phil Edworthy

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
---
 drivers/pci/host/pcie-rcar.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index 7678fe0..27e2c20 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -373,8 +373,9 @@ static int rcar_pcie_setup(int nr, struct pci_sys_data *sys)
 		if (res->flags & IORESOURCE_IO) {
 			phys_addr_t io_start = pci_pio_to_address(res->start);
 			pci_ioremap_io(nr * SZ_64K, io_start);
-		} else
-			pci_add_resource(&sys->resources, res);
+		}
+
+		pci_add_resource(&sys->resources, res);
 	}
 	pci_add_resource(&sys->resources, &pcie->busn);
 
-- 
1.9.1


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

* [PATCH 2/4] PCI: rcar-pcie: Remove dependency on ARM-specific struct hw_pci
  2015-10-02 10:25 [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances Phil Edworthy
  2015-10-02 10:25 ` [PATCH 1/4] PCI: rcar-pcie: Make PCI aware of the IO resources Phil Edworthy
@ 2015-10-02 10:25 ` Phil Edworthy
  2015-10-16 21:34   ` Bjorn Helgaas
  2015-10-02 10:25 ` [PATCH 3/4] PCI: rcar-pcie: Set root bus nr to that provided in DT Phil Edworthy
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 28+ messages in thread
From: Phil Edworthy @ 2015-10-02 10:25 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Simon Horman, Nobuhiro Iwamatsu, Geert Uytterhoeven, linux-pci,
	linux-sh, linux-kernel, Phil Edworthy

The R-Car PCIe host controller driver uses pci_common_init_dev(),
which is ARM-specific and requires the ARM struct hw_pci. The part of
pci_common_init_dev() that is needed is limited and can be done here
without using hw_pci.

Note that the ARM pcibios functions expect the PCI sysdata to be a pointer
to a struct pci_sys_data. Add a struct pci_sys_data as the first element
in struct gen_pci so that when we use a gen_pci pointer as sysdata, it is
also a pointer to a struct pci_sys_data.

Create and scan the root bus directly without using the ARM
pci_common_init_dev() interface.

This change is based on commit <499733e0cc1a00523c5056a690f65dea7b9da140>
"PCI: generic: Remove dependency on ARM-specific struct hw_pci".

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
---
 drivers/pci/host/pcie-rcar.c | 76 ++++++++++++++++++++++++++++----------------
 1 file changed, 48 insertions(+), 28 deletions(-)

diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index 27e2c20..6057e31 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -124,7 +124,16 @@ static inline struct rcar_msi *to_rcar_msi(struct msi_controller *chip)
 }
 
 /* Structure representing the PCIe interface */
+/*
+ * ARM pcibios functions expect the ARM struct pci_sys_data as the PCI
+ * sysdata.  Add pci_sys_data as the first element in struct gen_pci so
+ * that when we use a gen_pci pointer as sysdata, it is also a pointer to
+ * a struct pci_sys_data.
+ */
 struct rcar_pcie {
+#ifdef CONFIG_ARM
+	struct pci_sys_data	sys;
+#endif
 	struct device		*dev;
 	void __iomem		*base;
 	struct resource		res[RCAR_PCI_MAX_RESOURCES];
@@ -135,11 +144,6 @@ struct rcar_pcie {
 	struct			rcar_msi msi;
 };
 
-static inline struct rcar_pcie *sys_to_pcie(struct pci_sys_data *sys)
-{
-	return sys->private_data;
-}
-
 static void rcar_pci_write_reg(struct rcar_pcie *pcie, unsigned long val,
 			       unsigned long reg)
 {
@@ -258,7 +262,7 @@ static int rcar_pcie_config_access(struct rcar_pcie *pcie,
 static int rcar_pcie_read_conf(struct pci_bus *bus, unsigned int devfn,
 			       int where, int size, u32 *val)
 {
-	struct rcar_pcie *pcie = sys_to_pcie(bus->sysdata);
+	struct rcar_pcie *pcie = bus->sysdata;
 	int ret;
 
 	ret = rcar_pcie_config_access(pcie, RCAR_PCI_ACCESS_READ,
@@ -283,7 +287,7 @@ static int rcar_pcie_read_conf(struct pci_bus *bus, unsigned int devfn,
 static int rcar_pcie_write_conf(struct pci_bus *bus, unsigned int devfn,
 				int where, int size, u32 val)
 {
-	struct rcar_pcie *pcie = sys_to_pcie(bus->sysdata);
+	struct rcar_pcie *pcie = bus->sysdata;
 	int shift, ret;
 	u32 data;
 
@@ -353,9 +357,8 @@ static void rcar_pcie_setup_window(int win, struct rcar_pcie *pcie)
 	rcar_pci_write_reg(pcie, mask, PCIEPTCTLR(win));
 }
 
-static int rcar_pcie_setup(int nr, struct pci_sys_data *sys)
+static int rcar_pcie_setup(int nr, struct list_head *resource, struct rcar_pcie *pcie)
 {
-	struct rcar_pcie *pcie = sys_to_pcie(sys);
 	struct resource *res;
 	int i;
 
@@ -375,30 +378,49 @@ static int rcar_pcie_setup(int nr, struct pci_sys_data *sys)
 			pci_ioremap_io(nr * SZ_64K, io_start);
 		}
 
-		pci_add_resource(&sys->resources, res);
+		pci_add_resource(resource, res);
 	}
-	pci_add_resource(&sys->resources, &pcie->busn);
+	pci_add_resource(resource, &pcie->busn);
 
 	return 1;
 }
 
-static struct hw_pci rcar_pci = {
-	.setup          = rcar_pcie_setup,
-	.map_irq        = of_irq_parse_and_map_pci,
-	.ops            = &rcar_pcie_ops,
-};
-
-static void rcar_pcie_enable(struct rcar_pcie *pcie)
+static int rcar_pcie_enable(struct rcar_pcie *pcie)
 {
-	struct platform_device *pdev = to_platform_device(pcie->dev);
+	struct pci_bus *bus, *child;
+	LIST_HEAD(res);
 
-	rcar_pci.nr_controllers = 1;
-	rcar_pci.private_data = (void **)&pcie;
-#ifdef CONFIG_PCI_MSI
-	rcar_pci.msi_ctrl = &pcie->msi.chip;
-#endif
+	rcar_pcie_setup(1, &res, pcie);
+
+	/* Do not reassign resources if probe only */
+	if (!pci_has_flag(PCI_PROBE_ONLY))
+		pci_add_flags(PCI_REASSIGN_ALL_RSRC | PCI_REASSIGN_ALL_BUS);
+
+	if (IS_ENABLED(CONFIG_PCI_MSI))
+		bus = pci_scan_root_bus_msi(pcie->dev, pcie->root_bus_nr,
+				&rcar_pcie_ops, pcie, &res, &pcie->msi.chip);
+	else
+		bus = pci_scan_root_bus(pcie->dev, pcie->root_bus_nr,
+				&rcar_pcie_ops, pcie, &res);
+
+	if (!bus) {
+		dev_err(pcie->dev, "Scanning rootbus failed");
+		return -ENODEV;
+	}
+
+	pci_fixup_irqs(pci_common_swizzle, of_irq_parse_and_map_pci);
+
+	if (!pci_has_flag(PCI_PROBE_ONLY)) {
+		pci_bus_size_bridges(bus);
+		pci_bus_assign_resources(bus);
 
-	pci_common_init_dev(&pdev->dev, &rcar_pci);
+		list_for_each_entry(child, &bus->children, node)
+			pcie_bus_configure_settings(child);
+	}
+
+	pci_bus_add_devices(bus);
+
+	return 0;
 }
 
 static int phy_wait_for_ack(struct rcar_pcie *pcie)
@@ -971,9 +993,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)
 	data = rcar_pci_read_reg(pcie, MACSR);
 	dev_info(&pdev->dev, "PCIe x%d: link up\n", (data >> 20) & 0x3f);
 
-	rcar_pcie_enable(pcie);
-
-	return 0;
+	return rcar_pcie_enable(pcie);
 }
 
 static struct platform_driver rcar_pcie_driver = {
-- 
1.9.1


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

* [PATCH 3/4] PCI: rcar-pcie: Set root bus nr to that provided in DT
  2015-10-02 10:25 [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances Phil Edworthy
  2015-10-02 10:25 ` [PATCH 1/4] PCI: rcar-pcie: Make PCI aware of the IO resources Phil Edworthy
  2015-10-02 10:25 ` [PATCH 2/4] PCI: rcar-pcie: Remove dependency on ARM-specific struct hw_pci Phil Edworthy
@ 2015-10-02 10:25 ` Phil Edworthy
  2015-10-02 10:25 ` [PATCH 4/4] PCI: rcar-pcie: Fix IO offset for multiple instances Phil Edworthy
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 28+ messages in thread
From: Phil Edworthy @ 2015-10-02 10:25 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Simon Horman, Nobuhiro Iwamatsu, Geert Uytterhoeven, linux-pci,
	linux-sh, linux-kernel, Phil Edworthy

On ARM64, setting the root bus number to -1 causes probe failure.
Moreover, we should use the bus number specified in the DT as we
could have multiple PCIe controllers with different bus ranges.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
---
 drivers/pci/host/pcie-rcar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index 6057e31..8e583c2 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -362,7 +362,7 @@ static int rcar_pcie_setup(int nr, struct list_head *resource, struct rcar_pcie
 	struct resource *res;
 	int i;
 
-	pcie->root_bus_nr = -1;
+	pcie->root_bus_nr = pcie->busn.start;
 
 	/* Setup PCI resources */
 	for (i = 0; i < RCAR_PCI_MAX_RESOURCES; i++) {
-- 
1.9.1


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

* [PATCH 4/4] PCI: rcar-pcie: Fix IO offset for multiple instances
  2015-10-02 10:25 [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances Phil Edworthy
                   ` (2 preceding siblings ...)
  2015-10-02 10:25 ` [PATCH 3/4] PCI: rcar-pcie: Set root bus nr to that provided in DT Phil Edworthy
@ 2015-10-02 10:25 ` Phil Edworthy
  2015-10-16 21:34 ` [PATCH 0/4] PCI: rcar: Add support for ARM64 and " Bjorn Helgaas
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 28+ messages in thread
From: Phil Edworthy @ 2015-10-02 10:25 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Simon Horman, Nobuhiro Iwamatsu, Geert Uytterhoeven, linux-pci,
	linux-sh, linux-kernel, Phil Edworthy

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
---
 drivers/pci/host/pcie-rcar.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index 8e583c2..f4fa6c5 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -108,6 +108,8 @@
 #define RCAR_PCI_MAX_RESOURCES 4
 #define MAX_NR_INBOUND_MAPS 6
 
+static unsigned long global_io_offset;
+
 struct rcar_msi {
 	DECLARE_BITMAP(used, INT_PCI_MSI_NR);
 	struct irq_domain *domain;
@@ -357,7 +359,7 @@ static void rcar_pcie_setup_window(int win, struct rcar_pcie *pcie)
 	rcar_pci_write_reg(pcie, mask, PCIEPTCTLR(win));
 }
 
-static int rcar_pcie_setup(int nr, struct list_head *resource, struct rcar_pcie *pcie)
+static int rcar_pcie_setup(struct list_head *resource, struct rcar_pcie *pcie)
 {
 	struct resource *res;
 	int i;
@@ -375,7 +377,8 @@ static int rcar_pcie_setup(int nr, struct list_head *resource, struct rcar_pcie
 
 		if (res->flags & IORESOURCE_IO) {
 			phys_addr_t io_start = pci_pio_to_address(res->start);
-			pci_ioremap_io(nr * SZ_64K, io_start);
+			pci_ioremap_io(global_io_offset, io_start);
+			global_io_offset += SZ_64K;
 		}
 
 		pci_add_resource(resource, res);
@@ -390,7 +393,7 @@ static int rcar_pcie_enable(struct rcar_pcie *pcie)
 	struct pci_bus *bus, *child;
 	LIST_HEAD(res);
 
-	rcar_pcie_setup(1, &res, pcie);
+	rcar_pcie_setup(&res, pcie);
 
 	/* Do not reassign resources if probe only */
 	if (!pci_has_flag(PCI_PROBE_ONLY))
-- 
1.9.1


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

* Re: [PATCH 2/4] PCI: rcar-pcie: Remove dependency on ARM-specific struct hw_pci
  2015-10-02 10:25 ` [PATCH 2/4] PCI: rcar-pcie: Remove dependency on ARM-specific struct hw_pci Phil Edworthy
@ 2015-10-16 21:34   ` Bjorn Helgaas
  2015-10-19  8:54     ` Phil Edworthy
  0 siblings, 1 reply; 28+ messages in thread
From: Bjorn Helgaas @ 2015-10-16 21:34 UTC (permalink / raw)
  To: Phil Edworthy
  Cc: Bjorn Helgaas, Simon Horman, Nobuhiro Iwamatsu,
	Geert Uytterhoeven, linux-pci, linux-sh, linux-kernel

On Fri, Oct 02, 2015 at 11:25:05AM +0100, Phil Edworthy wrote:
> The R-Car PCIe host controller driver uses pci_common_init_dev(),
> which is ARM-specific and requires the ARM struct hw_pci. The part of
> pci_common_init_dev() that is needed is limited and can be done here
> without using hw_pci.
> 
> Note that the ARM pcibios functions expect the PCI sysdata to be a pointer
> to a struct pci_sys_data. Add a struct pci_sys_data as the first element
> in struct gen_pci so that when we use a gen_pci pointer as sysdata, it is
> also a pointer to a struct pci_sys_data.
> 
> Create and scan the root bus directly without using the ARM
> pci_common_init_dev() interface.
> 
> This change is based on commit <499733e0cc1a00523c5056a690f65dea7b9da140>
> "PCI: generic: Remove dependency on ARM-specific struct hw_pci".
> 
> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
> ---
>  drivers/pci/host/pcie-rcar.c | 76 ++++++++++++++++++++++++++++----------------
>  1 file changed, 48 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> index 27e2c20..6057e31 100644
> --- a/drivers/pci/host/pcie-rcar.c
> +++ b/drivers/pci/host/pcie-rcar.c
> @@ -124,7 +124,16 @@ static inline struct rcar_msi *to_rcar_msi(struct msi_controller *chip)
>  }
>  
>  /* Structure representing the PCIe interface */
> +/*
> + * ARM pcibios functions expect the ARM struct pci_sys_data as the PCI
> + * sysdata.  Add pci_sys_data as the first element in struct gen_pci so
> + * that when we use a gen_pci pointer as sysdata, it is also a pointer to
> + * a struct pci_sys_data.
> + */
>  struct rcar_pcie {
> +#ifdef CONFIG_ARM
> +	struct pci_sys_data	sys;
> +#endif
>  	struct device		*dev;
>  	void __iomem		*base;
>  	struct resource		res[RCAR_PCI_MAX_RESOURCES];
> @@ -135,11 +144,6 @@ struct rcar_pcie {
>  	struct			rcar_msi msi;
>  };
>  
> -static inline struct rcar_pcie *sys_to_pcie(struct pci_sys_data *sys)
> -{
> -	return sys->private_data;
> -}
> -
>  static void rcar_pci_write_reg(struct rcar_pcie *pcie, unsigned long val,
>  			       unsigned long reg)
>  {
> @@ -258,7 +262,7 @@ static int rcar_pcie_config_access(struct rcar_pcie *pcie,
>  static int rcar_pcie_read_conf(struct pci_bus *bus, unsigned int devfn,
>  			       int where, int size, u32 *val)
>  {
> -	struct rcar_pcie *pcie = sys_to_pcie(bus->sysdata);
> +	struct rcar_pcie *pcie = bus->sysdata;
>  	int ret;
>  
>  	ret = rcar_pcie_config_access(pcie, RCAR_PCI_ACCESS_READ,
> @@ -283,7 +287,7 @@ static int rcar_pcie_read_conf(struct pci_bus *bus, unsigned int devfn,
>  static int rcar_pcie_write_conf(struct pci_bus *bus, unsigned int devfn,
>  				int where, int size, u32 val)
>  {
> -	struct rcar_pcie *pcie = sys_to_pcie(bus->sysdata);
> +	struct rcar_pcie *pcie = bus->sysdata;
>  	int shift, ret;
>  	u32 data;
>  
> @@ -353,9 +357,8 @@ static void rcar_pcie_setup_window(int win, struct rcar_pcie *pcie)
>  	rcar_pci_write_reg(pcie, mask, PCIEPTCTLR(win));
>  }
>  
> -static int rcar_pcie_setup(int nr, struct pci_sys_data *sys)
> +static int rcar_pcie_setup(int nr, struct list_head *resource, struct rcar_pcie *pcie)
>  {
> -	struct rcar_pcie *pcie = sys_to_pcie(sys);
>  	struct resource *res;
>  	int i;
>  
> @@ -375,30 +378,49 @@ static int rcar_pcie_setup(int nr, struct pci_sys_data *sys)
>  			pci_ioremap_io(nr * SZ_64K, io_start);
>  		}
>  
> -		pci_add_resource(&sys->resources, res);
> +		pci_add_resource(resource, res);
>  	}
> -	pci_add_resource(&sys->resources, &pcie->busn);
> +	pci_add_resource(resource, &pcie->busn);
>  
>  	return 1;
>  }
>  
> -static struct hw_pci rcar_pci = {
> -	.setup          = rcar_pcie_setup,
> -	.map_irq        = of_irq_parse_and_map_pci,
> -	.ops            = &rcar_pcie_ops,
> -};
> -
> -static void rcar_pcie_enable(struct rcar_pcie *pcie)
> +static int rcar_pcie_enable(struct rcar_pcie *pcie)
>  {
> -	struct platform_device *pdev = to_platform_device(pcie->dev);
> +	struct pci_bus *bus, *child;
> +	LIST_HEAD(res);
>  
> -	rcar_pci.nr_controllers = 1;
> -	rcar_pci.private_data = (void **)&pcie;
> -#ifdef CONFIG_PCI_MSI
> -	rcar_pci.msi_ctrl = &pcie->msi.chip;
> -#endif
> +	rcar_pcie_setup(1, &res, pcie);
> +
> +	/* Do not reassign resources if probe only */
> +	if (!pci_has_flag(PCI_PROBE_ONLY))
> +		pci_add_flags(PCI_REASSIGN_ALL_RSRC | PCI_REASSIGN_ALL_BUS);
> +
> +	if (IS_ENABLED(CONFIG_PCI_MSI))
> +		bus = pci_scan_root_bus_msi(pcie->dev, pcie->root_bus_nr,
> +				&rcar_pcie_ops, pcie, &res, &pcie->msi.chip);
> +	else
> +		bus = pci_scan_root_bus(pcie->dev, pcie->root_bus_nr,
> +				&rcar_pcie_ops, pcie, &res);
> +
> +	if (!bus) {
> +		dev_err(pcie->dev, "Scanning rootbus failed");
> +		return -ENODEV;
> +	}
> +
> +	pci_fixup_irqs(pci_common_swizzle, of_irq_parse_and_map_pci);
> +
> +	if (!pci_has_flag(PCI_PROBE_ONLY)) {
> +		pci_bus_size_bridges(bus);
> +		pci_bus_assign_resources(bus);
>  
> -	pci_common_init_dev(&pdev->dev, &rcar_pci);
> +		list_for_each_entry(child, &bus->children, node)
> +			pcie_bus_configure_settings(child);

I see this is exactly the same in 499733e0cc1a ("PCI: generic: Remove
dependency on ARM-specific struct hw_pci").  But it seems like we should do
pcie_bus_configure_settings() (MPS configuration) *always*, even if
PCI_PROBE_ONLY.  I expected PCI_PROBE_ONLY to mean "don't change any BARs"
but I don't think it means we have to preserve *everything*.

> +	}
> +
> +	pci_bus_add_devices(bus);
> +
> +	return 0;
>  }
>  
>  static int phy_wait_for_ack(struct rcar_pcie *pcie)
> @@ -971,9 +993,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)
>  	data = rcar_pci_read_reg(pcie, MACSR);
>  	dev_info(&pdev->dev, "PCIe x%d: link up\n", (data >> 20) & 0x3f);
>  
> -	rcar_pcie_enable(pcie);
> -
> -	return 0;
> +	return rcar_pcie_enable(pcie);
>  }
>  
>  static struct platform_driver rcar_pcie_driver = {
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-02 10:25 [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances Phil Edworthy
                   ` (3 preceding siblings ...)
  2015-10-02 10:25 ` [PATCH 4/4] PCI: rcar-pcie: Fix IO offset for multiple instances Phil Edworthy
@ 2015-10-16 21:34 ` Bjorn Helgaas
  2015-10-19  0:24   ` Simon Horman
  2015-10-19 23:16 ` Bjorn Helgaas
  2015-10-29 12:37 ` Wolfram Sang
  6 siblings, 1 reply; 28+ messages in thread
From: Bjorn Helgaas @ 2015-10-16 21:34 UTC (permalink / raw)
  To: Phil Edworthy
  Cc: Bjorn Helgaas, Simon Horman, Nobuhiro Iwamatsu,
	Geert Uytterhoeven, linux-pci, linux-sh, linux-kernel

On Fri, Oct 02, 2015 at 11:25:03AM +0100, Phil Edworthy wrote:
> Fixes and changes to get PCIe working on ARM64 with mulitple instances.
> 
> I've tested these on ARM (Koelsch board), and it works fine.
> I've also tested on ARM64 (Salvator-X board), but I currently have an issue
> with inbound PCI accesses. I am reasonably sure that this problem is hardware
> related.
> 
> Phil Edworthy (4):
>   PCI: rcar-pcie: Make PCI aware of the IO resources
>   PCI: rcar-pcie: Remove dependency on ARM-specific struct hw_pci
>   PCI: rcar-pcie: Set root bus nr to that provided in DT
>   PCI: rcar-pcie: Fix IO offset for multiple instances

This all looks pretty reasonable to me, but I'm waiting for an ack from
Simon before merging it.

Bjorn

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

* Re: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-16 21:34 ` [PATCH 0/4] PCI: rcar: Add support for ARM64 and " Bjorn Helgaas
@ 2015-10-19  0:24   ` Simon Horman
  0 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2015-10-19  0:24 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Phil Edworthy, Bjorn Helgaas, Nobuhiro Iwamatsu,
	Geert Uytterhoeven, linux-pci, linux-sh, linux-kernel

On Fri, Oct 16, 2015 at 04:34:43PM -0500, Bjorn Helgaas wrote:
> On Fri, Oct 02, 2015 at 11:25:03AM +0100, Phil Edworthy wrote:
> > Fixes and changes to get PCIe working on ARM64 with mulitple instances.
> > 
> > I've tested these on ARM (Koelsch board), and it works fine.
> > I've also tested on ARM64 (Salvator-X board), but I currently have an issue
> > with inbound PCI accesses. I am reasonably sure that this problem is hardware
> > related.
> > 
> > Phil Edworthy (4):
> >   PCI: rcar-pcie: Make PCI aware of the IO resources
> >   PCI: rcar-pcie: Remove dependency on ARM-specific struct hw_pci
> >   PCI: rcar-pcie: Set root bus nr to that provided in DT
> >   PCI: rcar-pcie: Fix IO offset for multiple instances
> 
> This all looks pretty reasonable to me, but I'm waiting for an ack from
> Simon before merging it.

Acked-by: Simon Horman <horms+renesas@verge.net.au>


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

* RE: [PATCH 2/4] PCI: rcar-pcie: Remove dependency on ARM-specific struct hw_pci
  2015-10-16 21:34   ` Bjorn Helgaas
@ 2015-10-19  8:54     ` Phil Edworthy
  0 siblings, 0 replies; 28+ messages in thread
From: Phil Edworthy @ 2015-10-19  8:54 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Bjorn Helgaas, Simon Horman, Nobuhiro Iwamatsu,
	Geert Uytterhoeven, linux-pci@vger.kernel.org,
	linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org

Hi Bjorn,

Thanks for the review.

On 16 October 2015 22:34, Bjorn wrote:
> On Fri, Oct 02, 2015 at 11:25:05AM +0100, Phil Edworthy wrote:
> > The R-Car PCIe host controller driver uses pci_common_init_dev(),
> > which is ARM-specific and requires the ARM struct hw_pci. The part of
> > pci_common_init_dev() that is needed is limited and can be done here
> > without using hw_pci.
> >
> > Note that the ARM pcibios functions expect the PCI sysdata to be a pointer
> > to a struct pci_sys_data. Add a struct pci_sys_data as the first element
> > in struct gen_pci so that when we use a gen_pci pointer as sysdata, it is
> > also a pointer to a struct pci_sys_data.
> >
> > Create and scan the root bus directly without using the ARM
> > pci_common_init_dev() interface.
> >
> > This change is based on commit
> <499733e0cc1a00523c5056a690f65dea7b9da140>
> > "PCI: generic: Remove dependency on ARM-specific struct hw_pci".
> >
> > Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
> > ---
<snip>

> > +
> > +	if (!pci_has_flag(PCI_PROBE_ONLY)) {
> > +		pci_bus_size_bridges(bus);
> > +		pci_bus_assign_resources(bus);
> >
> > -	pci_common_init_dev(&pdev->dev, &rcar_pci);
> > +		list_for_each_entry(child, &bus->children, node)
> > +			pcie_bus_configure_settings(child);
> 
> I see this is exactly the same in 499733e0cc1a ("PCI: generic: Remove
> dependency on ARM-specific struct hw_pci").  But it seems like we should do
> pcie_bus_configure_settings() (MPS configuration) *always*, even if
> PCI_PROBE_ONLY.  I expected PCI_PROBE_ONLY to mean "don't change any
> BARs"
> but I don't think it means we have to preserve *everything*.
I guess it could be interpreted both ways.

At the moment, we don't have any need for PCI_PROBE_ONLY as we always
probe. However, I purposely used the same code as the generic driver so as
to make any future refactoring easier to identify.

I'm happy to change it or leave it the same, your call.

Thanks
Phil

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

* Re: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-02 10:25 [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances Phil Edworthy
                   ` (4 preceding siblings ...)
  2015-10-16 21:34 ` [PATCH 0/4] PCI: rcar: Add support for ARM64 and " Bjorn Helgaas
@ 2015-10-19 23:16 ` Bjorn Helgaas
  2015-10-20  1:36   ` Simon Horman
  2015-10-29 12:37 ` Wolfram Sang
  6 siblings, 1 reply; 28+ messages in thread
From: Bjorn Helgaas @ 2015-10-19 23:16 UTC (permalink / raw)
  To: Phil Edworthy
  Cc: Bjorn Helgaas, Simon Horman, Nobuhiro Iwamatsu,
	Geert Uytterhoeven, linux-pci, linux-sh, linux-kernel,
	Geert Uytterhoeven

[+cc Geert]

On Fri, Oct 02, 2015 at 11:25:03AM +0100, Phil Edworthy wrote:
> Fixes and changes to get PCIe working on ARM64 with mulitple instances.
> 
> I've tested these on ARM (Koelsch board), and it works fine.
> I've also tested on ARM64 (Salvator-X board), but I currently have an issue
> with inbound PCI accesses. I am reasonably sure that this problem is hardware
> related.
> 
> Phil Edworthy (4):
>   PCI: rcar-pcie: Make PCI aware of the IO resources
>   PCI: rcar-pcie: Remove dependency on ARM-specific struct hw_pci
>   PCI: rcar-pcie: Set root bus nr to that provided in DT
>   PCI: rcar-pcie: Fix IO offset for multiple instances

I applied these with Simon's ack to pci/host-rcar for v4.4.

Note that these are on top of Geert's patch to make rcar build only
for ARM, which is probably not necessary after you remove the struct
hw_pci dependency.  I can drop Geert's patch if you want.

Bjorn

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

* Re: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-19 23:16 ` Bjorn Helgaas
@ 2015-10-20  1:36   ` Simon Horman
  2015-10-20  7:37     ` Geert Uytterhoeven
  0 siblings, 1 reply; 28+ messages in thread
From: Simon Horman @ 2015-10-20  1:36 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Phil Edworthy, Bjorn Helgaas, Nobuhiro Iwamatsu,
	Geert Uytterhoeven, linux-pci, linux-sh, linux-kernel,
	Geert Uytterhoeven

On Mon, Oct 19, 2015 at 06:16:34PM -0500, Bjorn Helgaas wrote:
> [+cc Geert]
> 
> On Fri, Oct 02, 2015 at 11:25:03AM +0100, Phil Edworthy wrote:
> > Fixes and changes to get PCIe working on ARM64 with mulitple instances.
> > 
> > I've tested these on ARM (Koelsch board), and it works fine.
> > I've also tested on ARM64 (Salvator-X board), but I currently have an issue
> > with inbound PCI accesses. I am reasonably sure that this problem is hardware
> > related.
> > 
> > Phil Edworthy (4):
> >   PCI: rcar-pcie: Make PCI aware of the IO resources
> >   PCI: rcar-pcie: Remove dependency on ARM-specific struct hw_pci
> >   PCI: rcar-pcie: Set root bus nr to that provided in DT
> >   PCI: rcar-pcie: Fix IO offset for multiple instances
> 
> I applied these with Simon's ack to pci/host-rcar for v4.4.
> 
> Note that these are on top of Geert's patch to make rcar build only
> for ARM, which is probably not necessary after you remove the struct
> hw_pci dependency.  I can drop Geert's patch if you want.

I'm happy with that if Geert is.

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

* Re: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-20  1:36   ` Simon Horman
@ 2015-10-20  7:37     ` Geert Uytterhoeven
  2015-10-20  8:00       ` Phil Edworthy
  0 siblings, 1 reply; 28+ messages in thread
From: Geert Uytterhoeven @ 2015-10-20  7:37 UTC (permalink / raw)
  To: Simon Horman
  Cc: Bjorn Helgaas, Phil Edworthy, Bjorn Helgaas, Nobuhiro Iwamatsu,
	linux-pci, Linux-sh list, linux-kernel@vger.kernel.org,
	Geert Uytterhoeven

On Tue, Oct 20, 2015 at 3:36 AM, Simon Horman <horms@verge.net.au> wrote:
> On Mon, Oct 19, 2015 at 06:16:34PM -0500, Bjorn Helgaas wrote:
>> [+cc Geert]
>>
>> On Fri, Oct 02, 2015 at 11:25:03AM +0100, Phil Edworthy wrote:
>> > Fixes and changes to get PCIe working on ARM64 with mulitple instances.
>> >
>> > I've tested these on ARM (Koelsch board), and it works fine.
>> > I've also tested on ARM64 (Salvator-X board), but I currently have an issue
>> > with inbound PCI accesses. I am reasonably sure that this problem is hardware
>> > related.
>> >
>> > Phil Edworthy (4):
>> >   PCI: rcar-pcie: Make PCI aware of the IO resources
>> >   PCI: rcar-pcie: Remove dependency on ARM-specific struct hw_pci
>> >   PCI: rcar-pcie: Set root bus nr to that provided in DT
>> >   PCI: rcar-pcie: Fix IO offset for multiple instances
>>
>> I applied these with Simon's ack to pci/host-rcar for v4.4.
>>
>> Note that these are on top of Geert's patch to make rcar build only
>> for ARM, which is probably not necessary after you remove the struct
>> hw_pci dependency.  I can drop Geert's patch if you want.
>
> I'm happy with that if Geert is.

Iff the driver compiles/works on arm64 now, my patch should/must be
dropped/reverted.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* RE: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-20  7:37     ` Geert Uytterhoeven
@ 2015-10-20  8:00       ` Phil Edworthy
  2015-10-20 12:49         ` Bjorn Helgaas
  0 siblings, 1 reply; 28+ messages in thread
From: Phil Edworthy @ 2015-10-20  8:00 UTC (permalink / raw)
  To: Geert Uytterhoeven, Simon Horman
  Cc: Bjorn Helgaas, Bjorn Helgaas, Nobuhiro Iwamatsu, linux-pci,
	Linux-sh list, linux-kernel@vger.kernel.org, Geert Uytterhoeven

SGkgR2VlcnQsDQoNCk9uIDIwIE9jdG9iZXIgMjAxNSAwODozNywgR2VlcnQgd3JvdGU6DQo+IE9u
IFR1ZSwgT2N0IDIwLCAyMDE1IGF0IDM6MzYgQU0sIFNpbW9uIEhvcm1hbiA8aG9ybXNAdmVyZ2Uu
bmV0LmF1PiB3cm90ZToNCj4gPiBPbiBNb24sIE9jdCAxOSwgMjAxNSBhdCAwNjoxNjozNFBNIC0w
NTAwLCBCam9ybiBIZWxnYWFzIHdyb3RlOg0KPiA+PiBbK2NjIEdlZXJ0XQ0KPiA+Pg0KPiA+PiBP
biBGcmksIE9jdCAwMiwgMjAxNSBhdCAxMToyNTowM0FNICswMTAwLCBQaGlsIEVkd29ydGh5IHdy
b3RlOg0KPiA+PiA+IEZpeGVzIGFuZCBjaGFuZ2VzIHRvIGdldCBQQ0llIHdvcmtpbmcgb24gQVJN
NjQgd2l0aCBtdWxpdHBsZSBpbnN0YW5jZXMuDQo+ID4+ID4NCj4gPj4gPiBJJ3ZlIHRlc3RlZCB0
aGVzZSBvbiBBUk0gKEtvZWxzY2ggYm9hcmQpLCBhbmQgaXQgd29ya3MgZmluZS4NCj4gPj4gPiBJ
J3ZlIGFsc28gdGVzdGVkIG9uIEFSTTY0IChTYWx2YXRvci1YIGJvYXJkKSwgYnV0IEkgY3VycmVu
dGx5IGhhdmUgYW4gaXNzdWUNCj4gPj4gPiB3aXRoIGluYm91bmQgUENJIGFjY2Vzc2VzLiBJIGFt
IHJlYXNvbmFibHkgc3VyZSB0aGF0IHRoaXMgcHJvYmxlbSBpcw0KPiBoYXJkd2FyZQ0KPiA+PiA+
IHJlbGF0ZWQuDQo+ID4+ID4NCj4gPj4gPiBQaGlsIEVkd29ydGh5ICg0KToNCj4gPj4gPiAgIFBD
STogcmNhci1wY2llOiBNYWtlIFBDSSBhd2FyZSBvZiB0aGUgSU8gcmVzb3VyY2VzDQo+ID4+ID4g
ICBQQ0k6IHJjYXItcGNpZTogUmVtb3ZlIGRlcGVuZGVuY3kgb24gQVJNLXNwZWNpZmljIHN0cnVj
dCBod19wY2kNCj4gPj4gPiAgIFBDSTogcmNhci1wY2llOiBTZXQgcm9vdCBidXMgbnIgdG8gdGhh
dCBwcm92aWRlZCBpbiBEVA0KPiA+PiA+ICAgUENJOiByY2FyLXBjaWU6IEZpeCBJTyBvZmZzZXQg
Zm9yIG11bHRpcGxlIGluc3RhbmNlcw0KPiA+Pg0KPiA+PiBJIGFwcGxpZWQgdGhlc2Ugd2l0aCBT
aW1vbidzIGFjayB0byBwY2kvaG9zdC1yY2FyIGZvciB2NC40Lg0KPiA+Pg0KPiA+PiBOb3RlIHRo
YXQgdGhlc2UgYXJlIG9uIHRvcCBvZiBHZWVydCdzIHBhdGNoIHRvIG1ha2UgcmNhciBidWlsZCBv
bmx5DQo+ID4+IGZvciBBUk0sIHdoaWNoIGlzIHByb2JhYmx5IG5vdCBuZWNlc3NhcnkgYWZ0ZXIg
eW91IHJlbW92ZSB0aGUgc3RydWN0DQo+ID4+IGh3X3BjaSBkZXBlbmRlbmN5LiAgSSBjYW4gZHJv
cCBHZWVydCdzIHBhdGNoIGlmIHlvdSB3YW50Lg0KPiA+DQo+ID4gSSdtIGhhcHB5IHdpdGggdGhh
dCBpZiBHZWVydCBpcy4NCj4gDQo+IElmZiB0aGUgZHJpdmVyIGNvbXBpbGVzL3dvcmtzIG9uIGFy
bTY0IG5vdywgbXkgcGF0Y2ggc2hvdWxkL211c3QgYmUNCj4gZHJvcHBlZC9yZXZlcnRlZC4NClll
cywgdGhlIGRyaXZlciB3b3JrcyBvbiB0aGUgQVJNNjQgU2FsdmF0b3ItWCBib2FyZC4gDQoNClRo
YW5rcw0KUGhpbA0K

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

* Re: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-20  8:00       ` Phil Edworthy
@ 2015-10-20 12:49         ` Bjorn Helgaas
  2015-10-20 13:21           ` Phil Edworthy
  0 siblings, 1 reply; 28+ messages in thread
From: Bjorn Helgaas @ 2015-10-20 12:49 UTC (permalink / raw)
  To: Phil Edworthy
  Cc: Geert Uytterhoeven, Simon Horman, Bjorn Helgaas,
	Nobuhiro Iwamatsu, linux-pci, Linux-sh list,
	linux-kernel@vger.kernel.org, Geert Uytterhoeven

On Tue, Oct 20, 2015 at 08:00:10AM +0000, Phil Edworthy wrote:
> Hi Geert,
> 
> On 20 October 2015 08:37, Geert wrote:
> > On Tue, Oct 20, 2015 at 3:36 AM, Simon Horman <horms@verge.net.au> wrote:
> > > On Mon, Oct 19, 2015 at 06:16:34PM -0500, Bjorn Helgaas wrote:
> > >> [+cc Geert]
> > >>
> > >> On Fri, Oct 02, 2015 at 11:25:03AM +0100, Phil Edworthy wrote:
> > >> > Fixes and changes to get PCIe working on ARM64 with mulitple instances.
> > >> >
> > >> > I've tested these on ARM (Koelsch board), and it works fine.
> > >> > I've also tested on ARM64 (Salvator-X board), but I currently have an issue
> > >> > with inbound PCI accesses. I am reasonably sure that this problem is
> > hardware
> > >> > related.
> > >> >
> > >> > Phil Edworthy (4):
> > >> >   PCI: rcar-pcie: Make PCI aware of the IO resources
> > >> >   PCI: rcar-pcie: Remove dependency on ARM-specific struct hw_pci
> > >> >   PCI: rcar-pcie: Set root bus nr to that provided in DT
> > >> >   PCI: rcar-pcie: Fix IO offset for multiple instances
> > >>
> > >> I applied these with Simon's ack to pci/host-rcar for v4.4.
> > >>
> > >> Note that these are on top of Geert's patch to make rcar build only
> > >> for ARM, which is probably not necessary after you remove the struct
> > >> hw_pci dependency.  I can drop Geert's patch if you want.
> > >
> > > I'm happy with that if Geert is.
> > 
> > Iff the driver compiles/works on arm64 now, my patch should/must be
> > dropped/reverted.
> Yes, the driver works on the ARM64 Salvator-X board. 

I dropped Geert's patch and redid the merges to my "next" branch, so
rcar should build for both ARM and ARM64.

Bjorn

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

* RE: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-20 12:49         ` Bjorn Helgaas
@ 2015-10-20 13:21           ` Phil Edworthy
  0 siblings, 0 replies; 28+ messages in thread
From: Phil Edworthy @ 2015-10-20 13:21 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Geert Uytterhoeven, Simon Horman, Bjorn Helgaas,
	Nobuhiro Iwamatsu, linux-pci, Linux-sh list,
	linux-kernel@vger.kernel.org, Geert Uytterhoeven

Hi Bjorn,

On 20 October 2015 13:50, Bjorn wrote:
> On Tue, Oct 20, 2015 at 08:00:10AM +0000, Phil Edworthy wrote:
> > Hi Geert,
> >
> > On 20 October 2015 08:37, Geert wrote:
> > > On Tue, Oct 20, 2015 at 3:36 AM, Simon Horman <horms@verge.net.au>
> wrote:
> > > > On Mon, Oct 19, 2015 at 06:16:34PM -0500, Bjorn Helgaas wrote:
> > > >> [+cc Geert]
> > > >>
> > > >> On Fri, Oct 02, 2015 at 11:25:03AM +0100, Phil Edworthy wrote:
> > > >> > Fixes and changes to get PCIe working on ARM64 with mulitple
> instances.
> > > >> >
> > > >> > I've tested these on ARM (Koelsch board), and it works fine.
> > > >> > I've also tested on ARM64 (Salvator-X board), but I currently have an
> issue
> > > >> > with inbound PCI accesses. I am reasonably sure that this problem is
> > > hardware
> > > >> > related.
> > > >> >
> > > >> > Phil Edworthy (4):
> > > >> >   PCI: rcar-pcie: Make PCI aware of the IO resources
> > > >> >   PCI: rcar-pcie: Remove dependency on ARM-specific struct hw_pci
> > > >> >   PCI: rcar-pcie: Set root bus nr to that provided in DT
> > > >> >   PCI: rcar-pcie: Fix IO offset for multiple instances
> > > >>
> > > >> I applied these with Simon's ack to pci/host-rcar for v4.4.
> > > >>
> > > >> Note that these are on top of Geert's patch to make rcar build only
> > > >> for ARM, which is probably not necessary after you remove the struct
> > > >> hw_pci dependency.  I can drop Geert's patch if you want.
> > > >
> > > > I'm happy with that if Geert is.
> > >
> > > Iff the driver compiles/works on arm64 now, my patch should/must be
> > > dropped/reverted.
> > Yes, the driver works on the ARM64 Salvator-X board.
> 
> I dropped Geert's patch and redid the merges to my "next" branch, so
> rcar should build for both ARM and ARM64.
Thanks for sorting that out.
Phil

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

* Re: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-02 10:25 [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances Phil Edworthy
                   ` (5 preceding siblings ...)
  2015-10-19 23:16 ` Bjorn Helgaas
@ 2015-10-29 12:37 ` Wolfram Sang
  2015-10-29 13:00   ` Phil Edworthy
  6 siblings, 1 reply; 28+ messages in thread
From: Wolfram Sang @ 2015-10-29 12:37 UTC (permalink / raw)
  To: Phil Edworthy
  Cc: Bjorn Helgaas, Simon Horman, Nobuhiro Iwamatsu,
	Geert Uytterhoeven, linux-pci, linux-sh, linux-kernel

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


> Fixes and changes to get PCIe working on ARM64 with mulitple instances.

> I've tested these on ARM (Koelsch board), and it works fine.
> I've also tested on ARM64 (Salvator-X board), but I currently have an issue

I wanted to test these patches on arm64 as well, but even after merging
pci-next, I still get:

drivers/pci/host/pcie-rcar.c: In function 'rcar_pcie_setup':
drivers/pci/host/pcie-rcar.c:380:4: error: implicit declaration of function 'pci_ioremap_io' [-Werror=implicit-function-declaration]

So, what do I miss?

> with inbound PCI accesses. I am reasonably sure that this problem is hardware
> related.

Any news if this is really HW related?

Thanks,

   Wolfram


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* RE: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-29 12:37 ` Wolfram Sang
@ 2015-10-29 13:00   ` Phil Edworthy
  2015-10-29 16:39     ` Wolfram Sang
  0 siblings, 1 reply; 28+ messages in thread
From: Phil Edworthy @ 2015-10-29 13:00 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Bjorn Helgaas, Simon Horman, Nobuhiro Iwamatsu,
	Geert Uytterhoeven, linux-pci@vger.kernel.org,
	linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org

Hi Wolfram,

On 29 October 2015 12:38, Wolfram wrote:
> > Fixes and changes to get PCIe working on ARM64 with mulitple instances.
> 
> > I've tested these on ARM (Koelsch board), and it works fine.
> > I've also tested on ARM64 (Salvator-X board), but I currently have an issue
> 
> I wanted to test these patches on arm64 as well, but even after merging
> pci-next, I still get:
> 
> drivers/pci/host/pcie-rcar.c: In function 'rcar_pcie_setup':
> drivers/pci/host/pcie-rcar.c:380:4: error: implicit declaration of function
> 'pci_ioremap_io' [-Werror=implicit-function-declaration]
> 
> So, what do I miss?
Ouch, my bad. I have been working with our out-of-tree BSP for the Salvator-X board on
http://git.kernel.org/cgit/linux/kernel/git/horms/renesas-bsp.git,  rcar-3.0.2 tag along
with some patches from colleagues. I hadn't noticed this patch:

>From 913ff73dcf19bb57b0a7ad69e51105560d69fa9b Mon Sep 17 00:00:00 2001
From: Harunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>
Date: Thu, 24 Sep 2015 22:55:58 +0900
Subject: [PATCH 03/15] arm64: PCI(e) arch support for ioremap function

Refered the followings patch:
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-July/269206.html

Signed-off-by: Harunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>
---
 arch/arm64/include/asm/io.h |    2 ++
 arch/arm64/mm/ioremap.c     |   13 +++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
index 44be1e0..cea3651 100644
--- a/arch/arm64/include/asm/io.h
+++ b/arch/arm64/include/asm/io.h
@@ -149,6 +149,8 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)
 #define IO_SPACE_LIMIT		(PCI_IO_SIZE - 1)
 #define PCI_IOBASE		((void __iomem *)PCI_IO_START)
 
+extern int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr);
+
 /*
  * String version of I/O memory access operations.
  */
diff --git a/arch/arm64/mm/ioremap.c b/arch/arm64/mm/ioremap.c
index 01e88c8..34f09a6 100644
--- a/arch/arm64/mm/ioremap.c
+++ b/arch/arm64/mm/ioremap.c
@@ -104,6 +104,19 @@ void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size)
 }
 EXPORT_SYMBOL(ioremap_cache);
 
+#ifdef CONFIG_PCI
+int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr)
+{
+	BUG_ON(offset + SZ_64K > IO_SPACE_LIMIT);
+
+	return ioremap_page_range((unsigned long)PCI_IOBASE + offset,
+				  (unsigned long)PCI_IOBASE + offset + SZ_64K,
+				  phys_addr,
+				  __pgprot(PROT_NORMAL_NC));
+}
+EXPORT_SYMBOL_GPL(pci_ioremap_io);
+#endif
+
 /*
  * Must be called after early_fixmap_init
  */
-- 
1.7.9.5

Additionally, I have found out that MSI on R-Car PCIe upstream is broken. You can
workaround this by reverting f075915ac0b11847fcfc8c4d55526a317e71c4d1 and
f075915ac0b11847fcfc8c4d55526a317e71c4d1 until we fix this.


> > with inbound PCI accesses. I am reasonably sure that this problem is hardware
> > related.
> 
> Any news if this is really HW related?
I found out that the PCIe controller HW only supports 32-bit AXI bus addresses, so it
works fine if you limit the available memory. The driver will need some work to use
the IPMMU at some point.

Thanks
Phil


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

* Re: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-29 13:00   ` Phil Edworthy
@ 2015-10-29 16:39     ` Wolfram Sang
  2015-10-29 16:44       ` Phil Edworthy
  0 siblings, 1 reply; 28+ messages in thread
From: Wolfram Sang @ 2015-10-29 16:39 UTC (permalink / raw)
  To: Phil Edworthy
  Cc: Bjorn Helgaas, Simon Horman, Nobuhiro Iwamatsu,
	Geert Uytterhoeven, linux-pci@vger.kernel.org,
	linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org

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


> Ouch, my bad. I have been working with our out-of-tree BSP for the Salvator-X board on
> http://git.kernel.org/cgit/linux/kernel/git/horms/renesas-bsp.git,  rcar-3.0.2 tag along
> with some patches from colleagues. I hadn't noticed this patch:

Thanks! Any plans for pushing this upstream? We will have the build error
otherwise...

> > Any news if this is really HW related?
> I found out that the PCIe controller HW only supports 32-bit AXI bus addresses, so it
> works fine if you limit the available memory. The driver will need some work to use
> the IPMMU at some point.

Ah, okay.

Can you send the dts patches, too? I checked the BSP this time, but to
no avail...


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* RE: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-29 16:39     ` Wolfram Sang
@ 2015-10-29 16:44       ` Phil Edworthy
  2015-10-29 18:48         ` Wolfram Sang
  0 siblings, 1 reply; 28+ messages in thread
From: Phil Edworthy @ 2015-10-29 16:44 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Bjorn Helgaas, Simon Horman, Nobuhiro Iwamatsu,
	Geert Uytterhoeven, linux-pci@vger.kernel.org,
	linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org

Hi Wolfram,

On 29 October 2015 16:40, Wolfram wrote:
> > Ouch, my bad. I have been working with our out-of-tree BSP for the Salvator-X
> board on
> > http://git.kernel.org/cgit/linux/kernel/git/horms/renesas-bsp.git,  rcar-3.0.2
> tag along
> > with some patches from colleagues. I hadn't noticed this patch:
> 
> Thanks! Any plans for pushing this upstream? We will have the build error
> otherwise...
After some digging, that patch won't be accepted upstream. I'm looking into how the
driver can be modified so it doesn't need to call this, but I don't expect a small or
imminent fix.

> > > Any news if this is really HW related?
> > I found out that the PCIe controller HW only supports 32-bit AXI bus addresses,
> so it
> > works fine if you limit the available memory. The driver will need some work to
> use
> > the IPMMU at some point.
> 
> Ah, okay.
> 
> Can you send the dts patches, too? I checked the BSP this time, but to
> no avail...
I will once I sort out the arm64 IO resources problem and the MSI problem.

Thanks
Phil

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

* Re: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-29 16:44       ` Phil Edworthy
@ 2015-10-29 18:48         ` Wolfram Sang
  2015-10-29 23:03           ` Bjorn Helgaas
  2015-10-30 11:51           ` Phil Edworthy
  0 siblings, 2 replies; 28+ messages in thread
From: Wolfram Sang @ 2015-10-29 18:48 UTC (permalink / raw)
  To: Phil Edworthy
  Cc: Bjorn Helgaas, Simon Horman, Nobuhiro Iwamatsu,
	Geert Uytterhoeven, linux-pci@vger.kernel.org,
	linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org

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

On Thu, Oct 29, 2015 at 04:44:06PM +0000, Phil Edworthy wrote:
> Hi Wolfram,
> 
> On 29 October 2015 16:40, Wolfram wrote:
> > > Ouch, my bad. I have been working with our out-of-tree BSP for the Salvator-X
> > board on
> > > http://git.kernel.org/cgit/linux/kernel/git/horms/renesas-bsp.git,  rcar-3.0.2
> > tag along
> > > with some patches from colleagues. I hadn't noticed this patch:
> > 
> > Thanks! Any plans for pushing this upstream? We will have the build error
> > otherwise...
> After some digging, that patch won't be accepted upstream. I'm looking into how the
> driver can be modified so it doesn't need to call this, but I don't expect a small or
> imminent fix.

Yes, I'd think so, too. However, a fix for 4.4 would be needed to
prevent having a final release with a build error.

> > > > Any news if this is really HW related?
> > > I found out that the PCIe controller HW only supports 32-bit AXI bus addresses,
> > so it
> > > works fine if you limit the available memory. The driver will need some work to
> > use
> > > the IPMMU at some point.
> > 
> > Ah, okay.
> > 
> > Can you send the dts patches, too? I checked the BSP this time, but to
> > no avail...
> I will once I sort out the arm64 IO resources problem and the MSI problem.

What MSI problem?

And can't you send the DTS patches as RFC so I can add some testing?


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-29 18:48         ` Wolfram Sang
@ 2015-10-29 23:03           ` Bjorn Helgaas
  2015-10-30  7:19             ` Phil Edworthy
  2015-10-30 11:51           ` Phil Edworthy
  1 sibling, 1 reply; 28+ messages in thread
From: Bjorn Helgaas @ 2015-10-29 23:03 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Phil Edworthy, Bjorn Helgaas, Simon Horman, Geert Uytterhoeven,
	linux-pci@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-kernel@vger.kernel.org

[-cc Nobuhiro (bouncing)]

On Thu, Oct 29, 2015 at 07:48:00PM +0100, Wolfram Sang wrote:
> On Thu, Oct 29, 2015 at 04:44:06PM +0000, Phil Edworthy wrote:
> > Hi Wolfram,
> > 
> > On 29 October 2015 16:40, Wolfram wrote:
> > > > Ouch, my bad. I have been working with our out-of-tree BSP for the Salvator-X
> > > board on
> > > > http://git.kernel.org/cgit/linux/kernel/git/horms/renesas-bsp.git,  rcar-3.0.2
> > > tag along
> > > > with some patches from colleagues. I hadn't noticed this patch:
> > > 
> > > Thanks! Any plans for pushing this upstream? We will have the build error
> > > otherwise...
> > After some digging, that patch won't be accepted upstream. I'm looking into how the
> > driver can be modified so it doesn't need to call this, but I don't expect a small or
> > imminent fix.
> 
> Yes, I'd think so, too. However, a fix for 4.4 would be needed to
> prevent having a final release with a build error.

I'm thinking I should drop my pci/host-rcar branch until we
have a fix for this.  It currently contains:

  9ac724f20774 PCI: rcar: Fix I/O offset for multiple host bridges
  7d75b413f5c6 PCI: rcar: Set root bus nr to that provided in DT
  4c22eab88c68 PCI: rcar: Remove dependency on ARM-specific struct hw_pci
  ef18d2e55ea0 PCI: rcar: Make PCI aware of the I/O resources

Is that right?  Last I heard, Linus expects to release v4.3 on Sunday,
so we really don't have much time to sort this out.

Bjorn

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

* RE: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-29 23:03           ` Bjorn Helgaas
@ 2015-10-30  7:19             ` Phil Edworthy
  2015-10-30  7:24               ` Phil Edworthy
  2015-10-30  9:00               ` Phil Edworthy
  0 siblings, 2 replies; 28+ messages in thread
From: Phil Edworthy @ 2015-10-30  7:19 UTC (permalink / raw)
  To: Bjorn Helgaas, Wolfram Sang
  Cc: Bjorn Helgaas, Simon Horman, Geert Uytterhoeven,
	linux-pci@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-kernel@vger.kernel.org

Hi Bjorn,

On 29 October 2015 23:03, Bjorn wrote:
> On Thu, Oct 29, 2015 at 07:48:00PM +0100, Wolfram Sang wrote:
> > On Thu, Oct 29, 2015 at 04:44:06PM +0000, Phil Edworthy wrote:
> > > Hi Wolfram,
> > >
> > > On 29 October 2015 16:40, Wolfram wrote:
> > > > > Ouch, my bad. I have been working with our out-of-tree BSP for the
> Salvator-X
> > > > board on
> > > > > http://git.kernel.org/cgit/linux/kernel/git/horms/renesas-bsp.git,  rcar-
> 3.0.2
> > > > tag along
> > > > > with some patches from colleagues. I hadn't noticed this patch:
> > > >
> > > > Thanks! Any plans for pushing this upstream? We will have the build error
> > > > otherwise...
> > > After some digging, that patch won't be accepted upstream. I'm looking into
> how the
> > > driver can be modified so it doesn't need to call this, but I don't expect a small
> or
> > > imminent fix.
> >
> > Yes, I'd think so, too. However, a fix for 4.4 would be needed to
> > prevent having a final release with a build error.
> 
> I'm thinking I should drop my pci/host-rcar branch until we
> have a fix for this.  It currently contains:
> 
>   9ac724f20774 PCI: rcar: Fix I/O offset for multiple host bridges
>   7d75b413f5c6 PCI: rcar: Set root bus nr to that provided in DT
>   4c22eab88c68 PCI: rcar: Remove dependency on ARM-specific struct hw_pci
>   ef18d2e55ea0 PCI: rcar: Make PCI aware of the I/O resources
> 
> Is that right?  Last I heard, Linus expects to release v4.3 on Sunday,
> so we really don't have much time to sort this out.
The simple thing is to re-add Geert's patch to stop this driver being built for arm64.

Thanks
Phil

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

* RE: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-30  7:19             ` Phil Edworthy
@ 2015-10-30  7:24               ` Phil Edworthy
  2015-10-30  9:00               ` Phil Edworthy
  1 sibling, 0 replies; 28+ messages in thread
From: Phil Edworthy @ 2015-10-30  7:24 UTC (permalink / raw)
  To: Bjorn Helgaas, Wolfram Sang
  Cc: Bjorn Helgaas, Simon Horman, Geert Uytterhoeven,
	linux-pci@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-kernel@vger.kernel.org

Hi Bjorn,

On 30 October 2015 07:19, Phil wrote
> On 29 October 2015 23:03, Bjorn wrote:
> > On Thu, Oct 29, 2015 at 07:48:00PM +0100, Wolfram Sang wrote:
> > > On Thu, Oct 29, 2015 at 04:44:06PM +0000, Phil Edworthy wrote:
> > > > Hi Wolfram,
> > > >
> > > > On 29 October 2015 16:40, Wolfram wrote:
> > > > > > Ouch, my bad. I have been working with our out-of-tree BSP for the
> > Salvator-X
> > > > > board on
> > > > > > http://git.kernel.org/cgit/linux/kernel/git/horms/renesas-bsp.git,  rcar-
> > 3.0.2
> > > > > tag along
> > > > > > with some patches from colleagues. I hadn't noticed this patch:
> > > > >
> > > > > Thanks! Any plans for pushing this upstream? We will have the build error
> > > > > otherwise...
> > > > After some digging, that patch won't be accepted upstream. I'm looking into
> > how the
> > > > driver can be modified so it doesn't need to call this, but I don't expect a
> small
> > or
> > > > imminent fix.
> > >
> > > Yes, I'd think so, too. However, a fix for 4.4 would be needed to
> > > prevent having a final release with a build error.
> >
> > I'm thinking I should drop my pci/host-rcar branch until we
> > have a fix for this.  It currently contains:
> >
> >   9ac724f20774 PCI: rcar: Fix I/O offset for multiple host bridges
> >   7d75b413f5c6 PCI: rcar: Set root bus nr to that provided in DT
> >   4c22eab88c68 PCI: rcar: Remove dependency on ARM-specific struct hw_pci
> >   ef18d2e55ea0 PCI: rcar: Make PCI aware of the I/O resources
> >
> > Is that right?  Last I heard, Linus expects to release v4.3 on Sunday,
> > so we really don't have much time to sort this out.
> The simple thing is to re-add Geert's patch to stop this driver being built for
> arm64.
Btw, it's this one: https://patchwork.ozlabs.org/patch/512040/

Thanks
Phil

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

* RE: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-30  7:19             ` Phil Edworthy
  2015-10-30  7:24               ` Phil Edworthy
@ 2015-10-30  9:00               ` Phil Edworthy
  2015-10-30 13:31                 ` Bjorn Helgaas
  1 sibling, 1 reply; 28+ messages in thread
From: Phil Edworthy @ 2015-10-30  9:00 UTC (permalink / raw)
  To: Bjorn Helgaas, Wolfram Sang
  Cc: Bjorn Helgaas, Simon Horman, Geert Uytterhoeven,
	linux-pci@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-kernel@vger.kernel.org

Hi Bjorn,

On 30 October 2015 07:24, Phil wrote:
> On 30 October 2015 07:19, Phil wrote
> > On 29 October 2015 23:03, Bjorn wrote:
> > > On Thu, Oct 29, 2015 at 07:48:00PM +0100, Wolfram Sang wrote:
> > > > On Thu, Oct 29, 2015 at 04:44:06PM +0000, Phil Edworthy wrote:
> > > > > Hi Wolfram,
> > > > >
> > > > > On 29 October 2015 16:40, Wolfram wrote:
> > > > > > > Ouch, my bad. I have been working with our out-of-tree BSP for the
> > > Salvator-X
> > > > > > board on
> > > > > > > http://git.kernel.org/cgit/linux/kernel/git/horms/renesas-bsp.git,
> rcar-
> > > 3.0.2
> > > > > > tag along
> > > > > > > with some patches from colleagues. I hadn't noticed this patch:
> > > > > >
> > > > > > Thanks! Any plans for pushing this upstream? We will have the build
> error
> > > > > > otherwise...
> > > > > After some digging, that patch won't be accepted upstream. I'm looking
> into
> > > how the
> > > > > driver can be modified so it doesn't need to call this, but I don't expect a
> > small
> > > or
> > > > > imminent fix.
> > > >
> > > > Yes, I'd think so, too. However, a fix for 4.4 would be needed to
> > > > prevent having a final release with a build error.
> > >
> > > I'm thinking I should drop my pci/host-rcar branch until we
> > > have a fix for this.  It currently contains:
> > >
> > >   9ac724f20774 PCI: rcar: Fix I/O offset for multiple host bridges
> > >   7d75b413f5c6 PCI: rcar: Set root bus nr to that provided in DT
> > >   4c22eab88c68 PCI: rcar: Remove dependency on ARM-specific struct hw_pci
> > >   ef18d2e55ea0 PCI: rcar: Make PCI aware of the I/O resources
> > >
> > > Is that right?  Last I heard, Linus expects to release v4.3 on Sunday,
> > > so we really don't have much time to sort this out.
> > The simple thing is to re-add Geert's patch to stop this driver being built for
> > arm64.
> Btw, it's this one: https://patchwork.ozlabs.org/patch/512040/
It's worth mentioning that Geert's patch stops both the rcar-pcie driver and the
rcar-pci-gen2 driver from being built on arm64 due to build failures for both of
them. The rcar-pci-gen2 driver is not for R-Car Gen3 devices, and so should not
be built for arm64. The rcar-pcie driver will be used on R-Car Gen3 devices.

So if we don't use Geert's patch, I need to fix the rcar-pcie driver so it doesn't
use pci_ioremap_io(), _and_ fix Kconfig so that the rcar-pci-gen2 driver doesn't
get built on arm64. 
Let's just use Geert's patch for now.

Btw, I saw no build breakages on next as SHMOBILE is currently not included in
arm64.

Thanks
Phil

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

* RE: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-29 18:48         ` Wolfram Sang
  2015-10-29 23:03           ` Bjorn Helgaas
@ 2015-10-30 11:51           ` Phil Edworthy
  2015-10-30 12:04             ` Wolfram Sang
  1 sibling, 1 reply; 28+ messages in thread
From: Phil Edworthy @ 2015-10-30 11:51 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Bjorn Helgaas, Simon Horman, Geert Uytterhoeven,
	linux-pci@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-kernel@vger.kernel.org

Hi Wolfram,

On 29 October 2015 18:48, Wolfram wrote:
> On Thu, Oct 29, 2015 at 04:44:06PM +0000, Phil Edworthy wrote:
> > Hi Wolfram,
> >
> > On 29 October 2015 16:40, Wolfram wrote:
> > > > Ouch, my bad. I have been working with our out-of-tree BSP for the
> Salvator-X
> > > board on
> > > > http://git.kernel.org/cgit/linux/kernel/git/horms/renesas-bsp.git,  rcar-
> 3.0.2
> > > tag along
> > > > with some patches from colleagues. I hadn't noticed this patch:
> > >
> > > Thanks! Any plans for pushing this upstream? We will have the build error
> > > otherwise...
> > After some digging, that patch won't be accepted upstream. I'm looking into
> how the
> > driver can be modified so it doesn't need to call this, but I don't expect a small
> or
> > imminent fix.
> 
> Yes, I'd think so, too. However, a fix for 4.4 would be needed to
> prevent having a final release with a build error.
Hopefully, Geert's patch will be applied to avoid build errors in both the
rcar-pcie and rcar-pci-gen2 (internal USB bridge) drivers. Meanwhile I'll fix
the rcar-pcie driver properly for arm64.


> > > > > Any news if this is really HW related?
> > > > I found out that the PCIe controller HW only supports 32-bit AXI bus
> addresses,
> > > so it
> > > > works fine if you limit the available memory. The driver will need some work
> to
> > > use
> > > > the IPMMU at some point.
> > >
> > > Ah, okay.
> > >
> > > Can you send the dts patches, too? I checked the BSP this time, but to
> > > no avail...
> > I will once I sort out the arm64 IO resources problem and the MSI problem.
> 
> What MSI problem?
I was told that rcar pcie on v4.3-rc5 had an issue with MSI. I've since checked
That both v4.3-rc7 and next work ok out of the box on the Koelsch board.
There are some problems with next (mstp related), but it doesn't stop the
board booting and being able to test pcie. Since shmobile arm64 is not in
next yet, I have not checked this.
 
> And can't you send the DTS patches as RFC so I can add some testing?
Sure, though what tree? As I mentioned above, next doesn't have
shmobile arm64 yet.

Thanks
Phil

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

* Re: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-30 11:51           ` Phil Edworthy
@ 2015-10-30 12:04             ` Wolfram Sang
  0 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2015-10-30 12:04 UTC (permalink / raw)
  To: Phil Edworthy
  Cc: Bjorn Helgaas, Simon Horman, Geert Uytterhoeven,
	linux-pci@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-kernel@vger.kernel.org

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


> Hopefully, Geert's patch will be applied to avoid build errors in both the
> rcar-pcie and rcar-pci-gen2 (internal USB bridge) drivers. Meanwhile I'll fix
> the rcar-pcie driver properly for arm64.

Thanks for taking care.

> > What MSI problem?
> I was told that rcar pcie on v4.3-rc5 had an issue with MSI.

Okay, we'll see. I only have remote access to a Koelsch board, but my
own Salvator. And a USB3 PCIE card. That would be my primary test setup.

> > And can't you send the DTS patches as RFC so I can add some testing?
> Sure, though what tree? As I mentioned above, next doesn't have
> shmobile arm64 yet.

I use renesas-drivers:

git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git renesas-drivers-2015-10-27-v4.3-rc7

Thanks,

   Wolfram


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-30  9:00               ` Phil Edworthy
@ 2015-10-30 13:31                 ` Bjorn Helgaas
  2015-11-02 10:56                   ` Phil Edworthy
  0 siblings, 1 reply; 28+ messages in thread
From: Bjorn Helgaas @ 2015-10-30 13:31 UTC (permalink / raw)
  To: Phil Edworthy
  Cc: Wolfram Sang, Bjorn Helgaas, Simon Horman, Geert Uytterhoeven,
	linux-pci@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Fri, Oct 30, 2015 at 09:00:20AM +0000, Phil Edworthy wrote:
> Hi Bjorn,
> 
> On 30 October 2015 07:24, Phil wrote:
> > On 30 October 2015 07:19, Phil wrote
> > > On 29 October 2015 23:03, Bjorn wrote:
> > > > On Thu, Oct 29, 2015 at 07:48:00PM +0100, Wolfram Sang wrote:
> > > > > On Thu, Oct 29, 2015 at 04:44:06PM +0000, Phil Edworthy wrote:
> > > > > > Hi Wolfram,
> > > > > >
> > > > > > On 29 October 2015 16:40, Wolfram wrote:
> > > > > > > > Ouch, my bad. I have been working with our out-of-tree BSP for the
> > > > Salvator-X
> > > > > > > board on
> > > > > > > > http://git.kernel.org/cgit/linux/kernel/git/horms/renesas-bsp.git,
> > rcar-
> > > > 3.0.2
> > > > > > > tag along
> > > > > > > > with some patches from colleagues. I hadn't noticed this patch:
> > > > > > >
> > > > > > > Thanks! Any plans for pushing this upstream? We will have the build
> > error
> > > > > > > otherwise...
> > > > > > After some digging, that patch won't be accepted upstream. I'm looking
> > into
> > > > how the
> > > > > > driver can be modified so it doesn't need to call this, but I don't expect a
> > > small
> > > > or
> > > > > > imminent fix.
> > > > >
> > > > > Yes, I'd think so, too. However, a fix for 4.4 would be needed to
> > > > > prevent having a final release with a build error.
> > > >
> > > > I'm thinking I should drop my pci/host-rcar branch until we
> > > > have a fix for this.  It currently contains:
> > > >
> > > >   9ac724f20774 PCI: rcar: Fix I/O offset for multiple host bridges
> > > >   7d75b413f5c6 PCI: rcar: Set root bus nr to that provided in DT
> > > >   4c22eab88c68 PCI: rcar: Remove dependency on ARM-specific struct hw_pci
> > > >   ef18d2e55ea0 PCI: rcar: Make PCI aware of the I/O resources
> > > >
> > > > Is that right?  Last I heard, Linus expects to release v4.3 on Sunday,
> > > > so we really don't have much time to sort this out.
> > > The simple thing is to re-add Geert's patch to stop this driver being built for
> > > arm64.
> > Btw, it's this one: https://patchwork.ozlabs.org/patch/512040/
> It's worth mentioning that Geert's patch stops both the rcar-pcie driver and the
> rcar-pci-gen2 driver from being built on arm64 due to build failures for both of
> them. The rcar-pci-gen2 driver is not for R-Car Gen3 devices, and so should not
> be built for arm64. The rcar-pcie driver will be used on R-Car Gen3 devices.
> 
> So if we don't use Geert's patch, I need to fix the rcar-pcie driver so it doesn't
> use pci_ioremap_io(), _and_ fix Kconfig so that the rcar-pci-gen2 driver doesn't
> get built on arm64. 
> Let's just use Geert's patch for now.

OK, I re-added Geert's patch.  I split it into two, one for
rcar-pci-gen2 and another for rcar-pcie, to help me keep things
straight.  If I understand correctly,

  - rcar-pci-gen2 depends on the ARM-specific pci_sys_data, and I
    don't have anything queued to address that.

  - rcar-pcie depended on the ARM-specific pci_sys_data and
    pci_ioremap_io().  Your patches remove the pci_sys_data
    dependency, and it sounds like future changes will remove the
    pci_ioremap_io() dependency.

The result is in my pci/host-rcar branch:
https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/log/?h=pci/host-rcar

Bjorn

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

* RE: [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances
  2015-10-30 13:31                 ` Bjorn Helgaas
@ 2015-11-02 10:56                   ` Phil Edworthy
  0 siblings, 0 replies; 28+ messages in thread
From: Phil Edworthy @ 2015-11-02 10:56 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Wolfram Sang, Bjorn Helgaas, Simon Horman, Geert Uytterhoeven,
	linux-pci@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-kernel@vger.kernel.org

Hi Bjorn,

On 30 October 2015 13:32, Bjorn wrote:
> On Fri, Oct 30, 2015 at 09:00:20AM +0000, Phil Edworthy wrote:
> > Hi Bjorn,
> >
> > On 30 October 2015 07:24, Phil wrote:
> > > On 30 October 2015 07:19, Phil wrote
> > > > On 29 October 2015 23:03, Bjorn wrote:
> > > > > On Thu, Oct 29, 2015 at 07:48:00PM +0100, Wolfram Sang wrote:
> > > > > > On Thu, Oct 29, 2015 at 04:44:06PM +0000, Phil Edworthy wrote:
> > > > > > > Hi Wolfram,
> > > > > > >
> > > > > > > On 29 October 2015 16:40, Wolfram wrote:
> > > > > > > > > Ouch, my bad. I have been working with our out-of-tree BSP for
> the
> > > > > Salvator-X
> > > > > > > > board on
> > > > > > > > > http://git.kernel.org/cgit/linux/kernel/git/horms/renesas-bsp.git,
> > > rcar-
> > > > > 3.0.2
> > > > > > > > tag along
> > > > > > > > > with some patches from colleagues. I hadn't noticed this patch:
> > > > > > > >
> > > > > > > > Thanks! Any plans for pushing this upstream? We will have the build
> > > error
> > > > > > > > otherwise...
> > > > > > > After some digging, that patch won't be accepted upstream. I'm
> looking
> > > into
> > > > > how the
> > > > > > > driver can be modified so it doesn't need to call this, but I don't expect
> a
> > > > small
> > > > > or
> > > > > > > imminent fix.
> > > > > >
> > > > > > Yes, I'd think so, too. However, a fix for 4.4 would be needed to
> > > > > > prevent having a final release with a build error.
> > > > >
> > > > > I'm thinking I should drop my pci/host-rcar branch until we
> > > > > have a fix for this.  It currently contains:
> > > > >
> > > > >   9ac724f20774 PCI: rcar: Fix I/O offset for multiple host bridges
> > > > >   7d75b413f5c6 PCI: rcar: Set root bus nr to that provided in DT
> > > > >   4c22eab88c68 PCI: rcar: Remove dependency on ARM-specific struct
> hw_pci
> > > > >   ef18d2e55ea0 PCI: rcar: Make PCI aware of the I/O resources
> > > > >
> > > > > Is that right?  Last I heard, Linus expects to release v4.3 on Sunday,
> > > > > so we really don't have much time to sort this out.
> > > > The simple thing is to re-add Geert's patch to stop this driver being built for
> > > > arm64.
> > > Btw, it's this one: https://patchwork.ozlabs.org/patch/512040/
> > It's worth mentioning that Geert's patch stops both the rcar-pcie driver and the
> > rcar-pci-gen2 driver from being built on arm64 due to build failures for both of
> > them. The rcar-pci-gen2 driver is not for R-Car Gen3 devices, and so should not
> > be built for arm64. The rcar-pcie driver will be used on R-Car Gen3 devices.
> >
> > So if we don't use Geert's patch, I need to fix the rcar-pcie driver so it doesn't
> > use pci_ioremap_io(), _and_ fix Kconfig so that the rcar-pci-gen2 driver doesn't
> > get built on arm64.
> > Let's just use Geert's patch for now.
> 
> OK, I re-added Geert's patch.  I split it into two, one for
> rcar-pci-gen2 and another for rcar-pcie, to help me keep things
> straight.  If I understand correctly,
> 
>   - rcar-pci-gen2 depends on the ARM-specific pci_sys_data, and I
>     don't have anything queued to address that.
Correct, but you don't need anything other than Geert's patch to
ensure it's not built for arm64.

>   - rcar-pcie depended on the ARM-specific pci_sys_data and
>     pci_ioremap_io().  Your patches remove the pci_sys_data
>     dependency, and it sounds like future changes will remove the
>     pci_ioremap_io() dependency.
That's correct, hopefully I'll have a patch shortly.
Thanks for taking care of this.

 
> The result is in my pci/host-rcar branch:
> https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/log/?h=pci/host-rcar
I haven't tested this yet, but I have looked them over and they look ok.

Thanks
Phil

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

end of thread, other threads:[~2015-11-02 10:56 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-02 10:25 [PATCH 0/4] PCI: rcar: Add support for ARM64 and multiple instances Phil Edworthy
2015-10-02 10:25 ` [PATCH 1/4] PCI: rcar-pcie: Make PCI aware of the IO resources Phil Edworthy
2015-10-02 10:25 ` [PATCH 2/4] PCI: rcar-pcie: Remove dependency on ARM-specific struct hw_pci Phil Edworthy
2015-10-16 21:34   ` Bjorn Helgaas
2015-10-19  8:54     ` Phil Edworthy
2015-10-02 10:25 ` [PATCH 3/4] PCI: rcar-pcie: Set root bus nr to that provided in DT Phil Edworthy
2015-10-02 10:25 ` [PATCH 4/4] PCI: rcar-pcie: Fix IO offset for multiple instances Phil Edworthy
2015-10-16 21:34 ` [PATCH 0/4] PCI: rcar: Add support for ARM64 and " Bjorn Helgaas
2015-10-19  0:24   ` Simon Horman
2015-10-19 23:16 ` Bjorn Helgaas
2015-10-20  1:36   ` Simon Horman
2015-10-20  7:37     ` Geert Uytterhoeven
2015-10-20  8:00       ` Phil Edworthy
2015-10-20 12:49         ` Bjorn Helgaas
2015-10-20 13:21           ` Phil Edworthy
2015-10-29 12:37 ` Wolfram Sang
2015-10-29 13:00   ` Phil Edworthy
2015-10-29 16:39     ` Wolfram Sang
2015-10-29 16:44       ` Phil Edworthy
2015-10-29 18:48         ` Wolfram Sang
2015-10-29 23:03           ` Bjorn Helgaas
2015-10-30  7:19             ` Phil Edworthy
2015-10-30  7:24               ` Phil Edworthy
2015-10-30  9:00               ` Phil Edworthy
2015-10-30 13:31                 ` Bjorn Helgaas
2015-11-02 10:56                   ` Phil Edworthy
2015-10-30 11:51           ` Phil Edworthy
2015-10-30 12:04             ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).