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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id ED8F2C77B60 for ; Fri, 28 Apr 2023 20:10:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=wcGw8aK5tlP8mCl8Q9eK8U3Bb5ppa1dyFVrx9wF1HXk=; b=Rwv8XmTjshzhSX jsV6+aP4J4m/xofgJ1loy3gPamx/ps1gvaSIm1HYX6D+d4hMkjYtx38KANTfD9EKI6X4wT5rwPwUv GOaUbe7X+dQkJez2/PrSStHz8sFIizowID0YTmg/6PG6IJV55qtJBgUw74R6co5ed0uqDTJwW7Qum I6ftVCisPAtXqx/+Q95LboP5tc4p/QdeFifbbM+sp38WI5D14N/pMgoor8335+yQWg5C4b+5L14aM AOXeSAIgPdoboDomFnKCrg60X3oCwoTpdq+kTcnj2vPmNjes+Y+D8oWqjfjptVmzOebaHRpZWsFuN 9mfQSgCM9pxb/5ZMB2Sg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1psUPF-00Bhh3-1E; Fri, 28 Apr 2023 20:09:25 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1psUPB-00Bhfx-25; Fri, 28 Apr 2023 20:09:23 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A922B61291; Fri, 28 Apr 2023 20:09:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBE2DC433D2; Fri, 28 Apr 2023 20:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682712559; bh=audxmFyFfzKOzyoEf7CTSzuG77aOVueJU+fs+OT6QdM=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=gmwmeh3nYlaOJciNrWIxTRgwUw5/hXOkHvvVy1aYvbFtfN5+EpxW2zz6bXYD2JtY5 r/iFRuaIJFNiHddfPEXA0VigK56abay3652iAhmUYyWDFYQM1abYps8AqZ0G8u9HkQ JBTf+moZ3ny3l2ZNWzXp0Vff6iDJ+7KMiNOiSiumbHO1Z0tRwax1Icf1eTRVAM0OxE 5ApUk8Vcc0TY4MrfIeXzxMOFIKdyto5geze7Aiktfv0DL/bkSlUeTwv3McX1Ep41Io XCVbfWDK3dKw1OdOSRlJXogNkh7YfZTLkBVNqPD7Z3uE0vgrxVLxiNHEEwBZlzT6cw C7ckCPuGonLMg== Date: Fri, 28 Apr 2023 15:09:16 -0500 From: Bjorn Helgaas To: Frank Wunderlich Cc: linux-mediatek@lists.infradead.org, Rob Herring , Ryder Lee , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , linux-pci@vger.kernel.org, Lorenzo Pieralisi , linux-kernel@vger.kernel.org, Jianjun Wang , Matthias Brugger , Bjorn Helgaas , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] PCI: mediatek-gen3: handle PERST after reset Message-ID: <20230428200916.GA361406@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230402131347.99268-1-linux@fw-web.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230428_130921_742018_6C27A9D6 X-CRM114-Status: GOOD ( 23.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Apr 02, 2023 at 03:13:47PM +0200, Frank Wunderlich wrote: > From: Frank Wunderlich > > De-assert PERST in separate step after reset signals to fully comply > the PCIe CEM clause 2.2. I guess this refers to PCIe CEM r5.0, sec 2.2. > This fixes some NVME detection issues on mt7986. > > Fixes: d3bf75b579b9 ("PCI: mediatek-gen3: Add MediaTek Gen3 driver for MT8192") > Signed-off-by: Frank Wunderlich > --- > Patch is taken from user Ruslan aka RRKh61 (permitted me to send it > with me as author). > > https://forum.banana-pi.org/t/bpi-r3-nvme-connection-issue/14563/17 > --- > drivers/pci/controller/pcie-mediatek-gen3.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c b/drivers/pci/controller/pcie-mediatek-gen3.c > index b8612ce5f4d0..176b1a04565d 100644 > --- a/drivers/pci/controller/pcie-mediatek-gen3.c > +++ b/drivers/pci/controller/pcie-mediatek-gen3.c > @@ -350,7 +350,13 @@ static int mtk_pcie_startup_port(struct mtk_gen3_pcie *pcie) > msleep(100); > > /* De-assert reset signals */ > - val &= ~(PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB | PCIE_PE_RSTB); > + val &= ~(PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB); > + writel_relaxed(val, pcie->base + PCIE_RST_CTRL_REG); > + > + msleep(100); There should be a #define for the 100ms value since it is required by the generic PCIe CEM spec, not by anything specific to mediatek. If one already exists, we should use it. If not, we should add one. pcie-tegra194.c and pcie-mediatek.c (at least) also have similar delays and should also use the same #define. There are several other drivers that contain "msleep(100)", but I didn't look to see their purpose. > + /* De-assert PERST# signals */ > + val &= ~(PCIE_PE_RSTB); > writel_relaxed(val, pcie->base + PCIE_RST_CTRL_REG); > > /* Check if the link is up or not */ > -- > 2.34.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel