Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35598371rwd; Mon, 10 Jul 2023 09:37:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlHBWn9zyKaN1wE4Iv9OZRI22I81MOlgrjlIQ4ZMLpx+/tQuV23e5sSwa/QdIks+H5dfo0yl X-Received: by 2002:a17:906:5356:b0:993:f497:adbe with SMTP id j22-20020a170906535600b00993f497adbemr9230422ejo.19.1689007058800; Mon, 10 Jul 2023 09:37:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689007058; cv=none; d=google.com; s=arc-20160816; b=H136idB8cDf0sW0NvyTK9RHhoFFIWWskFI9ngaYaVcDmWVAZcNczsSmf1olMIFqw1h E3PYxi2eN8pz0cqlRCY+SaoFz975HwrLduBKSFWSyvxRYUDAAjRyIj1Y3NsfreEUP/sB dZF/v94s1rXyQCzZHx5QHuyUB2fNgp3PN6eD3UqxLOqUVIL2zvMsxDXAWB8ys7Fj7R9M q/qm7TmOON/50r1J3uRKTCXrvxa8Hpm0HDAfsygg9w3WBrhJ5wRh17HHnkTndm+Ji0wK PflxmR2iFj3uH65pbAlrbqsoLbz0eRvjt68wj2jGw2pIhNqKONCQme7nuaFgM2Rgee93 2thQ== 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 :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vfcPZlZr3mdkM9arjRR44/bpm6ljGJo75Sv2bEfD5mU=; fh=89WC/bxO6TUBX0vpUj5vtMVLQpOHP5MCCwLR/eqMbtw=; b=nwv9kNPx/g+uXj+8Ag8QBInwhKXdQa/x7YJoRFoe4dBvfGF06PAvnG/C+ecNcJNi3b jAvOLt+GACNlPOauJEnvpVgmw4aXbJZ7E96uekwP6Dr3QwJRwyaWt72hDaSDqVOeABQB 5N4jdkbBO2iYCROxOQJW25Q/YtlalIZ9mQBd47Gz2ZwuJW+qX9f52ir/hNXDSbv3eifO g2kIbg60Gx25ih/RJYmrKIE+7V/J0f//cTYNO3/u1qAaROyjfrI7+ecCPrT02fiRVvjl 5thuqfRDwSOGvOvtL7aPWZduDXSS37O71Sb5GBHSPQGtq3AVeagsVl7DePC4EKjCcQnv JYow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=KjWKZE1q; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o5-20020a17090637c500b0098e3591d105si9137657ejc.405.2023.07.10.09.37.14; Mon, 10 Jul 2023 09:37:38 -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=@google.com header.s=20221208 header.b=KjWKZE1q; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229669AbjGJQVk (ORCPT + 99 others); Mon, 10 Jul 2023 12:21:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbjGJQVf (ORCPT ); Mon, 10 Jul 2023 12:21:35 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BEF6183 for ; Mon, 10 Jul 2023 09:21:32 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6686ef86110so2418830b3a.2 for ; Mon, 10 Jul 2023 09:21:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689006092; x=1691598092; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=vfcPZlZr3mdkM9arjRR44/bpm6ljGJo75Sv2bEfD5mU=; b=KjWKZE1qcXhZVpoj2YhhO7r+UYXQH30t6sXWA7bXsx0b1usqPAT6OmGete3KdH/UbH dYyKBYJoCwXyg1axVKJcrYmgrvZZT+aR/2/077bDAa5XvsAlj3PIpXTmywc+s5Wq99PU 5Wt6CBXe/uQYTfkkbefkKGd1QPFjyfol75vQOcfQ5ZXOJf5Nlg9f5J8yYuL4wLljwgTP oYWlCqvZup0IbKuMVwCljSkuTLP4iQCKrPe6eEQC0su2DosBvzBXA8bVfw17f+bxxA/P jyQNwSHBTrCbEKbpyLaLVvWdgYuPx3kgh51QM54fhb4AlfjL/+xA/r6LtwrR6NF3Xs6U Mf/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689006092; x=1691598092; h=in-reply-to: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=vfcPZlZr3mdkM9arjRR44/bpm6ljGJo75Sv2bEfD5mU=; b=Me48XCWy/ixf4bynYfun4/GPVU1Qzb7fuDfIcsS4Y23m6VZQooXkkt2VN7XfklIt9h 1PF3mf9MmU9tqx5iLjMfb5dA7LSyBknCTiShI/0wN5gDlSoFwZ0Gyu1s3UD3vCQYqYtH +xY5s46AlmjFU6OSKZP8f/f/zpcLQHSdOZQs1p6OFIccI1scWBNurtHeCe3FqP+R/gXs 16Q3TszUOAIqaX21QhE4ca7/rsF3UcTogS0F3rNokxz9nn4XT3qzq/V9UixJ9Sbdnbei 5taaUT7rziUxa2xt44Y5iH9fSCBPDkY9vhTj5fzyecaIR8BzxvyeuJVdCucSIF2TlxQr xtnA== X-Gm-Message-State: ABy/qLZQZV9pqJueOg5cCXdL1TyXPKSVoI6Kmk8zl5/mV96+gzwxizeM yHEUalRnaXh4cuFF5YsRtobrNwXkAGoqo4fNjKX4A+JQ X-Received: by 2002:a05:6a20:6a0f:b0:12e:5fd0:f4af with SMTP id p15-20020a056a206a0f00b0012e5fd0f4afmr12498820pzk.28.1689006091878; Mon, 10 Jul 2023 09:21:31 -0700 (PDT) Received: from google.com (41.183.143.34.bc.googleusercontent.com. [34.143.183.41]) by smtp.gmail.com with ESMTPSA id i5-20020a1709026ac500b001b80b342f61sm77877plt.268.2023.07.10.09.21.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 09:21:31 -0700 (PDT) Date: Mon, 10 Jul 2023 21:51:22 +0530 From: Ajay Agarwal To: Johan Hovold , Manivannan Sadhasivam Cc: Lorenzo Pieralisi , Jingoo Han , Gustavo Pimentel , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Sajid Dalvi Subject: Re: [PATCH] Revert "PCI: dwc: Wait for link up only if link is started" Message-ID: References: <20230706082610.26584-1-johan+linaro@kernel.org> <20230706125811.GD4808@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,FSL_HELO_FAKE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Fri, Jul 07, 2023 at 02:47:56PM +0200, Johan Hovold wrote: > On Thu, Jul 06, 2023 at 06:28:11PM +0530, Manivannan Sadhasivam wrote: > > On Thu, Jul 06, 2023 at 10:26:10AM +0200, Johan Hovold wrote: > > > > Finally, note that the intel-gw driver is the only driver currently not > > > providing a start_link callback and instead starts the link in its > > > host_init callback, and which may avoid an additional one-second timeout > > > during probe by making the link-up wait conditional. If anyone cares, > > > that can be done in a follow-up patch with a proper motivation. > > > The offending commit is bogus since it makes the intel-gw _special_ w.r.t > > waiting for the link up. Most of the drivers call dw_pcie_host_init() during the > > probe time and they all have to wait for 1 sec if the slot is empty. Mani, can you please explain how my commit made the intel-gw driver special? The intel driver actually fails the dw_pcie_host_init if the link does not come up. That was my motivation behind adding the fail logic in the core driver as well. > > Just to clarify, the intel-gw driver starts the link and waits for link > up in its host_init() callback, which is called during probe. That wait > could possibly just be dropped in favour of the one in > dw_pcie_host_init() and/or the driver could be reworked to implement > start_link(). > > Either way, the call in dw_pcie_host_init() will only add an additional > 1 second delay in cases where the link did *not* come up. > > > As Johan noted, intel-gw should make use of the async probe to avoid the boot > > delay instead of adding a special case. > > Indeed. > > Johan Johan, Mani My apologies for adding this regression in some of the SOCs. May I suggest to keep my patch and make the following change instead? This shall keep the existing behavior as is, and save the boot time for drivers that do not define the start_link()? ``` diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index cf61733bf78d..af6a7cd060b1 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -492,11 +492,8 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) if (ret) goto err_remove_edma; - if (pci->ops && pci->ops->start_link) { - ret = dw_pcie_wait_for_link(pci); - if (ret) - goto err_stop_link; - } + if (pci->ops && pci->ops->start_link) + dw_pcie_wait_for_link(pci); } bridge->sysdata = pp; ```