Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3271575rdg; Tue, 17 Oct 2023 09:21:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFV+OmzmOGDLAumUnsX/jqM6zz8ieTdraO5YyIlSAIYPoyPtKCoHb/x8bWEgBMDpnCf0S96 X-Received: by 2002:a05:6a21:788d:b0:15e:b8a1:57b0 with SMTP id bf13-20020a056a21788d00b0015eb8a157b0mr2666316pzc.39.1697559718078; Tue, 17 Oct 2023 09:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697559718; cv=none; d=google.com; s=arc-20160816; b=mNznheNjtqTCfdTxqOeS0AOsjP9tuQEJ7be6+GJkYL+hKKoPQ+oCh8xKmKOADT/v52 936at6N/XmBsc3rpg+x+zJodESH4yICTDjMp66tFaHjDkI6e1c5PtfLSV8X3W5wt9Sk0 XEJvklXM6RGN4lPYqh1QEpGNpHob8jym57QXFsD1/Htwl9H8Us4io1Fkff1RmFY1OdoT 9bkt4lnaVeC2FVtoDKelr6XHvBcjRO0exWOIr0//fb0XLLxIh3MgndJXdAQN+kZryvX+ /w7RMzoEPw3dHHbuTna851CImdKtgwSnt345GZ60rlVT97Q67yU4qLvhohGLshjzU+ke eQdg== 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; bh=rLhWa078ShhgQBOKrrEXKJjOtXBhbReDFinhe437E4U=; fh=jzhb/DixR9mREMU6trfTwqPkbajjyBtKs/nrd7AfPuk=; b=jcFi5gtiRKkjpc00HR9MW2JZxdJnf1MBCF2TdAO6br9ARWVQOsgYQ/B2NqFdv1dsXO 2vhl5fZaBLTsJ/YctFwTp+fzzT/a3Wq/qsO1HsWupw6XTsSGQuijuwSKIaUIC3LQed/Y CBoyyvO0CQeuQ9dkJxYtc73m4Gkx9HfEX0g5VxZrut2EL9SICtNgs7yWF21JQVk3iq2U maVdZ/MSEj6ZeLh4ZMc4950PMzh3RCAzE2pBp1ieHCMy8lySceIacy6ugk6wrVGa3mAK 1gi+P9OQImTq7Yx+D4YFCPcwrAhTFOjgV57gYwipn6sTvDiAW8CbRHxIv+CpZg02A6Q/ 90ww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id x5-20020a654145000000b005aa192820d8si91595pgp.590.2023.10.17.09.21.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 09:21:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 6E9578080E21; Tue, 17 Oct 2023 09:21:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234341AbjJQQVk (ORCPT + 99 others); Tue, 17 Oct 2023 12:21:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbjJQQVj (ORCPT ); Tue, 17 Oct 2023 12:21:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 751949E; Tue, 17 Oct 2023 09:21:38 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E0F6C433C8; Tue, 17 Oct 2023 16:21:34 +0000 (UTC) Date: Tue, 17 Oct 2023 21:51:29 +0530 From: Manivannan Sadhasivam To: Bjorn Andersson Cc: Jingoo Han , Gustavo Pimentel , Manivannan Sadhasivam , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH 2/2] PCI: qcom-ep: Implement dbi_cs2_access() function callback for DBI CS2 access Message-ID: <20231017162129.GF5274@thinkpad> References: <20231017-pcie-qcom-bar-v1-0-3e26de07bec0@linaro.org> <20231017-pcie-qcom-bar-v1-2-3e26de07bec0@linaro.org> <20231017142431.GR3553829@hu-bjorande-lv.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231017142431.GR3553829@hu-bjorande-lv.qualcomm.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Tue, 17 Oct 2023 09:21:55 -0700 (PDT) On Tue, Oct 17, 2023 at 07:24:31AM -0700, Bjorn Andersson wrote: > On Tue, Oct 17, 2023 at 11:47:55AM +0530, Manivannan Sadhasivam wrote: > > From: Manivannan Sadhasivam > > Your S-o-b should match this. > I gave b4 a shot for sending the patches and missed this. Will fix it in next version. > > > > Qcom EP platforms require enabling/disabling the DBI CS2 access while > > programming some read only and shadow registers through DBI. So let's > > implement the dbi_cs2_access() callback that will be called by the DWC core > > while programming such registers like BAR mask register. > > > > Without DBI CS2 access, writes to those registers will not be reflected. > > > > Fixes: f55fee56a631 ("PCI: qcom-ep: Add Qualcomm PCIe Endpoint controller driver") > > Signed-off-by: Manivannan Sadhasivam > > --- > > drivers/pci/controller/dwc/pcie-qcom-ep.c | 14 ++++++++++++++ > > 1 file changed, 14 insertions(+) > > > > diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c > > index 32c8d9e37876..4653cbf7f9ed 100644 > > --- a/drivers/pci/controller/dwc/pcie-qcom-ep.c > > +++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c > > @@ -124,6 +124,7 @@ > > > > /* ELBI registers */ > > #define ELBI_SYS_STTS 0x08 > > +#define ELBI_CS2_ENABLE 0xa4 > > > > /* DBI registers */ > > #define DBI_CON_STATUS 0x44 > > @@ -262,6 +263,18 @@ static void qcom_pcie_dw_stop_link(struct dw_pcie *pci) > > disable_irq(pcie_ep->perst_irq); > > } > > > > +static void qcom_pcie_dbi_cs2_access(struct dw_pcie *pci, bool enable) > > +{ > > + struct qcom_pcie_ep *pcie_ep = to_pcie_ep(pci); > > + > > + writel_relaxed(enable, pcie_ep->elbi + ELBI_CS2_ENABLE); > > Don't you want to maintain the ordering of whatever write came before > this? > Since this in a dedicated function, I did not care about the ordering w.r.t previous writes. Even if it gets inlined, the order should not matter since it only enables/disables the CS2 access for the forthcoming writes. - Mani > Regards, > Bjorn > > > + /* > > + * Do a dummy read to make sure that the previous write has reached the > > + * memory before returning. > > + */ > > + readl_relaxed(pcie_ep->elbi + ELBI_CS2_ENABLE); > > +} > > + > > static void qcom_pcie_ep_icc_update(struct qcom_pcie_ep *pcie_ep) > > { > > struct dw_pcie *pci = &pcie_ep->pci; > > @@ -500,6 +513,7 @@ static const struct dw_pcie_ops pci_ops = { > > .link_up = qcom_pcie_dw_link_up, > > .start_link = qcom_pcie_dw_start_link, > > .stop_link = qcom_pcie_dw_stop_link, > > + .dbi_cs2_access = qcom_pcie_dbi_cs2_access, > > }; > > > > static int qcom_pcie_ep_get_io_resources(struct platform_device *pdev, > > > > -- > > 2.25.1 > > -- மணிவண்ணன் சதாசிவம்