Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3929396rdg; Wed, 18 Oct 2023 09:48:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnYOq36/mKvC2C72E2QlYElzARzj762mlqF67piMTZ34uusk4fIHo0Gde2X8jgbj42WMEq X-Received: by 2002:a17:90a:df8d:b0:27d:2ed1:6b87 with SMTP id p13-20020a17090adf8d00b0027d2ed16b87mr5316079pjv.40.1697647680627; Wed, 18 Oct 2023 09:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697647680; cv=none; d=google.com; s=arc-20160816; b=ilE4PpuPsGUNgVYjZ16wbFEo9uw5YczWI+Mw1xYjA4ZCjcSwnRGTyA3Duk+IFegEJV NE5PvVAX/aaMe4AXaon2496bk7tQnV3VDZ1qt1rGfi+Rq5NHOInmWPvVWR7tkVTvRxRE 4UK8KtnIjWGZkh+lE/gI/Aj/bvxDPzaSPeGKFxGnagEQbCGgzCCcNHItNA9vrlLRRJzR PrM00gdRS4DjHiQKMZ953V4iV6ffwcI3rx1JCi5MuyXwYitdx8YiKmw1R3DXRTlwKeRz AaIoXothktfRKeh4lYf2CKXLD/RRHhpKS/1tebV6i4v9IBMQZA/HjugXWO4EibBbg9b6 sfwA== 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=Au2/tav95orsKIwPy0x8W6ed7YzCNwyMkoQm5sJNrmY=; fh=O9HL25Z9Va5iAD5QG0JUUx6sSHGnN7QuHEqafdGscXk=; b=MjODNkTvBBKmg1L+8kI9AEnMQXUKoFHMtwZyDQS/uooe1CGETiB9dQa3bHy9DueLnO AHEE9Vi652/GE5Zc42KzOxJDyKqpSMC/bxi9ijVkwNHGeXBJK4f/RUBhCFOQGwtuuu+Z W7ChoqoZZt1ypdj7aqb7gdxn77Cwo95smVOYrk7jQb+u6kDaqr5OYTjbn/LGB0Hve0kt KoD8s+L2p1WNrvz85crZdFFW2Fxb6CC+IWZm3vUpD+zsIa8KsY8KyIn/c0NsHQhCDkE6 ZdVm68vCRCJdZOicuqqY9rDUy8rxW9SrvGju6f8AXqlNbGtpUX2vwr9ZQILzRmJYZIHM VsYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fT3vrmc3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id e11-20020a17090a804b00b00276671731e3si239050pjw.136.2023.10.18.09.47.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 09:48:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fT3vrmc3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2F25881896D8; Wed, 18 Oct 2023 09:47:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbjJRQrf (ORCPT + 99 others); Wed, 18 Oct 2023 12:47:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjJRQrf (ORCPT ); Wed, 18 Oct 2023 12:47:35 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80E4EAB; Wed, 18 Oct 2023 09:47:33 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3C32C433C7; Wed, 18 Oct 2023 16:47:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697647653; bh=7DxP+VzAPrpmHrHz9hsz4GlUetrZemXQgLSBXuzIZcw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=fT3vrmc3d8oRWFwdz2RG3CQg4HjjnhUByGGFLAXgqHKfXeIbYuX/BCemBrMEXe8rs tHdCUrDG4efTyMzz9CfxETwf3aWfUxPyDmnW3l9kGJ1ZHDiJtsIRAbg0X4H/MK7pzJ srtKYetYZeE+BsWnuSw/he8oXv+2dfBBntDCl4IAbKEkEqZ18ra2K8TWdXTE5qksRU 8qRUfJT798KY5c8bTG74vk9l3wI98kLG/3erO6//UDfgYzoyz/ziRTWel4uogZW0Kn /d7yc1zMVV4ma2ykkUhS73h6TH0YGwDrjxKlJmM1mD6J/D/e8FfJqaLu2knqslDL/J GASyDqQvTJtxA== Date: Wed, 18 Oct 2023 11:47:31 -0500 From: Bjorn Helgaas To: Manivannan Sadhasivam Cc: lpieralisi@kernel.org, kw@linux.com, bhelgaas@google.com, robh@kernel.org, gustavo.pimentel@synopsys.com, jingoohan1@gmail.com, andersson@kernel.org, konrad.dybcio@linaro.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v2 1/2] PCI: dwc: Add host_post_init() callback Message-ID: <20231018164731.GA1365588@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231017075952.GC5274@thinkpad> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 18 Oct 2023 09:47:47 -0700 (PDT) On Tue, Oct 17, 2023 at 01:29:52PM +0530, Manivannan Sadhasivam wrote: > On Mon, Oct 16, 2023 at 03:58:49PM -0500, Bjorn Helgaas wrote: > > On Tue, Oct 10, 2023 at 09:29:13PM +0530, Manivannan Sadhasivam wrote: > > > This callback can be used by the platform drivers to do configuration once > > > all the devices are scanned. Like changing LNKCTL of all downstream devices > > > to enable ASPM etc... > > > > > > Signed-off-by: Manivannan Sadhasivam > > > --- > > > drivers/pci/controller/dwc/pcie-designware-host.c | 3 +++ > > > drivers/pci/controller/dwc/pcie-designware.h | 1 + > > > 2 files changed, 4 insertions(+) > > > > > > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c > > > index a7170fd0e847..7991f0e179b2 100644 > > > --- a/drivers/pci/controller/dwc/pcie-designware-host.c > > > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c > > > @@ -502,6 +502,9 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) > > > if (ret) > > > goto err_stop_link; > > > > > > + if (pp->ops->host_post_init) > > > + pp->ops->host_post_init(pp); > > > > I know we talked about this a little bit in the context of enabling > > ASPM for devices below qcom 1.9.0 controllers at > > https://lore.kernel.org/r/20231011050058.GC3508@thinkpad > > > > But I didn't realize at the time that this callback adds a fundamental > > difference between devices present at boot-time (these devices can be > > affected by this callback) and any devices hot-added later (we never > > run this callback again, so anything done by .host_post_init() never > > applies to them). > > > > We merged this for now, and it helps enable ASPM for builtin devices > > on qcom, but I don't feel good about this from a larger DWC > > perspective. If other drivers use this and they support hot-add, I > > think we're going to have problems. > > If someone is going to add same ASPM code in host_post_init() > callback, they will most likely aware of the hotplug issue. I see > this as an interim solution overall and we should fix the PCI core > to handle this. But I do not see any straightforward way to enable > ASPM by default in PCI core as the misbehaving devices can pull the > system down (atleast in some x86 cases). Definitely an interim solution, but the interim is going to be long :) I don't see the PCI core ASPM issue being resolved very soon; it's been this way ever since the beginning. I guess there's no point in me whining without any proposals. Bjorn