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=-10.1 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_GIT 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 EEC0EC83000 for ; Wed, 29 Apr 2020 16:42:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4FE1208FE for ; Wed, 29 Apr 2020 16:42:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588178558; bh=vH8eIR3MMlTacZK4WfkYpv1el05yTxrI9SEhKlzGIcg=; h=From:To:Cc:Subject:Date:List-ID:From; b=0FjZg5cxw5qvUL19ipG7aaSzxQmP9QsSbxdskA4sZV6IYUX2N500pGiMZHuZK7sqO UU5Ru/3y8pRByKsSVGxWstmii3GImLcqh1ol48dvyMtWtgdZ8DpUlYilT5v490saw+ NASiCp6uuvNBUNY+JcoAGU5kUtWN5LaP1JBt88a0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726519AbgD2Qmi (ORCPT ); Wed, 29 Apr 2020 12:42:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:53866 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726493AbgD2Qmi (ORCPT ); Wed, 29 Apr 2020 12:42:38 -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 56B6020787; Wed, 29 Apr 2020 16:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588178557; bh=vH8eIR3MMlTacZK4WfkYpv1el05yTxrI9SEhKlzGIcg=; h=From:To:Cc:Subject:Date:From; b=aV5IKpRSmbzOy/KapP8clDwAjF1XQgvhlAAKcGpyPC3fA71gVOlb1VJEFJUyWeh5R b8Q2FzDd80vPcdKaLjRdVqQEl3atumGCJaFIhAFsbNFW1Fz0nhWOEWLApaaE/SvBfl OZn2BehNgeP9BLcn27Z3FwzmO5d9zEizNcZLDDyU= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jTpn9-007lrk-7s; Wed, 29 Apr 2020 17:42:35 +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 Cc: Yue Wang , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Kevin Hilman Subject: [PATCH] PCI: amlogic: meson: Don't use FAST_LINK_MODE to set up link Date: Wed, 29 Apr 2020 17:42:30 +0100 Message-Id: <20200429164230.309922-1-maz@kernel.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, yue.wang@Amlogic.com, lorenzo.pieralisi@arm.com, robh@kernel.org, bhelgaas@google.com, khilman@baylibre.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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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); -- 2.26.2