Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1649074rwr; Thu, 27 Apr 2023 23:02:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5e1uVnwlkmcJv061N7M3R+wsi8gXdBxrRZpruzqS3+cjj1HxG3HroUKE+QGc0BhAF0QLd8 X-Received: by 2002:a05:6a20:918a:b0:f0:2893:8a34 with SMTP id v10-20020a056a20918a00b000f028938a34mr5309452pzd.52.1682661724289; Thu, 27 Apr 2023 23:02:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682661724; cv=none; d=google.com; s=arc-20160816; b=RLq32mVWkraGpDokzhzE43bijy1Bo1yeaLVjo13KVn9I9YlSI83BVDspADPs3VUQki GRFeELuYRlLRi136hmCF7pnfmY2flL0R4fdqM6y6Wpua646xr72EkQACN2ju+4MHaKf+ c3ov1ZF8m36mtIlTIdEOT8AGRDThXFuCc1+GeaKT1fYWjqxwqRNceRWHR5CTIdPboJzi 4X5W78bUSZfT2pXgkiSsEQJjnIpRKhLMUEGd/FuXZFjlNoBostUehUroPsQkrZS89AK0 D0p5YClqv50RbXFX7ns7nMbOt4MGRVWiuPkWb/Pz4HNX3tIEwWsiFN13z/AUhEW8NxPv wcXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:references:in-reply-to:user-agent:subject:cc:to:from :date:dkim-signature; bh=CDtkCIn/nLZXXWzX5To63sdeI+HDe6I42ogqmZDgdf0=; b=aq8aeshCy28C0CZN6nPtkVmAy7CZxLeqk8ekeeeOofaa+VGU11ex0X6TbptUzl0mB8 1uyMuC3aHK7o0I2HVxy2p94A58lix+PLjzarKeW0NEGhCz6AVCIqC+ZM0DAR1yQczBJc F3tGG8gBPi7tue+dAyepKVBpKWkG1vmrMinSsCEVdTxuDVomJ5ThKGRZM/hCaTMwrdeK nvL9DntMoMvBjwD0UKjz6sA+1O7RMtpGzBg+Xz4z+/t0zYnwfsSrmtIMcjk51GnGaqg0 avL7xxWzFoWEo/kKCF4fxWO50liIWCceGSngmsxKHj1yauHCZILaN1sS25UdEDj9eEyq jX+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=CqPTpYqY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x24-20020a63db58000000b0050beb3fe627si21331507pgi.459.2023.04.27.23.01.49; Thu, 27 Apr 2023 23:02:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=CqPTpYqY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345341AbjD1Fuz (ORCPT + 99 others); Fri, 28 Apr 2023 01:50:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345333AbjD1Fuu (ORCPT ); Fri, 28 Apr 2023 01:50:50 -0400 Received: from mxout2.routing.net (mxout2.routing.net [IPv6:2a03:2900:1:a::b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC54B40FE; Thu, 27 Apr 2023 22:50:44 -0700 (PDT) Received: from mxbox3.masterlogin.de (unknown [192.168.10.78]) by mxout2.routing.net (Postfix) with ESMTP id 773436047E; Fri, 28 Apr 2023 05:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1682661042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CDtkCIn/nLZXXWzX5To63sdeI+HDe6I42ogqmZDgdf0=; b=CqPTpYqYfwrWmCuNy8oY8e/tOk5LM6+xGW21v3EuWn9CJHqJIqAA/OB890+1ccgm1Bl5Vb 4PLkfD9stcFJIElUdbgFIu7nb1apqoq8840sceTb9EifsoBtkj8EyPNA89nMgApi/Gyv8f B13+zPYBGgPe5N2uY88mGfioCCpb6gQ= Received: from [127.0.0.1] (fttx-pool-217.61.155.215.bambit.de [217.61.155.215]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 936D53605FC; Fri, 28 Apr 2023 05:50:41 +0000 (UTC) Date: Fri, 28 Apr 2023 07:50:42 +0200 From: Frank Wunderlich To: =?UTF-8?B?Smlhbmp1biBXYW5nICjnjovlu7rlhpsp?= , "frank-w@public-files.de" CC: "linux-mediatek@lists.infradead.org" , "linux-kernel@vger.kernel.org" , =?UTF-8?B?SmlleXkgWWFuZyAo5p2o5rSBKQ==?= , "robh@kernel.org" , "kw@linux.com" , "linux-arm-kernel@lists.infradead.org" , "matthias.bgg@gmail.com" , "linux-pci@vger.kernel.org" , "lpieralisi@kernel.org" , Ryder Lee , "bhelgaas@google.com" Subject: Re: Aw: [PATCH] PCI: mediatek-gen3: handle PERST after reset User-Agent: K-9 Mail for Android In-Reply-To: <74149a72313c1b944c870a45b55893e1b9331c8e.camel@mediatek.com> References: <20230402131347.99268-1-linux@fw-web.de> <74149a72313c1b944c870a45b55893e1b9331c8e.camel@mediatek.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mail-ID: 755e09e7-e3b0-4594-969c-7546f4326435 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 27=2E April 2023 10:31:07 MESZ schrieb "Jianjun Wang (=E7=8E=8B=E5=BB=BA= =E5=86=9B)" : >Hi Frank, > >Seems this patch has huge impact on boot time, I'm curious about the >NVMe detection issue on mt7986, can you share the SSD model that you >are using and the bootup logs with that SSD? Which "huge" delay do you get in which setup? It adds a 100ms delay yes,bu= t this seems needed to some devices working=2Ei found several sources talki= ng about the 100ms wake-up time=2E=2E=2E I do not have this issue,but some users in bpi-forum reorted it=2E Pcie-co= ntroller on mt7986/bpi-r3 does simply not detect the nvme and returned ETIM= EDOUT (110)=2E # dmesg | grep 'pci' [ 5=2E235564] mtk-pcie-gen3 11280000=2Epcie: host bridge /soc/pcie@1128000= 0 ranges: [ 5=2E242938] mtk-pcie-gen3 11280000=2Epcie: Parsing ranges property=2E=2E= =2E [ 5=2E249235] mtk-pcie-gen3 11280000=2Epcie: MEM 0x0020000000=2E=2E0x002ff= fffff -> 0x0020000000=20 [ 5=2E478062] mtk-pcie-gen3 11280000=2Epcie: PCIe link down, current LTSSM= state: detect=2Eactive (0x10 00001) [ 5=2E487491] mtk-pcie-gen3: probe of 11280000=2Epcie failed with error -1= 10 One specific hardware is reported as example: Adata Legend710 512GB x3 >Thanks=2E > >On Wed, 2023-04-26 at 19:41 +0200, Frank Wunderlich wrote: >> External email : Please do not click links or open attachments until >> you have verified the sender or the content=2E >>=20 >>=20 >> Hi >>=20 >> > Gesendet: Sonntag, 02=2E April 2023 um 15:13 Uhr >> > Von: "Frank Wunderlich" >> > De-assert PERST in separate step after reset signals to fully >> > comply >> > the PCIe CEM clause 2=2E2=2E >> >=20 >> > This fixes some NVME detection issues on mt7986=2E >> >=20 >> > 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)=2E >> >=20 >> >=20 >https://urldefense=2Ecom/v3/__https://forum=2Ebanana-pi=2Eorg/t/bpi-r3-nv= me-connection-issue/14563/17__;!!CTRNKA9wMg0ARbw!nCXEM685pkUpoiZYGKptPYccNr= WMeN2D3jIO5_irwxZJ7c6ZzEeACIx-V2WeZHAP_0FKlDDIQ0RbDJ892prtoToDv30$ >> > --- >> > drivers/pci/controller/pcie-mediatek-gen3=2Ec | 8 +++++++- >> > 1 file changed, 7 insertions(+), 1 deletion(-) >> >=20 >> > diff --git a/drivers/pci/controller/pcie-mediatek-gen3=2Ec >> > b/drivers/pci/controller/pcie-mediatek-gen3=2Ec >> > index b8612ce5f4d0=2E=2E176b1a04565d 100644 >> > --- a/drivers/pci/controller/pcie-mediatek-gen3=2Ec >> > +++ b/drivers/pci/controller/pcie-mediatek-gen3=2Ec >> > @@ -350,7 +350,13 @@ static int mtk_pcie_startup_port(struct >> > mtk_gen3_pcie *pcie) >> > msleep(100); >> >=20 >> > /* De-assert reset signals */ >> > - val &=3D ~(PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB | >> > PCIE_PE_RSTB); >> > + val &=3D ~(PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB); >> > + writel_relaxed(val, pcie->base + PCIE_RST_CTRL_REG); >> > + >> > + msleep(100); >> > + >> > + /* De-assert PERST# signals */ >> > + val &=3D ~(PCIE_PE_RSTB); >> > writel_relaxed(val, pcie->base + PCIE_RST_CTRL_REG); >> >=20 >> > /* Check if the link is up or not */ >>=20 >> Hi >>=20 >> just a friendly reminder=2E=2E=2E=2Edo i miss any recipient? >>=20 >> regards Frank >>=20 regards Frank