Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp107199rwb; Wed, 5 Oct 2022 15:33:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6FNLhNBOJIopVXuzTFSjrk3qZdb3Vr9m1SrhoMzp9AHpX0M1YQANsnGkCIrj9uA7sHyJqS X-Received: by 2002:a50:ff0a:0:b0:455:2cc3:920d with SMTP id a10-20020a50ff0a000000b004552cc3920dmr1825338edu.39.1665009185286; Wed, 05 Oct 2022 15:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665009185; cv=none; d=google.com; s=arc-20160816; b=0/o16S82H1bib7n/RY22NKBQgu4jlGmqQ4gySLdPWe2Kz/QUvTQb7SRyD/MEyXdYqj YlwYSUdjltES9g1neR7DdM4RwuUgB3TSMW5V9tZtm7kzl1M9LnfQHzLluk39k3pj/vL1 nhBw9KqRzbK+9uXUDO+hdtQNuFM3V9XZSwD8xUeQeq4aAty9aZk6OgrUJuXKJesmQFMh S1lobKSugoUPobYQ262TIUTjSa3EU2mxv4/Q1INaV4RUiwn7Q2f5zrJUK7j/tPu/UY4c iaeSg0AQTL3SmgGcgF0YdwJjULEh1WcMrdMEI26Ts4JNO+gkQ6hpsM7lnazFhMoYmA3B Zdkg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mhMPvEXXYCPlbOQG8BzvcGNV3ML97Cg893xM+52RSgQ=; b=evKOYQvQiZOovNSePGiVSZQlhl9EWTPd7zVYhEfuIXlcH9NKeDMZJR8hV5KKYH+Xk5 aO96h/DJxUIe1xeUkQ9D5mdFi+vkKgmGOVWW042qS2jsDU7Wu9ozBbkyISY9cYGbDTKp izI84n7wEnRd2CY/DngbrTiTTvVDOHIkmlzKMYrorxTV0UJ7Cb4ao2LdEgROCOlhjCUj AQhGTez1fzA0JAYnQ2sowVmP9SDSelE10xp2wiJTbGCOWjyI0nkAhupLO1pNfC32chUm MZaeC3xcD5aLKLBhnn5XCkQil2t7L2jQjwTg6T6NanM611jhr5gh7AQYm2M0mJ9VqrkR Tn/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HKuN0K2/"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq42-20020a1709073f2a00b0078b0865d468si10264714ejc.549.2022.10.05.15.32.39; Wed, 05 Oct 2022 15:33:05 -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=@linaro.org header.s=google header.b="HKuN0K2/"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229721AbiJEWZM (ORCPT + 99 others); Wed, 5 Oct 2022 18:25:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229694AbiJEWZH (ORCPT ); Wed, 5 Oct 2022 18:25:07 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FDF3303FB for ; Wed, 5 Oct 2022 15:25:06 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id f193so231536pgc.0 for ; Wed, 05 Oct 2022 15:25:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date; bh=mhMPvEXXYCPlbOQG8BzvcGNV3ML97Cg893xM+52RSgQ=; b=HKuN0K2/4ikar8N5dBtbFYT2BkP1HBPMufC0LN0ASsAwWLksRCjjpnM9XlJ5SeB6n+ ySPGxHRhhG6mCK65FB3pcbzHpPbdxpA8sA8UbmUj0+qWBmzvCPvtBm54ktu4z08OSzFW DKw5YNTHUgpDkk6JP78GbjkeqmngeyhPmmJPFX2IuqVfigmcI5bwfDHJCfcOyJb2+pCl 6leXfPw9laNO4XY4HtELKik3uemLvs5YG3LQ5Swyl1J31KlJ+38Ysgz9EUzuMmQKBFgf rKCND9i2sBRfwe91Z9K7UZIl1aVwvXlLSLG/sI2FXXdKl52AvITTPwy2aRnCQk/9Kz2i yRMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=mhMPvEXXYCPlbOQG8BzvcGNV3ML97Cg893xM+52RSgQ=; b=bwhHrHYgFypC34XMMYCm2a9KPZSP98xI5MsDC2RjUQZ9QthrrnifIkaQ4NFuI6+LwT EoHRspMkjsSQ98W4UQv4GzAsIH36otHWQs6QjfUseAtA/0SAj4u216hFzGjiODuZ+ySQ ZjGJ3vQQ+JL3SmrV0J8sIsgSK6h1axF/tcF2O9JGYi2zPfBhmoAcSUmbVR4Nx8UtOmpr /ZIOcGgLmZMRxlZXpa2jOtlKfy9LqdLIa6L1QyRyjd6SqLXR8GwxTxvtvgtvkUdveWrh PfJ4bV4KXksreiuIdGI52K9z9Y1M9W5ma7pjx2Ajet3E2BNYvnZH6xJZU7IiyUhCiz6T 0Ilg== X-Gm-Message-State: ACrzQf32vMUoPPaPh5mqzOMrdAEMuQTGGE0FOhiP042CCrkxAtBTFILG 6detthZhZ9rmGmcVB/Lnh4rU X-Received: by 2002:a63:5d48:0:b0:43a:390b:2183 with SMTP id o8-20020a635d48000000b0043a390b2183mr1669590pgm.29.1665008705484; Wed, 05 Oct 2022 15:25:05 -0700 (PDT) Received: from thinkpad ([27.111.75.192]) by smtp.gmail.com with ESMTPSA id d2-20020a17090acd0200b001ef8ab65052sm1614744pju.11.2022.10.05.15.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 15:25:04 -0700 (PDT) Date: Thu, 6 Oct 2022 03:54:58 +0530 From: Manivannan Sadhasivam To: Bjorn Helgaas Cc: lpieralisi@kernel.org, robh@kernel.org, andersson@kernel.org, kw@linux.com, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, konrad.dybcio@somainline.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org, dmitry.baryshkov@linaro.org, Krishna Chaitanya Chundru Subject: Re: [PATCH v4 06/12] PCI: qcom-ep: Gate Master AXI clock to MHI bus during L1SS Message-ID: <20221005222458.GA6150@thinkpad> References: <20220914075350.7992-7-manivannan.sadhasivam@linaro.org> <20221005220838.GA2400326@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221005220838.GA2400326@bhelgaas> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 On Wed, Oct 05, 2022 at 05:08:38PM -0500, Bjorn Helgaas wrote: > [+cc Krishna] > > On Wed, Sep 14, 2022 at 01:23:44PM +0530, Manivannan Sadhasivam wrote: > > During L1SS, gate the Master clock supplied to the MHI bus to save power. > > > > Signed-off-by: Manivannan Sadhasivam > > --- > > drivers/pci/controller/dwc/pcie-qcom-ep.c | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c > > index 2dc6d4e44aff..526e98ea23f6 100644 > > --- a/drivers/pci/controller/dwc/pcie-qcom-ep.c > > +++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c > > @@ -27,6 +27,7 @@ > > #define PARF_SYS_CTRL 0x00 > > #define PARF_DB_CTRL 0x10 > > #define PARF_PM_CTRL 0x20 > > +#define PARF_MHI_CLOCK_RESET_CTRL 0x174 > > #define PARF_MHI_BASE_ADDR_LOWER 0x178 > > #define PARF_MHI_BASE_ADDR_UPPER 0x17c > > #define PARF_DEBUG_INT_EN 0x190 > > @@ -89,6 +90,9 @@ > > #define PARF_PM_CTRL_READY_ENTR_L23 BIT(2) > > #define PARF_PM_CTRL_REQ_NOT_ENTR_L1 BIT(5) > > > > +/* PARF_MHI_CLOCK_RESET_CTRL fields */ > > +#define PARF_MSTR_AXI_CLK_EN BIT(1) > > + > > /* PARF_AXI_MSTR_RD_HALT_NO_WRITES register fields */ > > #define PARF_AXI_MSTR_RD_HALT_NO_WRITE_EN BIT(0) > > > > @@ -394,6 +398,11 @@ static int qcom_pcie_perst_deassert(struct dw_pcie *pci) > > pcie_ep->parf + PARF_MHI_BASE_ADDR_LOWER); > > writel_relaxed(0, pcie_ep->parf + PARF_MHI_BASE_ADDR_UPPER); > > > > + /* Gate Master AXI clock to MHI bus during L1SS */ > > + val = readl_relaxed(pcie_ep->parf + PARF_MHI_CLOCK_RESET_CTRL); > > + val &= ~PARF_MSTR_AXI_CLK_EN; > > + val = readl_relaxed(pcie_ep->parf + PARF_MHI_CLOCK_RESET_CTRL); > > Is this code executed when the link actually transitions to L1.x, or > is this just configuring things so that when the link does transition > to L1.x sometime later, hardware will gate the Master AXI clock? > It is the latter... This patch programs the EP controller in such a way that when the link enters L1.x, the AXI clock supplied to the MHI bus (EP function) will be cut-off to save power. Once the link goes out of L1.x, the clock will be restored by the controller. > Just curious because this looks more like *configuration*, i.e., the > latter, but there's the ongoing conversation about qcom system > suspend/resume, where IIUC, software is involved at least in some > L1.2 exits. > Krishna's suspend/resume patches are for Qcom PCIe RC controller, but this series and this patch is for Qcom PCIe EP controller. Thanks, Mani > > dw_pcie_ep_init_notify(&pcie_ep->pci.ep); > > > > /* Enable LTSSM */ > > -- > > 2.25.1 > > -- மணிவண்ணன் சதாசிவம்