Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1749620ybk; Mon, 11 May 2020 03:24:24 -0700 (PDT) X-Google-Smtp-Source: APiQypIMGfrFtAI6gaR9m0J/AtFNa33ClZU9918EU976KP4VFhxmQqTa5xaOyLMmxTNs4q6+hH0O X-Received: by 2002:a50:c60c:: with SMTP id k12mr12453279edg.111.1589192664415; Mon, 11 May 2020 03:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589192664; cv=none; d=google.com; s=arc-20160816; b=YxOXZHHFzKPW6lJ+TUQnyQ2bOQXE13rFCdlCtPotVNaYSGXXxLX1nMV/VbtVs5G3Eh K1Up6SIQQe86Bm7bbXMAheZxd4yIdpSc7x5uyO9DjRwA0vZSTfF6Yfems4a+fDFEDsWK 7KJKMRAFSgQg/NbXUriyAFbmY6Eopiy/8CcHZpO6iXjR/cl5dVZbct2tDDNWsqH1WbHl 8chnNsjIdNTwTU3ag9onpsFeIldqwqRd3HZloYWX71D/T074qO3SwhvW9TBLKKb8IjxR cqFeLTrniQb9cRXRTEfNb7TJJV7x2Fh80Gj/7OxdMBUGti8EXxWDA3Zko4zlQyql9xAv c9nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=QOGh/K3aXoIQ+3WMn7D82HzlOlxOdFEOIjMrCIY59cE=; b=sqw6OfMC0OTt1d3CASR4gySXeQIH4DVLHP/0sl1Sj7VyVwAlm2WVc36VQEl2vjWTnD png3cgfQ6VPHOa30Ob6/4CnRzFYH6f1o2BPdZx9sPfRCnY7mGPqa/zTJdNUFC62G3+11 6cuKSO2k+vNhHbiAcmeaDu6H5wRzhzG8uIkz5n7/w5SUey0iujhjSMZVy5mFCg3Efc3j zc/+VnjO2ITmkrF3Paxg/Rz6efqrbwu/5laaSJzpjm8YCeARRrCdfa4VTLm4brvrQLp/ sGIh4J02YVUED50egsoEiWcFoXAlA2t2Ajt3LiLKjui2hsXiCA2D7NPDKvUDZoJoWHqO bfCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v29si5139016eda.533.2020.05.11.03.24.00; Mon, 11 May 2020 03:24:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729430AbgEKKWp (ORCPT + 99 others); Mon, 11 May 2020 06:22:45 -0400 Received: from foss.arm.com ([217.140.110.172]:55588 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729232AbgEKKWo (ORCPT ); Mon, 11 May 2020 06:22:44 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7D3A51FB; Mon, 11 May 2020 03:22:43 -0700 (PDT) Received: from e121166-lin.cambridge.arm.com (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4790F3F305; Mon, 11 May 2020 03:22:42 -0700 (PDT) Date: Mon, 11 May 2020 11:22:40 +0100 From: Lorenzo Pieralisi To: Marc Zyngier Cc: linux-pci@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Yue Wang , Rob Herring , Bjorn Helgaas , Kevin Hilman Subject: Re: [PATCH] PCI: amlogic: meson: Don't use FAST_LINK_MODE to set up link Message-ID: <20200511102239.GC24149@e121166-lin.cambridge.arm.com> References: <20200429164230.309922-1-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200429164230.309922-1-maz@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2020 at 05:42:30PM +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(-) Reworded the commit log (even if yours was more fun :)) and applied to pci/dwc, thanks ! Lorenzo > 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 >