Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp10509pxv; Wed, 21 Jul 2021 14:03:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcQldV8XItWWxUZHw/ZRxGPGVBUNGp8r4hKrX5fIzYqH+hdNIjPcT2JwJavC+4UIuuIQTu X-Received: by 2002:a5e:dc0c:: with SMTP id b12mr18246896iok.141.1626901414180; Wed, 21 Jul 2021 14:03:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626901414; cv=none; d=google.com; s=arc-20160816; b=OQ+CJxNnceb5o4hv0FpDikv7oUzhPFT2u1gkk0/tpuQPv3hVf6LE+GM2fahxkUFncv yfgzug0nlax8DK5/bwSVX73LcKHKtnTYeuK/WojzkeKs2muP5fkU6ziVW875dGU+8+WX keL5VZRU+CuAY/FRgbXEd7U711xEgjlBd0Yonu6+W0q1DlUKKS7KpFvALm/6d30hJNgC ZDUz99v5RTYhwaVzB/RvlKI6rYlrfM5Y7j35+ZZDPIJcLDcnWnHj3NT9mn2+w+ce5awk 5tL9dBgGy98GNf2hG7Z/qLT9cWoNw6A9Y1yy0RkevI3utdbLLwUzyY/V+W9TBk4IlRoQ jc+A== 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=e6YwvA8HimmHXbld2CjV1h7e1UM4MA3OKiFVEXWIRqA=; b=C2Dci2ldLqG1tm8XRWzdTyN8VCLV9BG3oK0ivaCUDuIF1cjPhCwUC911jNWvDfTwD8 WczzL+mZabcVJHeXEZHfHeSTMlqWDEUYIQamMuGiQBPa8HPlcaNaTd/VDXIvg6s+ob5/ Gi0h97wostwVqeUYScFnWQhEsL5Ac9YY8EPcKXj7CC6MFcaQHKhIScl3iONZsiDPnCYj EUNsvxD6QrJ7g1zIC39UkD9l3KUK4azaXdH1yrDHcgHhwFWOgqQK/EWYO2NtKlFpQerj hMueA+7WuPfDri8BR/UfC/mIZH8ab00RIOLSmT6wN3qF2p8YOvE6CF+557lGWJ6WXYkF 1lsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="JZBH5p2/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si9006746ilf.150.2021.07.21.14.03.22; Wed, 21 Jul 2021 14:03:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="JZBH5p2/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231270AbhGUQbJ (ORCPT + 99 others); Wed, 21 Jul 2021 12:31:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:39506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbhGUQbI (ORCPT ); Wed, 21 Jul 2021 12:31:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A930F61222; Wed, 21 Jul 2021 17:11:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626887505; bh=AilQ46pk+2fIUx3ol9DVGFG0IMAI8bKWvoJej1mBTDY=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=JZBH5p2/I6tnBBYPmppaaMdzLEeyoueUbkDMHEmwNTSac4kmMsdlv8Xzhg2ayUNfn ZMdqCJHCzoe08mLJPdx41/2RA3eMnIyqtxtjsOW0uB7RHoAfAhHHqt5zpdmbhXVGTN 9H69at2PaRgOYVqwmgYIiQsl0nG7G5xlC4ZfkqMGohQU1vgzqQFumFIexQpx+agXrA 75Q5FBQ5u1VOc9HECTS0hLfhoneoTjyTjveSfsmT5FKJvWyYvmsGxj7kl1c6sA2eTf yacL3jFNU4/uVK4w7x/ab51b2wcOpC0p1ilcsm9olodqpNCgArVHBxKfGUKw1xQzQu ki0I1YXSh8I+A== Date: Wed, 21 Jul 2021 12:11:42 -0500 From: Bjorn Helgaas To: Christian Gmeiner Cc: Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , Rob Herring , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] PCI: dwc: do not ignore link errors Message-ID: <20210721171142.GA189373@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210721152821.2967356-1-christian.gmeiner@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 21, 2021 at 05:28:21PM +0200, Christian Gmeiner wrote: > This fixes long boot delays of about 10 seconds. > > I am working on a device powered by an TI am65 SoC where > we have a PCIe expansion slot. If there is no PCIe device > connected I see boot delays caused by pci_host_probe(..). I agree this is problematic. Surely the controller can generate an interrupt when the link comes up? If so, can we make an interrupt handler for that "Link Up" interrupt that calls or schedules pci_host_probe(), and get rid of dw_pcie_wait_for_link() altogether? I doubt we want to just return failure here if the link doesn't come up right away, because then we can never hot-add a device later. 886a9c134755 ("PCI: dwc: Move link handling into common code") addresses this in the commit log: The behavior for a link down was inconsistent as some drivers would fail probe in that case while others succeed. Let's standardize this to succeed as there are usecases where devices (and the link) appear later even without hotplug. For example, a reconfigured FPGA device. > Signed-off-by: Christian Gmeiner > --- > > V2: fix compile > > --- > drivers/pci/controller/dwc/pcie-designware-host.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c > index a608ae1fad57..ce7d3a6f9a03 100644 > --- a/drivers/pci/controller/dwc/pcie-designware-host.c > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c > @@ -408,8 +408,9 @@ int dw_pcie_host_init(struct pcie_port *pp) > goto err_free_msi; > } > > - /* Ignore errors, the link may come up later */ > - dw_pcie_wait_for_link(pci); > + ret = dw_pcie_wait_for_link(pci); > + if (ret) > + goto err_free_msi; > > bridge->sysdata = pp; > > -- > 2.31.1 >