From patchwork Fri Jul 18 09:26:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 4581551 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1BBB7C0514 for ; Fri, 18 Jul 2014 09:32:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 641D720120 for ; Fri, 18 Jul 2014 09:32:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 765A32011E for ; Fri, 18 Jul 2014 09:32:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X84TO-0006s0-JO; Fri, 18 Jul 2014 09:29:02 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X84TI-0006ac-7l for linux-arm-kernel@lists.infradead.org; Fri, 18 Jul 2014 09:29:00 +0000 Received: from weser.hi.pengutronix.de ([2001:6f8:1178:2:fa0f:41ff:fe58:4010]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1X84Sp-000768-8e; Fri, 18 Jul 2014 11:28:27 +0200 Message-ID: <1405675599.6072.8.camel@weser.hi.pengutronix.de> Subject: Re: [RFC] PCI: pci-imx6: Add delay to workaround kernel hang From: Lucas Stach To: Tim Harvey Date: Fri, 18 Jul 2014 11:26:39 +0200 In-Reply-To: References: <1403637507-9424-1-git-send-email-festevam@gmail.com> <20140626031247.GN2224@dragon> <20140626054937.GB7859@dragon> X-Mailer: Evolution 3.8.5-2+b1 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 2001:6f8:1178:2:fa0f:41ff:fe58:4010 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140718_022856_503711_E8147553 X-CRM114-Status: GOOD ( 24.09 ) X-Spam-Score: -0.0 (/) Cc: Richard Zhu , Marek =?UTF-8?Q?Va=C5=A1ut?= , Fabio Estevam , "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Sascha Hauer , Bjorn Helgaas , "David =?ISO-8859-1?Q?M=FCller?= \(ELSOFT AG\)" , Fabio Estevam , Shawn Guo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Tim, Am Donnerstag, den 26.06.2014, 17:29 -0700 schrieb Tim Harvey: [...] > Shawn / Richard, > > I am also affected by this issue on IMX6 boards that I support. If I > enable PCI in the bootloader I see similar hangs. > > I have the following hardware configurations on my bench: > 1. IMX6DL + i210 (same PCI setup as Fabio's above, but DL instead of Q) > 2. IMX6Q + ath9k device > 3. IMX6DL + PLX PEX860x PCIe-to-PCIe bridge with various devices > behind the bridge, using a clock buffer from IMX6 PCIe clock > 4. IMX6Q + PLX PEX860x PCIe-to-PCIe bridge with various devices > behind the bridge, using a clock buffer from IMX6 PCIe clock > 5. IMX6Q + PLX PEX860x PCIe-to-PCIe bridge with various devices > behind the bridge using a clock generator (always on, ignoring the > PCIe clock) > > For all of the above I have no PCI issues using > 3.14/3.15/3.16-rc2/vendor 3.10.17_1.0.0_ga unless I enable PCI in the > bootloader. When I do so, all of the above configurations hang > somewhere around PCI init/enumeration. The same occurs with the most > recent vendor kernel 3.10.17_1.0.0_ga kernel (works when PCI is > disabled in the bootloader, hangs otherwise). > > When I apply Fabio's patch above to the 3.16-rc2 kernel I find that > scenarios #4 and #5 above then work, #3 boots but the PLX bridge fails > all config cycles (0xff's), #2 boots but with no PCIe link, and #1 > above still hangs. Previously, when I have dug into this particular > 'hang' issue on 3.15 I found that the delay needed to be between > imx6_pcie_probe() requesting and asserting reset_gpio low, and before > setting IOMUX_GPR1:18 to power down the PCIe PHY (note here, that the > PHY is currently enabled in the bootloader when PCI is enabled there). > > When I apply Fabio's patch above to the most recent vendor kernel > 3.10.17_1.0.0_ga I still hang in all cases. > > So while I agree there is something horribly wrong with IMX6 PCI > still, I don't think Fabio's patch is the right solution and I don't > have anything better at this point in time. I'm happy to share any > hardware with anyone that can work through this issue. > Can you try if the attached patch makes any difference? Regards, Lucas ------------------------------>8--------------------------------- From 0e2fc443c760290166f6371d50813e6c30a678da Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Thu, 17 Jul 2014 18:54:44 +0200 Subject: [PATCH] try forcing LTSSM into detect state --- drivers/pci/host/pci-imx6.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index a568efaa331c..afa450c54aba 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c @@ -215,6 +215,8 @@ static int imx6_pcie_assert_core_reset(struct pcie_port *pp) { struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp); + regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, + IMX6Q_GPR12_PCIE_CTL_2, 0 << 10); regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, IMX6Q_GPR1_PCIE_TEST_PD, 1 << 18); regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,