From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6922B3A8C6 for ; Wed, 31 Jan 2024 23:48:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706744899; cv=none; b=b1dcFi88pkk1Q/wla9B2hJGOPZxc39NrVQyNvXZZK+hr0Ouq37IfC8mPL5p23Ndwse0tRABHfjKCaUlIEBVCoxhSKDRDSA/eXHLPibufQk/c6rqq/3SgWZihEVgVBFHdKe29jNzaQXGsGyBPwC9sNJJ56VG6pHiWcd+rjZ5OYxc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706744899; c=relaxed/simple; bh=h8mOnODsTeFd2xdOHSVSoViTYIm1qVEA+f7PqD5HBHk=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=sSsGjVgurh2l5FYif0Dm+Ii9paWYIY/h/T7xYraCRZkm3mk8O0Bn0fK9Elwz0M1KDs/eABYZAE/rSxBLqE45TZQAtVFTdOf7c9jmwdhmtEN6yxDKYDuIlC2mbwir/hv8v/wT2QSiiJQS7SVsu5rB90Dly6e0jNU6l0DyiywQMH8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GqOJnZYX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GqOJnZYX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FF5CC433C7; Wed, 31 Jan 2024 23:48:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706744898; bh=h8mOnODsTeFd2xdOHSVSoViTYIm1qVEA+f7PqD5HBHk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=GqOJnZYXMwy8I51XbtxFDz04yKjuQfnRl/aWHkncYiTmPiI0RJ85M5FwX9LoniZGq 09jmpeFO44cpT2g0xtIH2KDk3LR1iOS+92XeWeZlwHBcQN0HCMocxzfzl3UGnNYCxy Ns/RbrtTUvl4qDjZz1kZ1b0dE5PjOBPUXfEr/lr9fbh0Ox3HP/G5vxksRh9L8/0wQf ErKsc1YCj5+QGVIpgApudoVs/UKFZwIxqX01YfNrW1qgD/OhtVnBOtIO6t52wZni8d QgL4c+BpmqhH37Uvj8Z4Ipglq0yR17SDSyfbo5pFDGR9yspOtTUphUp625BEU+HYsh g/5N9Qj54c5kA== Date: Wed, 31 Jan 2024 17:48:17 -0600 From: Bjorn Helgaas To: Manivannan Sadhasivam Cc: Ajay Agarwal , Jingoo Han , Johan Hovold , Jon Hunter , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Manu Gautam , Doug Zobel , William McVicker , Serge Semin , Robin Murphy , linux-pci@vger.kernel.org Subject: Re: [PATCH v5] PCI: dwc: Wait for link up only if link is started Message-ID: <20240131234817.GA607976@bhelgaas> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240119075219.GC2866@thinkpad> On Fri, Jan 19, 2024 at 01:22:19PM +0530, Manivannan Sadhasivam wrote: > On Fri, Jan 12, 2024 at 03:00:06PM +0530, Ajay Agarwal wrote: > > In dw_pcie_host_init() regardless of whether the link has been > > started or not, the code waits for the link to come up. Even in > > cases where start_link() is not defined the code ends up spinning > > in a loop for 1 second. Since in some systems dw_pcie_host_init() > > gets called during probe, this one second loop for each pcie > > interface instance ends up extending the boot time. > > Which platform you are working on? Is that upstreamed? You should mention the > specific platform where you are observing the issue. > > Right now, intel-gw and designware-plat are the only drivers not > defining that callback. First one definitely needs a fixup and I do > not know how the latter works. What fixup do you have in mind for intel-gw? It looks a little strange to me because it duplicates dw_pcie_setup_rc() and dw_pcie_wait_for_link(): dw_pcie_host_init() calls them first via pp->ops->init(), and then calls them a second time directly: struct dw_pcie_host_ops intel_pcie_dw_ops = { .init = intel_pcie_rc_init } intel_pcie_probe pp->ops = &intel_pcie_dw_ops dw_pcie_host_init(pp) if (pp->ops->init) pp->ops->init intel_pcie_rc_init intel_pcie_host_setup dw_pcie_setup_rc # <-- dw_pcie_wait_for_link # <-- dw_pcie_setup_rc # <-- dw_pcie_wait_for_link # <-- Is that what you're thinking? Bjorn