linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: designware: check for iATU unroll support after initializing host
@ 2016-10-14 21:54 Niklas Cassel
  2016-10-17 14:34 ` Joao Pinto
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Niklas Cassel @ 2016-10-14 21:54 UTC (permalink / raw)
  To: jingoohan1, pratyush.anand, bhelgaas, Joao.Pinto
  Cc: linux-pci, linux-kernel, Niklas Cassel

From: Niklas Cassel <niklas.cassel@axis.com>

dw_pcie_iatu_unroll_enabled reads a dbi_base register.
Reading any dbi_base register before pp->ops->host_init has been called
causes "imprecise external abort" on platforms like ARTPEC-6, where the
PCIe module is disabled at boot and first enabled in pp->ops->host_init.
Move dw_pcie_iatu_unroll_enabled to dw_pcie_setup_rc, since it is after
pp->ops->host_init, but before pp->iatu_unroll_enabled is actually used.

Fixes: a0601a470537 ("PCI: designware: Add iATU Unroll feature")
Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
---
 drivers/pci/host/pcie-designware.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index 035f50c03281..bed19994c1e9 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -637,8 +637,6 @@ int dw_pcie_host_init(struct pcie_port *pp)
 		}
 	}
 
-	pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
-
 	if (pp->ops->host_init)
 		pp->ops->host_init(pp);
 
@@ -809,6 +807,11 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
 {
 	u32 val;
 
+	/* get iATU unroll support */
+	pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
+	dev_dbg(pp->dev, "iATU unroll: %s\n",
+		pp->iatu_unroll_enabled ? "enabled" : "disabled");
+
 	/* set the number of lanes */
 	val = dw_pcie_readl_rc(pp, PCIE_PORT_LINK_CONTROL);
 	val &= ~PORT_LINK_MODE_MASK;
-- 
2.1.4


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

* Re: [PATCH] PCI: designware: check for iATU unroll support after initializing host
  2016-10-14 21:54 [PATCH] PCI: designware: check for iATU unroll support after initializing host Niklas Cassel
@ 2016-10-17 14:34 ` Joao Pinto
  2016-10-29 14:01 ` James Le Cuirot
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Joao Pinto @ 2016-10-17 14:34 UTC (permalink / raw)
  To: Niklas Cassel, jingoohan1, pratyush.anand, bhelgaas, Joao.Pinto
  Cc: linux-pci, linux-kernel, Niklas Cassel


On 10/14/2016 10:54 PM, Niklas Cassel wrote:
> From: Niklas Cassel <niklas.cassel@axis.com>
> 
> dw_pcie_iatu_unroll_enabled reads a dbi_base register.
> Reading any dbi_base register before pp->ops->host_init has been called
> causes "imprecise external abort" on platforms like ARTPEC-6, where the
> PCIe module is disabled at boot and first enabled in pp->ops->host_init.
> Move dw_pcie_iatu_unroll_enabled to dw_pcie_setup_rc, since it is after
> pp->ops->host_init, but before pp->iatu_unroll_enabled is actually used.
> 
> Fixes: a0601a470537 ("PCI: designware: Add iATU Unroll feature")
> Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
> ---
>  drivers/pci/host/pcie-designware.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
> index 035f50c03281..bed19994c1e9 100644
> --- a/drivers/pci/host/pcie-designware.c
> +++ b/drivers/pci/host/pcie-designware.c
> @@ -637,8 +637,6 @@ int dw_pcie_host_init(struct pcie_port *pp)
>  		}
>  	}
>  
> -	pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
> -
>  	if (pp->ops->host_init)
>  		pp->ops->host_init(pp);
>  
> @@ -809,6 +807,11 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
>  {
>  	u32 val;
>  
> +	/* get iATU unroll support */
> +	pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
> +	dev_dbg(pp->dev, "iATU unroll: %s\n",
> +		pp->iatu_unroll_enabled ? "enabled" : "disabled");
> +
>  	/* set the number of lanes */
>  	val = dw_pcie_readl_rc(pp, PCIE_PORT_LINK_CONTROL);
>  	val &= ~PORT_LINK_MODE_MASK;
> 

Acked-by: Joao Pinto <jpinto@synopsys.com>

Thanks
Joao

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

* Re: PCI: designware: check for iATU unroll support after initializing host
  2016-10-14 21:54 [PATCH] PCI: designware: check for iATU unroll support after initializing host Niklas Cassel
  2016-10-17 14:34 ` Joao Pinto
