Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp1221905qtg; Thu, 30 Mar 2023 10:13:31 -0700 (PDT) X-Google-Smtp-Source: AKy350Yy6sWvm2vBj70kKDVJwn5i+kN66tNVcOY2t/VKXY1pyyjPVptLJoCy1DOsfXygIGRUdziJ X-Received: by 2002:a05:6402:268e:b0:502:465:28d4 with SMTP id w14-20020a056402268e00b00502046528d4mr3304515edd.1.1680196411208; Thu, 30 Mar 2023 10:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680196411; cv=none; d=google.com; s=arc-20160816; b=Y/XZkyRv9AkVxHJ0Kv3FJh70xumnAmrTKHShmAeetYZ1xBr3ZPcIaz6M/MMYNdk724 89cwvxxaeM83YV8HWsCp2Iu3QFslLBfZRYxPAFM0rvS0B3zzy+ai+dQ3Ob3B81ieNoJx DcJOcJUN3iTAzE4SuMCH3c1X+jyU1SdmWPeoI1SyFZ+V/ee/v31AbZ+XflsHVHJPfVB1 oprEc8ZtaeLlViFmdtDFMZ2LqsFdlO60vaZTQoVNT1BgfIJowPsKhh6FTrOX8KVivwld f7nz4rlMz9YUo0V9jI4UMbEF+Mcij0jhSX9fC4QwG6cbpfHpVhuyAvUi0xtXGm5FIa7W h03A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=nNbJ0JwXlGtSECPnlZkGH0QNaBMZGh3Gg2M8NB6Tpd4=; b=h7q2QAaRGHcfMXPgvJONQ2BjzJculpDYRXl4e4sk5iSHKV+FJ6BOjZrIWcrNx7fU9P H3wHy1LUJVmjL+gS8GFZBg5Xuu61OZ5TRd8Z3ucJn0soow4YQsFXCNkFd3g1N9n+2Mni +6uvjip80C+F1OaKxj4sKDg5zjO60/zD7An5L20TzEPrMgQBULdhO3mrpCDMMb57caAl gSS9QwIXLPNTZ59HrLzpn9u2/rAzOLoAa16QpC0cbYbeH4U9NqOSPsJVpzkRdDB64OtL t3O01uRHJGUxVmFGDEMlqsE9w7rjNhAcfQ4jl8Hyx/i43o4/j2A+3wB/L3kUHudAN2N2 KJaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B2rC6B9a; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u3-20020aa7d883000000b00501d4801fbasi206826edq.293.2023.03.30.10.12.56; Thu, 30 Mar 2023 10:13:31 -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=@kernel.org header.s=k20201202 header.b=B2rC6B9a; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232097AbjC3RCa (ORCPT + 99 others); Thu, 30 Mar 2023 13:02:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231741AbjC3RC2 (ORCPT ); Thu, 30 Mar 2023 13:02:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71D3FD52F; Thu, 30 Mar 2023 10:02:21 -0700 (PDT) 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 0D716620D0; Thu, 30 Mar 2023 17:02:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D587C433D2; Thu, 30 Mar 2023 17:02:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680195740; bh=ujXIiTpoTFINBKN8JAdUatEs5turRyLKyQ3khSiUWFI=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=B2rC6B9aFlNcYJKs2FH9AqRlo33ExEjKZ50Ed4LiR3fj3TJ83x57Z2gL5PXiFNrsH H9LawpXsCQNs8K+8VOPaUA4NlvVt6YNt+THZ3c1UKuxv760lIBYRH8KZIaP7GDPb9b sSOQhjBcaowlXd5Fx9lwI6ypQWbKwZpkiZGX5EYeYHi+4wFVLfbwN3z5RErfhpKpLL jIgGTi8BXhK9NE225J7obHb+KI8tCgr4sYBv0Vhw8DKYFeSVDRmMPALplfLbJyjU/q pfaBk4Zrlfswc83+QtctqxfCjGd6Zyx1HgXRxQeKJIqddXmmptxeW1DbLTdFRt4eBC VoqPWatsEPzKw== Date: Thu, 30 Mar 2023 12:02:18 -0500 From: Bjorn Helgaas To: Siddharth Vadapalli Cc: tjoseph@cadence.com, lpieralisi@kernel.org, robh@kernel.org, kw@linux.com, bhelgaas@google.com, nadeem@cadence.com, "Raghavendra, Vignesh" , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, srk@ti.com, nm@ti.com Subject: Re: [PATCH v2] PCI: cadence: Fix Gen2 Link Retraining process Message-ID: <20230330170218.GA3155390@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <646f0efe-d2b6-8bda-9629-fb9615cf4b52@ti.com> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 On Thu, Mar 30, 2023 at 09:52:06AM +0530, Siddharth Vadapalli wrote: > Hello Bjorn, > > On 29/03/23 22:38, Bjorn Helgaas wrote: > > On Wed, Mar 29, 2023 at 08:11:25PM +0530, Raghavendra, Vignesh wrote: > >> Hi Lorenzo, Bjorn, > >> > >> On 3/15/2023 12:38 PM, Siddharth Vadapalli wrote: > >>> The Link Retraining process is initiated to account for the Gen2 defect in > >>> the Cadence PCIe controller in J721E SoC. The errata corresponding to this > >>> is i2085, documented at: > >>> https://www.ti.com/lit/er/sprz455c/sprz455c.pdf > >>> > >>> The existing workaround implemented for the errata waits for the Data Link > >>> initialization to complete and assumes that the link retraining process > >>> at the Physical Layer has completed. However, it is possible that the > >>> Physical Layer training might be ongoing as indicated by the > >>> PCI_EXP_LNKSTA_LT bit in the PCI_EXP_LNKSTA register. > >>> > >>> Fix the existing workaround, to ensure that the Physical Layer training > >>> has also completed, in addition to the Data Link initialization. > >>> > >>> Fixes: 4740b969aaf5 ("PCI: cadence: Retrain Link to work around Gen2 training defect") > >>> Signed-off-by: Siddharth Vadapalli > >>> Reviewed-by: Vignesh Raghavendra > >>> --- > >>> Changes from v1: > >>> 1. Collect Reviewed-by tag from Vignesh Raghavendra. > >>> 2. Rebase on next-20230315. > >>> > >>> v1: > >>> https://lore.kernel.org/r/20230102075656.260333-1-s-vadapalli@ti.com > >>> > >>> .../controller/cadence/pcie-cadence-host.c | 27 +++++++++++++++++++ > >>> 1 file changed, 27 insertions(+) > >> > >> Wondering do one of you be pulling this patch in? This patch was never > >> picked for 6.3-rc1 merge cycle... Just want to make sure > >> pcie-cadence*.c and pci-j721e.c patches have a path to reach pci tree. > > > > Yes, Lorenzo or Krzysztof will likely pick this up. I think Lorenzo > > is out of the office this week. > > > > Drive-by comment: the current patch doesn't seem to give any > > indication to the user when cdns_pcie_host_training_complete() times > > out. Is that timeout potentially of interest to a user? Should there > > be a log message there? > > Thank you for reviewing the patch. The return value of -ETIMEDOUT from the > function cdns_pcie_host_training_complete() added by this patch will be handled > similar to the -ETIMEDOUT from the cdns_pcie_host_wait_for_link() function that > is already present. > > If cdns_pcie_host_training_complete() returns -ETIMEDOUT, it is returned to > cdns_pcie_host_start_link() function which is called within > cdns_pcie_host_setup() function. In the cdns_pcie_host_setup() function, there > is already a dev_dbg() print for handling the case where > cdns_pcie_host_wait_for_link() times out. For this reason, I felt that for both > cases, the dev_dbg() print can be used to debug without the need for an extra > log message. Please let me know if that's fine. Sounds good. dev_dbg() wouldn't be the right thing if we *expect* the link to come up, but ISTR that maybe you can't detect device presence directly. If that's the case, all you can do is try to bring the link up and assume the slot is empty if it doesn't come up. If the usual reason for the timeout is that the slot is empty, dev_dbg() should be fine. Another drive-by comment, no action needed, seems slightly strange to have two "start_link" functions called one after the other: cdns_pcie_host_setup cdns_pcie_start_link cdns_pcie_host_start_link I assume both are for the same link, so it's weird to have two functions for it. Bjorn