PCI: designware: check for iATU unroll support after initializing host
PATCH 1/1 PCI: designware: check for iATU unroll support after initializing host
From: Niklas Cassel <[email protected]>
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.
--- drivers/pci/host/pcie-designware.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/pci/host/pcie-designware.c +5 -2
@@ -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 ;
Signature · 1 line
2.1.4
Quoted 31 lines · Niklas Cassel
From: Niklas Cassel <[email protected]>
dw_pcie_iatu_unroll_enabledreads adbi_baseregister. Reading anydbi_baseregister beforepp->ops->host_inithas been called causes "imprecise external abort" on platforms like ARTPEC-6, where the PCIe module is disabled at boot and first enabled inpp->ops->host_init. Movedw_pcie_iatu_unroll_enabledtodw_pcie_setup_rc, since it is afterpp->ops->host_init, but beforepp->iatu_unroll_enabledis actually used.Fixes a0601a470537 ("PCI: designware: Add iATU Unroll feature")Signed-off-by Niklas Cassel <[email protected]>--- drivers/pci/host/pcie-designware.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/pci/host/pcie-designware.c +0
-2@@ -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) {
drivers/pci/host/pcie-designware.c void dw_pcie_setup_rc(struct pcie_port *pp) · line 817
Quoted 10 lines
drivers/pci/host/pcie-designware.c +5
-0u32 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 ;
Thanks
Joao
Quoted 10 lines · On Fri, 14 Oct 2016 23:54:55 +0200 Niklas Cassel <[email protected]> wrote:
From: Niklas Cassel <[email protected]>
dw_pcie_iatu_unroll_enabledreads adbi_baseregister. Reading anydbi_baseregister beforepp->ops->host_inithas been called causes "imprecise external abort" on platforms like ARTPEC-6, where the PCIe module is disabled at boot and first enabled inpp->ops->host_init. Movedw_pcie_iatu_unroll_enabledtodw_pcie_setup_rc, since it is afterpp->ops->host_init, but beforepp->iatu_unroll_enabledis actually used.
Quoted 3 lines
Fixes a0601a470537 ("PCI: designware: Add iATU Unroll feature")Signed-off-by Niklas Cassel <[email protected]>Acked-by Joao Pinto <[email protected]>
My Utilite Pro was failing to boot and this fixed it so thanks.
Quoted 29 lines
--- drivers/pci/host/pcie-designware.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/pci/host/pcie-designware.cindex035f50c03281..bed19994c1e9100644 ---a/drivers/pci/host/pcie-designware.c
+++b/drivers/pci/host/pcie-designware.cdrivers/pci/host/pcie-designware.c +5
-2@@ -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 ;
Hi,
Quoted 11 lines · Niklas Cassel
From: Niklas Cassel <[email protected]>
dw_pcie_iatu_unroll_enabledreads adbi_baseregister. Reading anydbi_baseregister beforepp->ops->host_inithas been called causes "imprecise external abort" on platforms like ARTPEC-6, where the PCIe module is disabled at boot and first enabled inpp->ops->host_init. Movedw_pcie_iatu_unroll_enabledtodw_pcie_setup_rc, since it is afterpp->ops->host_init, but beforepp->iatu_unroll_enabledis actually used.Fixes a0601a470537 ("PCI: designware: Add iATU Unroll feature")Signed-off-by Niklas Cassel <[email protected]>
This fixes the regression I've seen on i.MX6 devices in my board farm as well.
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
Quoted 11 lines · Niklas Cassel
From: Niklas Cassel <[email protected]>
dw_pcie_iatu_unroll_enabledreads adbi_baseregister. Reading anydbi_baseregister beforepp->ops->host_inithas been called causes "imprecise external abort" on platforms like ARTPEC-6, where the PCIe module is disabled at boot and first enabled inpp->ops->host_init. Movedw_pcie_iatu_unroll_enabledtodw_pcie_setup_rc, since it is afterpp->ops->host_init, but beforepp->iatu_unroll_enabledis actually used.Fixes a0601a470537 ("PCI: designware: Add iATU Unroll feature")Signed-off-by Niklas Cassel <[email protected]>
Applied to for-linus for v4.9 with acks and tested-by from Joao, Olof, and James, thanks!
Quoted 36 lines
--- drivers/pci/host/pcie-designware.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/pci/host/pcie-designware.c +5
-2@@ -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 ;Signature · 6 lines
2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html