@ 2016-10-29 14:01 ` James Le Cuirot
  2016-11-02 15:48 ` [PATCH] " Olof Johansson
  2016-11-02 16:26 ` Bjorn Helgaas
  3 siblings, 0 replies; 5+ messages in thread
From: James Le Cuirot @ 2016-10-29 14:01 UTC (permalink / raw)
  To: Niklas Cassel
  Cc: jingoohan1, pratyush.anand, bhelgaas, Joao Pinto, linux-pci,
	linux-kernel

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

On Fri, 14 Oct 2016 23:54:55 +0200
Niklas Cassel <niklas.cassel@axis.com> wrote:

> From: Niklas Cassel <niklas.cassel@axis.com>
> 
> dw_pcie_iatu_unroll_enabled reads a dbi_base register.
> Reading any dbi_base register before pp->ops->host_init has been
> called causes "imprecise external abort" on platforms like ARTPEC-6,
> where the PCIe module is disabled at boot and first enabled in
> pp->ops->host_init. Move dw_pcie_iatu_unroll_enabled to
> dw_pcie_setup_rc, since it is after pp->ops->host_init, but before
> pp->iatu_unroll_enabled is actually used.
> 
> Fixes: a0601a470537 ("PCI: designware: Add iATU Unroll feature")
> Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
> Acked-by: Joao Pinto <jpinto@synopsys.com>

Tested-by: James Le Cuirot <chewi@gentoo.org>

My Utilite Pro was failing to boot and this fixed it so thanks.

> ---
>  drivers/pci/host/pcie-designware.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/host/pcie-designware.c
> b/drivers/pci/host/pcie-designware.c index 035f50c03281..bed19994c1e9
> 100644 --- a/drivers/pci/host/pcie-designware.c
> +++ b/drivers/pci/host/pcie-designware.c
> @@ -637,8 +637,6 @@ int dw_pcie_host_init(struct pcie_port *pp)
>  		}
>  	}
>  
> -	pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
> -
>  	if (pp->ops->host_init)
>  		pp->ops->host_init(pp);
>  
> @@ -809,6 +807,11 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
>  {
>  	u32 val;
>  
> +	/* get iATU unroll support */
> +	pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
> +	dev_dbg(pp->dev, "iATU unroll: %s\n",
> +		pp->iatu_unroll_enabled ? "enabled" : "disabled");
> +
>  	/* set the number of lanes */
>  	val = dw_pcie_readl_rc(pp, PCIE_PORT_LINK_CONTROL);
>  	val &= ~PORT_LINK_MODE_MASK;

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 949 bytes --]

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

* Re: [PATCH] PCI: designware: check for iATU unroll support after initializing host
  2016-10-14 21:54 [PATCH] PCI: designware: check for iATU unroll support after initializing host Niklas Cassel
  2016-10-17 14:34 ` Joao Pinto
  2016-10-29 14:01 ` James Le Cuirot
@ 2016-11-02 15:48 ` Olof Johansson
  2016-11-02 16:26 ` Bjorn Helgaas
  3 siblings, 0 replies; 5+ messages in thread
From: Olof Johansson @ 2016-11-02 15:48 UTC (permalink / raw)
  To: Niklas Cassel, Bjorn Helgaas
  Cc: Jingoo Han, pratyush.anand, Joao.Pinto, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org, Niklas Cassel

Hi,

On Fri, Oct 14, 2016 at 2:54 PM, Niklas Cassel <niklas.cassel@axis.com> wrote:
> From: Niklas Cassel <niklas.cassel@axis.com>
>
> dw_pcie_iatu_unroll_enabled reads a dbi_base register.
> Reading any dbi_base register before pp->ops->host_init has been called
> causes "imprecise external abort" on platforms like ARTPEC-6, where the
> PCIe module is disabled at boot and first enabled in pp->ops->host_init.
> Move dw_pcie_iatu_unroll_enabled to dw_pcie_setup_rc, since it is after
> pp->ops->host_init, but before pp->iatu_unroll_enabled is actually used.
>
> Fixes: a0601a470537 ("PCI: designware: Add iATU Unroll feature")
> Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>

This fixes the regression I've seen on i.MX6 devices in my board farm as well.

Acked-by: Olof Johansson <olof@lixom.net>

Bjorn, can you please pick this up and get it sent up for 4.9-rc soon?
I worry about losing bisectability if this remains broken for a while.
Thanks!


-Olof

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

* Re: [PATCH] PCI: designware: check for iATU unroll support after initializing host
  2016-10-14 21:54 [PATCH] PCI: designware: check for iATU unroll support after initializing host Niklas Cassel
                   ` (2 preceding siblings ...)
  2016-11-02 15:48 ` [PATCH] " Olof Johansson
@ 2016-11-02 16:26 ` Bjorn Helgaas
  3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2016-11-02 16:26 UTC (permalink / raw)
  To: Niklas Cassel
  Cc: jingoohan1, pratyush.anand, bhelgaas, Joao.Pinto, linux-pci,
	linux-kernel, Niklas Cassel

