From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C56C9C38A2A for ; Wed, 6 May 2020 10:43:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A03D620753 for ; Wed, 6 May 2020 10:43:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588761786; bh=qjFxbQJhwnjLswkECG7XON/LpTe8nEe02+5NBDCvjtA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=t4qIL1asPaFWPQ98IH/n31j67zx0Ny55hoSEx59J3HH0BNb38xJ5Dkv5e+mSEI2jl ELqhLV0mRl4zYZuShO94X8bYcOgKw3eGzHitwSQuEq2KR7JFwDo8cRuiLoV8hIvHab jt1JF88Ub8z1QQcQGeFBoDx91tCezR0NxKjU+xnU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729222AbgEFKnG (ORCPT ); Wed, 6 May 2020 06:43:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:37414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725824AbgEFKnF (ORCPT ); Wed, 6 May 2020 06:43:05 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9094220663; Wed, 6 May 2020 10:43:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588761784; bh=qjFxbQJhwnjLswkECG7XON/LpTe8nEe02+5NBDCvjtA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cSbK4h9sQzP5m7pYiJdwdOo8ET3iaMr1rZpcO1x03ZxG4zrp7HgG27gc5E7iKlYBV z2CtAHjpeUw4uiCUovjFTfPrPUqzcEN6baYqdqmiSR5ifUKXGAwuafruomAwTALY0U 9LXU2MHGZNFu4pBSupEbhF2T4zGWwTpkr0kniM8g= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jWHW2-009vEj-UY; Wed, 06 May 2020 11:43:03 +0100 Date: Wed, 6 May 2020 11:43:01 +0100 From: Marc Zyngier To: linux-pci@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Kevin Hilman , Yue Wang Cc: Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi Subject: Re: [PATCH] PCI: amlogic: meson: Don't use FAST_LINK_MODE to set up link Message-ID: <20200506114301.7288c02d@why> In-Reply-To: <20200429164230.309922-1-maz@kernel.org> References: <20200429164230.309922-1-maz@kernel.org> Organization: Approximate X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-pci@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bhelgaas@google.com, robh@kernel.org, lorenzo.pieralisi@arm.com, khilman@baylibre.com, yue.wang@Amlogic.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Apr 2020 17:42:30 +0100 Marc Zyngier wrote: > My vim3l board stubbornly refuses to play ball with a bog > standard PCIe switch (ASM1184e), spitting all kind of errors > ranging from link never coming up to crazy things like downstream > ports falling off the face of the planet. > > Upon investigating how the PCIe RC is configured, I found the > following nugget: the Sysnopsys DWC PCIe Reference Manual, in the > section dedicated to the PLCR register, describes bit 7 (FAST_LINK_MODE) > as: > > "Sets all internal timers to fast mode for simulation purposes." > > I completely understand the need for setting this bit from a simulation > perspective, but what I have on my desk is actual silicon, which > expects timers to have a nominal value (and I expect this is the > case for most people). > > Making sure the FAST_LINK_MODE bit is cleared when configuring the RC > solves this problem. > > Fixes: 9c0ef6d34fdb ("PCI: amlogic: Add the Amlogic Meson PCIe controller driver") > Signed-off-by: Marc Zyngier > --- > drivers/pci/controller/dwc/pci-meson.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c > index 3715dceca1bf..ca59ba9e0ecd 100644 > --- a/drivers/pci/controller/dwc/pci-meson.c > +++ b/drivers/pci/controller/dwc/pci-meson.c > @@ -289,11 +289,11 @@ static void meson_pcie_init_dw(struct meson_pcie *mp) > meson_cfg_writel(mp, val, PCIE_CFG0); > > val = meson_elb_readl(mp, PCIE_PORT_LINK_CTRL_OFF); > - val &= ~LINK_CAPABLE_MASK; > + val &= ~(LINK_CAPABLE_MASK | FAST_LINK_MODE); > meson_elb_writel(mp, val, PCIE_PORT_LINK_CTRL_OFF); > > val = meson_elb_readl(mp, PCIE_PORT_LINK_CTRL_OFF); > - val |= LINK_CAPABLE_X1 | FAST_LINK_MODE; > + val |= LINK_CAPABLE_X1; > meson_elb_writel(mp, val, PCIE_PORT_LINK_CTRL_OFF); > > val = meson_elb_readl(mp, PCIE_GEN2_CTRL_OFF); Yue, Kevin: any comment on this? I found that the issue is reproducible even without a PCIe switch, depending on the single device I plug in this machine (an Intel SSD works fine, while a Marvell Ethernet adapter never shows up) as the LTSSM times out much earlier than it really should (HW timers running too quickly). Applying this patch makes every single device I have lying around work fine. Thanks, M. -- Jazz is not dead. It just smells funny... From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DF70C28CBC for ; Wed, 6 May 2020 10:43:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3971B20663 for ; Wed, 6 May 2020 10:43:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GllMu/iy"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="cSbK4h9s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3971B20663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ynwiusu6+twST+eow5fQcuyPRogP1uMYdcS4cEhzLy4=; b=GllMu/iyZej+0I 1px71tk9+yhyDyYW4xImPSG+rDW4pBdMry6WML3QDWHdr4Msz+vWPm9kR/enI0eTynrv/RnM8k7++ KrpHEiRph1MJ3YU2YnZ4eWF47yph1sp+EL5oBOQyxpV1kjnNHLH9FjK85USeAVa5KUPiQAHy3xphT PQGuOnUn9M0LN/s3RQh6s70JBkSJvNbZqMCbm9g/vthRiGOdrGJZo7GejCbKnNk/UTuxkNRdIoOXO zknUL2QZGw025RU+hSg66wjY+BQbQoiqzY9THwbRXQpYtZnD3fZBsI0rMEfNeey94EW1/uCip2g8u GVnUhyoq0rQ6RN4lIvNQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWHW9-0002vL-R7; Wed, 06 May 2020 10:43:09 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWHW5-0002u1-02; Wed, 06 May 2020 10:43:06 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9094220663; Wed, 6 May 2020 10:43:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588761784; bh=qjFxbQJhwnjLswkECG7XON/LpTe8nEe02+5NBDCvjtA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cSbK4h9sQzP5m7pYiJdwdOo8ET3iaMr1rZpcO1x03ZxG4zrp7HgG27gc5E7iKlYBV z2CtAHjpeUw4uiCUovjFTfPrPUqzcEN6baYqdqmiSR5ifUKXGAwuafruomAwTALY0U 9LXU2MHGZNFu4pBSupEbhF2T4zGWwTpkr0kniM8g= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jWHW2-009vEj-UY; Wed, 06 May 2020 11:43:03 +0100 Date: Wed, 6 May 2020 11:43:01 +0100 From: Marc Zyngier To: linux-pci@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Kevin Hilman , Yue Wang Subject: Re: [PATCH] PCI: amlogic: meson: Don't use FAST_LINK_MODE to set up link Message-ID: <20200506114301.7288c02d@why> In-Reply-To: <20200429164230.309922-1-maz@kernel.org> References: <20200429164230.309922-1-maz@kernel.org> Organization: Approximate X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-pci@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bhelgaas@google.com, robh@kernel.org, lorenzo.pieralisi@arm.com, khilman@baylibre.com, yue.wang@Amlogic.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200506_034305_078565_5F4DB626 X-CRM114-Status: GOOD ( 18.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 29 Apr 2020 17:42:30 +0100 Marc Zyngier wrote: > My vim3l board stubbornly refuses to play ball with a bog > standard PCIe switch (ASM1184e), spitting all kind of errors > ranging from link never coming up to crazy things like downstream > ports falling off the face of the planet. > > Upon investigating how the PCIe RC is configured, I found the > following nugget: the Sysnopsys DWC PCIe Reference Manual, in the > section dedicated to the PLCR register, describes bit 7 (FAST_LINK_MODE) > as: > > "Sets all internal timers to fast mode for simulation purposes." > > I completely understand the need for setting this bit from a simulation > perspective, but what I have on my desk is actual silicon, which > expects timers to have a nominal value (and I expect this is the > case for most people). > > Making sure the FAST_LINK_MODE bit is cleared when configuring the RC > solves this problem. > > Fixes: 9c0ef6d34fdb ("PCI: amlogic: Add the Amlogic Meson PCIe controller driver") > Signed-off-by: Marc Zyngier > --- > drivers/pci/controller/dwc/pci-meson.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c > index 3715dceca1bf..ca59ba9e0ecd 100644 > --- a/drivers/pci/controller/dwc/pci-meson.c > +++ b/drivers/pci/controller/dwc/pci-meson.c > @@ -289,11 +289,11 @@ static void meson_pcie_init_dw(struct meson_pcie *mp) > meson_cfg_writel(mp, val, PCIE_CFG0); > > val = meson_elb_readl(mp, PCIE_PORT_LINK_CTRL_OFF); > - val &= ~LINK_CAPABLE_MASK; > + val &= ~(LINK_CAPABLE_MASK | FAST_LINK_MODE); > meson_elb_writel(mp, val, PCIE_PORT_LINK_CTRL_OFF); > > val = meson_elb_readl(mp, PCIE_PORT_LINK_CTRL_OFF); > - val |= LINK_CAPABLE_X1 | FAST_LINK_MODE; > + val |= LINK_CAPABLE_X1; > meson_elb_writel(mp, val, PCIE_PORT_LINK_CTRL_OFF); > > val = meson_elb_readl(mp, PCIE_GEN2_CTRL_OFF); Yue, Kevin: any comment on this? I found that the issue is reproducible even without a PCIe switch, depending on the single device I plug in this machine (an Intel SSD works fine, while a Marvell Ethernet adapter never shows up) as the LTSSM times out much earlier than it really should (HW timers running too quickly). Applying this patch makes every single device I have lying around work fine. Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0110C28CBC for ; Wed, 6 May 2020 10:43:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8798B20663 for ; Wed, 6 May 2020 10:43:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cZVM5oNf"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="cSbK4h9s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8798B20663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EGlBJXgDrQzr9i+yS8IAZqx6cg/ARfSgevlU+UEs9Xk=; b=cZVM5oNfsK7SBD u0p2wPIzHi9Pnlz4X0LQxK96KuSct//64Cay4vRlaIHvNDPE8QoB0NPVSuyX+miljFOHdv1JF4QZm TzpmbpXW/XKp6xCRQ6cBvBvawwuvVrHExfIN0d6wKxBNckgQbs1pMaSTlbuW9CAduQ4SUDeasp3ps WoaiQs2lmmlMweGJWiWSptRzmTm3xn+803uojmQYX6/vcuyKkM3WUuhWdNLPJAACFMdAdYJS/rw39 fMfsaxhUS0tucsyENmZ98v0TJynftENy7n1DzuiW5KVQhSmBHesuwd9+i9iuEfoopXXebIi9jUoVV Gah9knYmmeSWnn6mxeyw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWHW8-0002uR-53; Wed, 06 May 2020 10:43:08 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWHW5-0002u1-02; Wed, 06 May 2020 10:43:06 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9094220663; Wed, 6 May 2020 10:43:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588761784; bh=qjFxbQJhwnjLswkECG7XON/LpTe8nEe02+5NBDCvjtA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cSbK4h9sQzP5m7pYiJdwdOo8ET3iaMr1rZpcO1x03ZxG4zrp7HgG27gc5E7iKlYBV z2CtAHjpeUw4uiCUovjFTfPrPUqzcEN6baYqdqmiSR5ifUKXGAwuafruomAwTALY0U 9LXU2MHGZNFu4pBSupEbhF2T4zGWwTpkr0kniM8g= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jWHW2-009vEj-UY; Wed, 06 May 2020 11:43:03 +0100 Date: Wed, 6 May 2020 11:43:01 +0100 From: Marc Zyngier To: linux-pci@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Kevin Hilman , Yue Wang Subject: Re: [PATCH] PCI: amlogic: meson: Don't use FAST_LINK_MODE to set up link Message-ID: <20200506114301.7288c02d@why> In-Reply-To: <20200429164230.309922-1-maz@kernel.org> References: <20200429164230.309922-1-maz@kernel.org> Organization: Approximate X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-pci@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bhelgaas@google.com, robh@kernel.org, lorenzo.pieralisi@arm.com, khilman@baylibre.com, yue.wang@Amlogic.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200506_034305_078565_5F4DB626 X-CRM114-Status: GOOD ( 18.90 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org On Wed, 29 Apr 2020 17:42:30 +0100 Marc Zyngier wrote: > My vim3l board stubbornly refuses to play ball with a bog > standard PCIe switch (ASM1184e), spitting all kind of errors > ranging from link never coming up to crazy things like downstream > ports falling off the face of the planet. > > Upon investigating how the PCIe RC is configured, I found the > following nugget: the Sysnopsys DWC PCIe Reference Manual, in the > section dedicated to the PLCR register, describes bit 7 (FAST_LINK_MODE) > as: > > "Sets all internal timers to fast mode for simulation purposes." > > I completely understand the need for setting this bit from a simulation > perspective, but what I have on my desk is actual silicon, which > expects timers to have a nominal value (and I expect this is the > case for most people). > > Making sure the FAST_LINK_MODE bit is cleared when configuring the RC > solves this problem. > > Fixes: 9c0ef6d34fdb ("PCI: amlogic: Add the Amlogic Meson PCIe controller driver") > Signed-off-by: Marc Zyngier > --- > drivers/pci/controller/dwc/pci-meson.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c > index 3715dceca1bf..ca59ba9e0ecd 100644 > --- a/drivers/pci/controller/dwc/pci-meson.c > +++ b/drivers/pci/controller/dwc/pci-meson.c > @@ -289,11 +289,11 @@ static void meson_pcie_init_dw(struct meson_pcie *mp) > meson_cfg_writel(mp, val, PCIE_CFG0); > > val = meson_elb_readl(mp, PCIE_PORT_LINK_CTRL_OFF); > - val &= ~LINK_CAPABLE_MASK; > + val &= ~(LINK_CAPABLE_MASK | FAST_LINK_MODE); > meson_elb_writel(mp, val, PCIE_PORT_LINK_CTRL_OFF); > > val = meson_elb_readl(mp, PCIE_PORT_LINK_CTRL_OFF); > - val |= LINK_CAPABLE_X1 | FAST_LINK_MODE; > + val |= LINK_CAPABLE_X1; > meson_elb_writel(mp, val, PCIE_PORT_LINK_CTRL_OFF); > > val = meson_elb_readl(mp, PCIE_GEN2_CTRL_OFF); Yue, Kevin: any comment on this? I found that the issue is reproducible even without a PCIe switch, depending on the single device I plug in this machine (an Intel SSD works fine, while a Marvell Ethernet adapter never shows up) as the LTSSM times out much earlier than it really should (HW timers running too quickly). Applying this patch makes every single device I have lying around work fine. Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic