linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH resend] PCI: designware: fix register access before host init
@ 2016-10-18  8:25 Lucas Stach
  2016-10-18 16:30 ` Jingoo Han
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lucas Stach @ 2016-10-18  8:25 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Jingoo Han, Pratyush Anand, linux-pci, Gary Bisson, kernel,
	patchwork-lst

The function used to determine if iATU unroll is available will read
a RC register. This is not possible and will result in a system hang
if the RC is still in reset, so it is only safe to call this function
after host_init() has been called.

Fixes: a0601a470537 (PCI: designware: Add iATU Unroll feature)
Reported-by: Gary Bisson <gary.bisson@boundarydevices.com>
Tested-by: Gary Bisson <gary.bisson@boundarydevices.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/pci/host/pcie-designware.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index 035f50c03281..74510508fafc 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -637,11 +637,11 @@ 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);
 
+	pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
+
 	pp->root_bus_nr = pp->busn->start;
 	if (IS_ENABLED(CONFIG_PCI_MSI)) {
 		bus = pci_scan_root_bus_msi(pp->dev, pp->root_bus_nr,
-- 
2.9.3


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

end of thread, other threads:[~2016-10-21 16:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-18  8:25 [PATCH resend] PCI: designware: fix register access before host init Lucas Stach
2016-10-18 16:30 ` Jingoo Han
2016-10-18 18:36 ` Fabio Estevam
2016-10-21 15:31 ` Bjorn Helgaas
2016-10-21 16:22   ` Bjorn Helgaas
2016-10-21 16:44     ` João Pinto

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