Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2588734rdb; Wed, 15 Nov 2023 05:21:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNyVpjPGJI9LP3608pff6dAv2clNgCzlph85tXXKCgSSt43T3aTZFKSiGGbYpplfKnCtng X-Received: by 2002:a05:6a20:9147:b0:14d:f41c:435a with SMTP id x7-20020a056a20914700b0014df41c435amr15706173pzc.39.1700054514657; Wed, 15 Nov 2023 05:21:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700054514; cv=none; d=google.com; s=arc-20160816; b=w/Fj0WMI001Ymo2a6ismtzrGxy8yADaCXeabE/f4ISSanZa2tsKNmcVBRGBi9qGwsF jlhKjfGXwkdv++8MyUzpJLJo0tE7LKG9/2HxZDcNpWWd36ojCInUaYuTYu1K6RtjLhWI fArtEzgAB7m9S8kAMbz0vBzTN0kYmQwSmSYJg9awj8c2UbB1nhX1EVvTkiWn6nWtR6vy sQ8OxHBmHVU1T8yDlL0rzjTRADk71s2N1C7jMKUMDSf2bKkkl3LznW7jPa0ZQIWAB2Fm PCV9ZODIXqlX/ALYsO5Cw/BM0KIwfRhX/eGZhzRDY7aPneYFax9MM0aIf8ah8mj0XUft OPIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=qmhC7cUoOMTfZNr8tTpl5VWN0/bC5ZVilmLHQGwcmA8=; fh=Q7MMoO86Xq8aQJFZLo7eMhES8FfFCdDF7ougyZU2fp4=; b=gK4YiM9AzzgIxGQq9eVSOYSfbZXIPIVtAeMfw/z4ROGyxnY8QG7IKyEWnx2RXYN5ZH 7U8SEU29YDIDLbHJVam3oo05Kw8byxzbZZxgH1X7SswK4jsUUNp2tfTrSgwqG0CjSU7+ /Yjl4c8GZXY7Inbtm57Qjkzusd993dvDATo2UPuI9tT95YsIOZM5fsvXlvhWpJHrCb/R aRJU7FLsK1KTsCgPFHxDR53pnGyNDbptxQ/gHBVXVpUkglTtpeYgcolCTeIDfHuU1T3V 6aebmVP+zG1oF7xkbl4o3SDcXIf846uJwF9VGPVpZUO2E4M+lERABQuqtOOJyiL+mrTT /aHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FlzbVDhs; 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=pass (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 m130-20020a633f88000000b005c1cd418245si1691388pga.737.2023.11.15.05.21.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 05:21:54 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=FlzbVDhs; 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=pass (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 ABEE8801B716; Wed, 15 Nov 2023 05:21:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343875AbjKONVn (ORCPT + 99 others); Wed, 15 Nov 2023 08:21:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343884AbjKONVm (ORCPT ); Wed, 15 Nov 2023 08:21:42 -0500 Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9648811F for ; Wed, 15 Nov 2023 05:21:38 -0800 (PST) Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-5be6d6c04bfso70423377b3.3 for ; Wed, 15 Nov 2023 05:21:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700054498; x=1700659298; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=qmhC7cUoOMTfZNr8tTpl5VWN0/bC5ZVilmLHQGwcmA8=; b=FlzbVDhs5FPuEtsQgfwfZg+P5HLgzgGLJlFhk81vB8KES59dcCdJHuk8MAYRhT7H2J 2HuMN/YuQ5n9TdSresmvEC64GBy+kKDFqoLDuTQEKYUvPcKWWteW2tljkSwNST85YLJY 0wU6v5hEXDiYO65wGwP4oTMURm1KIUx6jfgeQC3J5NqXAWUr+IJFYiJ0fuMg1Wj50Lri q+qi4NAvFxHtAyMsI8CxudB4KBCNNAFbUUJqjkyCBwxDA+Urr74PjDW4jMzH1P2TwmVE oculpuRsxAA8BEpaYpyGfutUTAnwTIpigBN9ncveMGZ+bE69iaj33P8UBveZuXC0vVMP 21Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700054498; x=1700659298; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qmhC7cUoOMTfZNr8tTpl5VWN0/bC5ZVilmLHQGwcmA8=; b=Fh7bk0qXTqsbiyVczlKWf5sxNZUAbrxn+IlGB/HlWNbpFLjKWcP0XxaNoFBHUfAmvC P+VZJpOim6kSx4E6fTXilwaebXp8XtaMvelwlyJxtN3iSvaMV7w7JEQXVbDOwvA4tk3N nyuuuje5ZHUnHEYNPq8/y1MEBj1zDS569L9WV1tzx4Cd/QljADrLH7A+nyZgdJ3RQ5rS 4YrzA5wgVszbSCerBdNl19wKbUnrAfz2XjVo9FooOoSveWwRCr2BUm2/FOYtWCm1MhVR ec6HNnyYVdRO3V3uKyYl98TRzHzX6mO3az5m49DtiPvwJfIKsi//khpRcozlKZ2c4a9R Ythw== X-Gm-Message-State: AOJu0Yw2zXh+v830lReijb+dv6gY9K2OyAuafjtzS5Q2cOF30WpPr3vc 5WQ5eNb5SlfeMJYPWSLP4FekKNP6d6tDg82qAqZ97g== X-Received: by 2002:a25:c5c4:0:b0:d9a:fe8c:c29c with SMTP id v187-20020a25c5c4000000b00d9afe8cc29cmr9934442ybe.58.1700054497731; Wed, 15 Nov 2023 05:21:37 -0800 (PST) MIME-Version: 1.0 References: <1700051821-1087-1-git-send-email-quic_msarkar@quicinc.com> <1700051821-1087-2-git-send-email-quic_msarkar@quicinc.com> In-Reply-To: From: Dmitry Baryshkov Date: Wed, 15 Nov 2023 15:21:26 +0200 Message-ID: Subject: Re: [PATCH v3 1/3] PCI: qcom: Enable cache coherency for SA8775P RC To: Mrinmay Sarkar Cc: agross@kernel.org, andersson@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, konrad.dybcio@linaro.org, mani@kernel.org, robh+dt@kernel.org, quic_shazhuss@quicinc.com, quic_nitegupt@quicinc.com, quic_ramkri@quicinc.com, quic_nayiluri@quicinc.com, robh@kernel.org, quic_krichai@quicinc.com, quic_vbadigan@quicinc.com, quic_parass@quicinc.com, quic_schintav@quicinc.com, quic_shijjose@quicinc.com, Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Wed, 15 Nov 2023 05:21:51 -0800 (PST) On Wed, 15 Nov 2023 at 15:18, Dmitry Baryshkov wrote: > > On Wed, 15 Nov 2023 at 14:37, Mrinmay Sarkar wrote: > > > > This change will enable cache snooping logic to support > > cache coherency for 8775 RC platform. > > > > Signed-off-by: Mrinmay Sarkar > > --- > > drivers/pci/controller/dwc/pcie-qcom.c | 13 +++++++++++++ > > 1 file changed, 13 insertions(+) > > > > diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c > > index 6902e97..b82ccd1 100644 > > --- a/drivers/pci/controller/dwc/pcie-qcom.c > > +++ b/drivers/pci/controller/dwc/pcie-qcom.c > > @@ -51,6 +51,7 @@ > > #define PARF_SID_OFFSET 0x234 > > #define PARF_BDF_TRANSLATE_CFG 0x24c > > #define PARF_SLV_ADDR_SPACE_SIZE 0x358 > > +#define PCIE_PARF_NO_SNOOP_OVERIDE 0x3d4 > > #define PARF_DEVICE_TYPE 0x1000 > > #define PARF_BDF_TO_SID_TABLE_N 0x2000 > > > > @@ -117,6 +118,10 @@ > > /* PARF_LTSSM register fields */ > > #define LTSSM_EN BIT(8) > > > > +/* PARF_NO_SNOOP_OVERIDE register fields */ > > +#define WR_NO_SNOOP_OVERIDE_EN BIT(1) > > +#define RD_NO_SNOOP_OVERIDE_EN BIT(3) > > + > > /* PARF_DEVICE_TYPE register fields */ > > #define DEVICE_TYPE_RC 0x4 > > > > @@ -961,6 +966,14 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie) > > > > static int qcom_pcie_post_init_2_7_0(struct qcom_pcie *pcie) > > { > > + struct dw_pcie *pci = pcie->pci; > > + struct device *dev = pci->dev; > > + > > + /* Enable cache snooping for SA8775P */ > > + if (of_device_is_compatible(dev->of_node, "qcom,pcie-sa8775p")) > > Quoting my feedback from v1: > > Obviously: please populate a flag in the data structures instead of > doing of_device_is_compatible(). Same applies to the patch 2. Mani, I saw your response for the v1, but I forgot to respond. In my opinion, it's better to have the flag now, even if it is just for a single platform. It allows us to follow the logic of the driver and saves few string ops. > > > > + writel(WR_NO_SNOOP_OVERIDE_EN | RD_NO_SNOOP_OVERIDE_EN, > > + pcie->parf + PCIE_PARF_NO_SNOOP_OVERIDE); > > + > > qcom_pcie_clear_hpc(pcie->pci); > > > > return 0; > > -- > > 2.7.4 > > > > > -- > With best wishes > Dmitry -- With best wishes Dmitry