Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2755144rdg; Mon, 16 Oct 2023 13:59:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKi6v3Egx1IHOf9fGrpBB5Q58Yb7vQaT3Dv8vQcfohmrqlfDqkuz1NVty5t0jjYU0wZ8BF X-Received: by 2002:a17:90a:c405:b0:27d:5cca:9b69 with SMTP id i5-20020a17090ac40500b0027d5cca9b69mr268936pjt.45.1697489941558; Mon, 16 Oct 2023 13:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697489941; cv=none; d=google.com; s=arc-20160816; b=tv0JFxS4UFVtoMBvcmNudYhjl8o7m9WZ/4oG/pX9LM9fdhKtdmZcoaq4rS8InSCH35 zHmRnazqy8/H6QIJtKNkrYX25M9rx5yx7TfYd8fg8XiDihEKb/Y7ciom/e8h5pbjGtkl 6GB4hPakLrJZtaY25kj1gitkWsJa31pWs224+yU22ZShFFSsEikWn21So7Mbp2t7UhXf s0RwLnTLpyG8S4Ji9pxkF6MKSZohSUE4zOlNt03WHEuw7mWibD+1n6RR0LZqqu5t8rdr hhAScafu5bOfkoZoMHNunOYV6iYsp72WEQ0AyEQLud2m9xt8+/w7LcnpZvx1o7TBcp0L Y/9g== 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=f00ECLPfruLYOCKy9d5hwIhxtTzwREuayzmT35Cy5Ks=; fh=O9HL25Z9Va5iAD5QG0JUUx6sSHGnN7QuHEqafdGscXk=; b=FvcxoOfOOWoBxz+hlM/xqa09au29F/wT9D0u+FlkhW7kNnCUa5k82csE/A/FldWJNh qt6ZiAizW5FXXkeEMWAwHfONlZ0z4zvwrzGkCNb4iof561XzQDBGqbvlLkNmILQ1K+HN RAvb8AmfAxx2S6bzD8MVjS3XJeLoC9COY4aGJm0NkGrspq4UfmDDeRc0MnAVCS73ThV2 W19hv9wAanL8axESRlnIQcS/ConV7q5h8ylkMMiDlumQUe49KfMzgO1KwDxAOQNgGjMF Ig7gOP/n18CZ3556phjofVfiglAsDaumUNWDn//h+68uq8WSmVFbXXjfI0fsiadDXhcB rPrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eHzBwg4p; 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 pj4-20020a17090b4f4400b0027383ac5ebcsi99922pjb.130.2023.10.16.13.59.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 13:59:01 -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=eHzBwg4p; 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 6A8328028FE1; Mon, 16 Oct 2023 13:59:00 -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 S232365AbjJPU6z (ORCPT + 99 others); Mon, 16 Oct 2023 16:58:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229666AbjJPU6y (ORCPT ); Mon, 16 Oct 2023 16:58:54 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64C68A7; Mon, 16 Oct 2023 13:58:52 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F26FC433CA; Mon, 16 Oct 2023 20:58:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697489931; bh=dG6ltN79kbyGWDglciCzr1VcAQsge3LhDKGwMHp5vHI=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=eHzBwg4p0suzaWPxo7lFCGwAAe15zegAj/iPL8AvWhjQaXH5tyZ9Qza55p8o25OT/ VBFCgIMnndzrFWAuq/S72FGLecv5OarJHzYpa5wm0Lkjv2wMCU53p2rSoY9pKO3MCG o/a9t+IjiTRnWsgal/zhUnnBLvpufK1QDp7Y5+qYvpYr6dTuuLCor//08g1TJ1S9us D9KlRE8dRSpE6KsElyH6XjjHy2gSKduZ1ReW4mL8AbSiAJsoT+TJR40+y1pNU8kClG w0F/FW88GBQZKeNn4Dn76HFDIfzZRGSJerQM1+FL46HzYCK9uNrUHBzMB5D5FYL8n2 q3dXwjr/0XCrQ== Date: Mon, 16 Oct 2023 15:58:49 -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: <20231016205849.GA1225381@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231010155914.9516-2-manivannan.sadhasivam@linaro.org> 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]); Mon, 16 Oct 2023 13:59:00 -0700 (PDT) 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. > return 0; > > err_stop_link: > diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h > index ef0b2efa9f93..efb4d4754fc8 100644 > --- a/drivers/pci/controller/dwc/pcie-designware.h > +++ b/drivers/pci/controller/dwc/pcie-designware.h > @@ -301,6 +301,7 @@ enum dw_pcie_ltssm { > struct dw_pcie_host_ops { > int (*host_init)(struct dw_pcie_rp *pp); > void (*host_deinit)(struct dw_pcie_rp *pp); > + void (*host_post_init)(struct dw_pcie_rp *pp); > int (*msi_host_init)(struct dw_pcie_rp *pp); > void (*pme_turn_off)(struct dw_pcie_rp *pp); > }; > -- > 2.25.1 >