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 D2968C83F34 for ; Thu, 17 Jul 2025 15:24: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References: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:List-Owner; bh=OFoZFsmVBgIgOnRb6v56ZyJVL3iVN9nED2Us643BX3E=; b=40FeOU9lcGevrFZH9ZM37YqMmW WYKEipK98deCamiHfW6T61zreu4dY4RLkwZeFeFqimcVt58cfAGiDuOW/JSU5t79fALWNnTKAFnVu PgAMInotpKB/5q6xvkpX8RmnptZDf+DXXJ4O8262b9nY5bNJyCmnIY314j9lW3mtG2XuMJpumAQ27 X6fwicr6rIAuQnzCvXrjmcvujeJbSvu9S/UwhKI3RVe5gtYbWoDa3MlebNAYD11Ya+RVHf4Gku1Em bY5GuM918T45rFSyhcF6unaIFPL9MUaQGIZ/lXmZlQRW0w51pfRVmlve5TVQimYErtnCYW7dZvTKh ZOPC1KQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1ucQSp-0000000AV07-25fM; Thu, 17 Jul 2025 15:24:03 +0000 Received: from mail-ua1-x92a.google.com ([2607:f8b0:4864:20::92a]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1ucP0s-0000000AIXq-1KXA; Thu, 17 Jul 2025 13:51:07 +0000 Received: by mail-ua1-x92a.google.com with SMTP id a1e0cc1a2514c-881114808e4so577816241.3; Thu, 17 Jul 2025 06:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752760265; x=1753365065; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=OFoZFsmVBgIgOnRb6v56ZyJVL3iVN9nED2Us643BX3E=; b=iUzNWGS5qcmCdTRMeiCwdF7MkTOom+N3g6zIWIHIvufJTQSjbwhQU3FUAjkGxnPOAI UYQAsKmXcKUacmwOaDWu5lPiEIyEK9JGJcXu111SEZuNBAHqN5fEnRUjZdYfaXA0nxJV +ffAtSd4FKFnb5DzUa0fU0zprlqpA6YYz/fovXnyJdY7PuIWnMscDUxxj4DznDBCodlJ /OsbXJnXVH0Q2wQFNVBHXwotqfrUZAmxjMYvbP2EqrdYTyhHB0xscpmrBb7u+uxixw4i 1p+BzvKifggSECYRPCJx27FpS/1pUEV2gwqnlSEbJbK5e3k/nTRCcghSqX/uwVt/NN3K U+UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752760265; x=1753365065; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OFoZFsmVBgIgOnRb6v56ZyJVL3iVN9nED2Us643BX3E=; b=pW+/C5HpzlzUdLDRMzh7976lmU2kvKE7cPiwoZpFt6cM47S2+rrqz62zcBjDyqyX+9 +LoAQhs99VGLKGoSiBtyJf0LDP0FS/q3W5JLuxyFaH4g4O2xvblQuYFWg/wEs+E9NPll yID+eDfY+fi1BtsfnisfgNeu12xfPTmNjlru/ZYYNVx20xPTGSXzZ1OB0gZFy0z7y80P dQwvrIzqQ9N8JkJVBV1wpjxrEf5YxlYxw5yhj5GJ/eJDZxDNsKNs1jNqpPdcNtxx1TP4 ProeqU98jwUNyHFQ+usiLRbCLe8c0Yc9CZCzlT0M/Eov+i1pRvFs/brab47JxFNYBxov Xxpw== X-Forwarded-Encrypted: i=1; AJvYcCVqDBYwWYRfYp7BdqS7P2XCfw2xO14XeRbXygcgYoNv46TgQ864mJH4VXAi4S0JYzYgcjatD9QMvpECN3pSMmqY@lists.infradead.org, AJvYcCX8RL8Bnq22Iq91IE6UYcPkdmxS4qTY7NQOT6YPFXNkVvAPI4Pt2qOlMd2t06nQP3jMFU66oeyGucekOU36xzI=@lists.infradead.org X-Gm-Message-State: AOJu0YznENbcWNiaIEf5br4ZETG2BJovOVc+BdX+wMK7Ut0BlJmXAqqU NzhDStdNoxsC4MpnnqLnac/jGbFLvLfybq5iRwfEjs1xYdSFJM2Eu8oT X-Gm-Gg: ASbGncsCHr5rnh8ooabkWgvUjsnYyRKBMjn3418y5rybN3isUc9y23UhLhGbY4FsPQx 4N2IloOJick2qMPyX3aSqtvGm8wanNZnJ+gMOPFM/6UXKx3DAFoLOrn1t+KWHioZwRf9E5YodWI BFdLNMe1W+k7E/Y7Ujn5DRXOsTVOzKsrXHTG7ivVIROToK+vilEY6u4BCON9yJWMEPWG+FsiLs2 eWd7O417B9nqCDfwxwDEBqEKfyLfy1n8FX+sEkhOKY1XQ0U2COrNmLzc7KbokVtJA0J5/cH/rcz GgYKRojrffUTqf/q6pbBAvdcafH7KsLgVK2mA8mqrB58appo6XGs52hn49Xeh2ybzvUtBz1/+Xm nVaCV6CoCxg== X-Google-Smtp-Source: AGHT+IGzgyrDUgDH08RDqZ3hkrbd5Lom3WMZY7KIBjhCX4qRVfQkKF54K0pt01hz0j8j+3pC5nv9qg== X-Received: by 2002:a05:6102:4421:b0:4e7:dbd2:4604 with SMTP id ada2fe7eead31-4f8999bcbeamr4068557137.17.1752760264477; Thu, 17 Jul 2025 06:51:04 -0700 (PDT) Received: from geday ([2804:7f2:800b:2246::dead:c001]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-4f62faf5ec1sm2853884137.23.2025.07.17.06.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jul 2025 06:51:03 -0700 (PDT) Date: Thu, 17 Jul 2025 10:50:49 -0300 From: Geraldo Nascimento To: Manivannan Sadhasivam Cc: Shawn Lin , linux-rockchip@lists.infradead.org, Hugh Cole-Baker , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Heiko Stuebner , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v3 2/3] PCI: rockchip-host: Retry link training on failure without PERST# Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250717_065106_371527_1FBD0C57 X-CRM114-Status: GOOD ( 23.10 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jul 17, 2025 at 05:59:32PM +0530, Manivannan Sadhasivam wrote: > On Mon, Jun 23, 2025 at 08:44:49AM GMT, Geraldo Nascimento wrote: > > On Mon, Jun 23, 2025 at 05:29:46AM -0600, Manivannan Sadhasivam wrote: > > > On Tue, Jun 10, 2025 at 04:05:40PM -0300, Geraldo Nascimento wrote: > > > > +reinit: > > > > > > So this reinit part only skips the PERST# assert, but calls > > > rockchip_pcie_init_port() which resets the Root Port including PHY. I don't > > > think it is safe to do it if PERST# is wired. > > > > I don't understand, could you be a bit more verbose on why do you > > think this is dangerous? > > > > When the Root Port and PHY gets reset, there is a good chance that the refclk > would also be cutoff. So if that happens without PERST# assert, then the device > has no chance to clean its state machine. If the device gets its own refclk, > then it is a different story, but we should not make assumptions. Hi Mani, thank you for your time spent looking into this! I'm not sure if the following information helps, but patch 2 of this series disables the PCIe 3.3V always-on/boot-on through DT. That was not incidental, and in fact it is required for patch 1 to work. Then, if you follow the proposed code change, you will see that power is effectively cut via disabling the power regulators, even before disabling the clocks. So there's effectively zero chance of corrupting the endpoint device state machine, since the device is power-cycled. While I understand we should not make assumptions on kernel work, and that the patch is unmergeable on its current form (it's a goddamn hack), it does empirically alleviate a very real report, that of known-good working devices refusing to cooperate with Rockchip-IP PCIe. I agree we should wait on Shawn Lin's feedback. Thank you, Geraldo Nascimento > > - Mani > > -- > மணிவண்ணன் சதாசிவம்