Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3195489rdg; Tue, 17 Oct 2023 07:25:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2sdZ+vag0+YRASf/d4akjbQ9AGBcsVsTYu5/mh77KHkyDVvvc5LBYQ6TjznEs+6Z1g4JS X-Received: by 2002:a05:6871:431a:b0:1be:ceca:c666 with SMTP id lu26-20020a056871431a00b001bececac666mr2657304oab.14.1697552705373; Tue, 17 Oct 2023 07:25:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697552705; cv=none; d=google.com; s=arc-20160816; b=cEL3U0rIFVomsqsRgOPt3VFNsdOW9bwDlR2UTCTn8VYKkcXhsVVLm40+/FlXt2Bq+m obyMGGotAHhrJaNx2rTKbcBVaT9T+w0RvUCGysk/1eK79g2Wnm1mgMAOdL6h1lCsMwlA yRLk3V3OhJBQas53h63NTSigE+cWLBfien6CYijr/NPuGsnK9GdDjrxUOb5ABm/iLob5 KX3Vp/Oogx0y0qI1B2MQzuOzr7+X0MA4OOPaE0zTaJXrneugAFfhIkFCUrqJUdtgBTQK pGkGiosu3sMV8HYO7Z9PghxqXP47ldpa6VPE1dJ7lJUDJD5JUtT/RoAASQNPB9SMNNON WRtQ== 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 :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Z1BbkLfJM1dZsoZ8hAA5FBScRtYnqgna6SeRcoxVwi4=; fh=+ahIdTlxnSnkgXL7uiIxq8IJ6PYFPFsZafG9EKvvp1o=; b=NxD9URx1iTUBUKy9AS+DxOnxtXgIVolXG085VdXaxrHUPk6ia63r8HbG5kdNwJPnJu lLdVhILRMCNYJt0yjdUIYpdoeCTimZVLvyheDUfQtNeNgJPKgrsjYblJ50hITXu2KT7S zqKTv2gDTDTzzHhXZoN9WKrVCecpCkwL0B7hfvqUx4kzS0bEZDeSK7QlEKzxw5QapOIq gzpz3fLaHmUhH0oOzlq+NTdWec/y8j8huFGDpp6F+covk1QQgRBJ5HsEc07ExsX8uQPA yXb8PpNT8Um70iZQq3mphQFwWOGjXPhglwOV6hAHYImrHP/d03iThpNMEOOu/jLt7PTW ti2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=MlalrgBD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id i191-20020a6387c8000000b00565eb0b4f33si1939961pge.224.2023.10.17.07.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 07:25:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=MlalrgBD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 3389E8031F26; Tue, 17 Oct 2023 07:25:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344105AbjJQOYp (ORCPT + 99 others); Tue, 17 Oct 2023 10:24:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343820AbjJQOYo (ORCPT ); Tue, 17 Oct 2023 10:24:44 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24BB2F0; Tue, 17 Oct 2023 07:24:42 -0700 (PDT) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39HDe2WB030531; Tue, 17 Oct 2023 14:24:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=Z1BbkLfJM1dZsoZ8hAA5FBScRtYnqgna6SeRcoxVwi4=; b=MlalrgBDnO/UN61jsGkKwPMBQ9o5BgzREIGtVrTtqdd6d8kAt126rdrB1RmrSzQPoOQK 3+oJPynhiWPBOz1R+iYdkL886LhQSE92J1Yj7voJKYr9qFrQ7dcoJqMEjs4ECCTPUeNR 0LGOPKB3Kf8HherLvxHq4ukS5PmQZ4MKsLTTDe2DJXN3t77GT2k22Z0hiaLqVwr+QlzD pNIQ3uaxvErGwKQJzqKhV5xAeB8L3FM1kRISsRTdx6yD5KJ3sk40oaZAzCVYZja+QgLc ZzhuMhIZwoRw2rXsNEWARbL+gVbP0MwAjdaHE2w1vkTSdJ9mFOC3BXbSPzURhKup/8xy 9g== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tsd1rsumn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Oct 2023 14:24:33 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 39HEOXT7028004 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Oct 2023 14:24:33 GMT Received: from hu-bjorande-lv.qualcomm.com (10.49.16.6) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.39; Tue, 17 Oct 2023 07:24:32 -0700 Date: Tue, 17 Oct 2023 07:24:31 -0700 From: Bjorn Andersson To: Manivannan Sadhasivam CC: Jingoo Han , Gustavo Pimentel , Manivannan Sadhasivam , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , , , Subject: Re: [PATCH 2/2] PCI: qcom-ep: Implement dbi_cs2_access() function callback for DBI CS2 access Message-ID: <20231017142431.GR3553829@hu-bjorande-lv.qualcomm.com> References: <20231017-pcie-qcom-bar-v1-0-3e26de07bec0@linaro.org> <20231017-pcie-qcom-bar-v1-2-3e26de07bec0@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20231017-pcie-qcom-bar-v1-2-3e26de07bec0@linaro.org> X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: M27n39Tcjrvr17biD81g-GEg8TMVBnYF X-Proofpoint-ORIG-GUID: M27n39Tcjrvr17biD81g-GEg8TMVBnYF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-17_03,2023-10-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxscore=0 bulkscore=0 adultscore=0 clxscore=1011 mlxlogscore=708 spamscore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 impostorscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310170122 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 howler.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 (howler.vger.email [0.0.0.0]); Tue, 17 Oct 2023 07:25:01 -0700 (PDT) On Tue, Oct 17, 2023 at 11:47:55AM +0530, Manivannan Sadhasivam wrote: > From: Manivannan Sadhasivam Your S-o-b should match this. > > 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? 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 >