Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1721717ybj; Wed, 6 May 2020 04:13:29 -0700 (PDT) X-Google-Smtp-Source: APiQypLbpdrlxKTOQnhCjr9b5sFIhHd6EerMQu1Nk6OaEI9JKfUWANiQ9FEo7MYtf9OVepoh30Xo X-Received: by 2002:aa7:d311:: with SMTP id p17mr6339604edq.73.1588763608889; Wed, 06 May 2020 04:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588763608; cv=none; d=google.com; s=arc-20160816; b=ZbTL8ZX66ybtKsL4qdgNemKyv0C48LQvf+b6ePTbNEEHra6la9SVgxbHn7YriCHpQM JmWknKhpHRQ7frI9G/UNTa+TE43McZZYEXr22F/yJKQj2pWSpfdjfeq3GC15aSeQzo06 pkMXgDpDXCpus8pzNS8UYDelIeTiW+PFAeRfn9afcnradWjAX11ENLF7wdTGSjQX9kVc rKqa3OCee+LXzg5Kg7aR5IekNHXboZUD1c3ZnH/1QSR/1bNke9lraBWlTQbVy/8IMkc/ swfDXSbZBIB9hhutQyA4rjSyW2TOf7jNffZdbGKj5n2oqFRNdj3ZEiNzOEcLwLUCNE6i PvcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=/IKlXhSQnqnHm5jnxzeVcRMUdiv2mBMVsu4t55161vQ=; b=aHtrUyAF3xoaxWieTFuPmiboAyjj8iFjHQULg8fiBXidJ8Ve8VmgQyhw48jMF+zFfy mSNHy0Ec0PfnaNw+JVqPfvd56TkPlWM2Erdo2dRT6Kkj7vykQ4kyL4l+e0F8zZEY2a3W 0oTg3iDZPGqXEJtS8eqw0Xphg1aPpjlGyA7GM0vEBsbhEr07T3GVyZbSNM0bEenfaLny 0QqEy8D6h9yCcLYS6/SMj/hjp5KXRS5F8xtlsLif3wyxAfpiIP4mfnIs86dd+82qY9mv VYgW/M67sYNwdnfB/3fvUMqB/OuPDTN27HtfcDvE6zZ607t4u264fufQ4mc1T5BBGQdl WdiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cSbK4h9s; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f4si1023258ejd.83.2020.05.06.04.13.05; Wed, 06 May 2020 04:13:28 -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; dkim=pass header.i=@kernel.org header.s=default header.b=cSbK4h9s; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729214AbgEFKnF (ORCPT + 99 others); Wed, 6 May 2020 06:43:05 -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...