On Fri, Oct 14, 2016 at 11:54:55PM +0200, Niklas Cassel wrote:
> From: Niklas Cassel <niklas.cassel@axis.com>
> 
> dw_pcie_iatu_unroll_enabled reads a dbi_base register.
> Reading any dbi_base register before pp->ops->host_init has been called
> causes "imprecise external abort" on platforms like ARTPEC-6, where the
> PCIe module is disabled at boot and first enabled in pp->ops->host_init.
> Move dw_pcie_iatu_unroll_enabled to dw_pcie_setup_rc, since it is after
> pp->ops->host_init, but before pp->iatu_unroll_enabled is actually used.
> 
> Fixes: a0601a470537 ("PCI: designware: Add iATU Unroll feature")
> Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>

Applied to for-linus for v4.9 with acks and tested-by from Joao, Olof,
and James, thanks!

> ---
>  drivers/pci/host/pcie-designware.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
> index 035f50c03281..bed19994c1e9 100644
> --- a/drivers/pci/host/pcie-designware.c
> +++ b/drivers/pci/host/pcie-designware.c
> @@ -637,8 +637,6 @@ int dw_pcie_host_init(struct pcie_port *pp)
>  		}
>  	}
>  
> -	pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
> -
>  	if (pp->ops->host_init)
>  		pp->ops->host_init(pp);
>  
> @@ -809,6 +807,11 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
>  {
>  	u32 val;
>  
> +	/* get iATU unroll support */
> +	pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
> +	dev_dbg(pp->dev, "iATU unroll: %s\n",
> +		pp->iatu_unroll_enabled ? "enabled" : "disabled");
> +
>  	/* set the number of lanes */
>  	val = dw_pcie_readl_rc(pp, PCIE_PORT_LINK_CONTROL);
>  	val &= ~PORT_LINK_MODE_MASK;
> -- 
> 2.1.4
> 
> --
> 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] 5+ messages in thread

end of thread, other threads:[~2016-11-02 16:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-14 21:54 [PATCH] PCI: designware: check for iATU unroll support after initializing host Niklas Cassel
2016-10-17 14:34 ` Joao Pinto
2016-10-29 14:01 ` James Le Cuirot
2016-11-02 15:48 ` [PATCH] " Olof Johansson
2016-11-02 16:26 ` Bjorn Helgaas

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).