Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp108613rdf; Thu, 2 Nov 2023 15:26:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZSIBzjdd2S3eWIbbvIqlecrEa9EigRHmiTzfL6rPgBrpHXJzuoBL4tCacgljLDXkfx0ak X-Received: by 2002:a17:906:13d8:b0:9da:f372:4f6c with SMTP id g24-20020a17090613d800b009daf3724f6cmr3149356ejc.32.1698963979810; Thu, 02 Nov 2023 15:26:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698963979; cv=none; d=google.com; s=arc-20160816; b=zV2K9m1+J2zM+Qip2gBWvGIfW6c6PiuDahWlZlXJDQfxin8oc4WwLD8R85G3MaJyeu pVP48eOgM0yO3iJheIxTdDHrLWkNDgUN94x/pOY7XxZZI4Eoh4U0dZoagP3VXQKyl2qR U/aTHhyF6hGUK/6APov5hprXZI3t9w/7ahy66EAMWI4gBsl02uIAPWez0JfCBO10GR6G 9bLfMg+yqpRoudq3W6NXJ0esWj5u3p4tTgiwAYlkvmv/NnuJDE0jWT4/czt2efv9V0uz i3TlQ+WaKJD471HJ97thJcBiR8E9axPrWJhUAPcbMglY8klh9Z7xuGp81AopjLYv2PF9 BiCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=54Wcim5fexlmc9mArCvndyoCrdtUDnHz0mDm1jI0dOs=; fh=himoeBcJELZPfPTolXAlZwa2aXi6bqtmmFgEEIVpKi8=; b=Ca0BmpCxeboFHfVDQKOSOCUlYX5lfVACcWGNei6jAkrUWqwZ+4oPMg5iBuSkKSfKPH M5XCg5vQaOcMD/f6zskjZn4HCanfP6Ofs8wVXhdQnxd1acpqQpH88WF0sao5qYE5Kw8+ uqPyIwlU+KKKo4rNAm7KXMeBYQYIX64NQNJ5vQKtojLpi/zrLILnQPYiSSGiW3oWvHu7 pMsaAXcb0XaQbkwQv9f89A2rR+y6Qf7OGtGwBqOe2pZtXw7imujBoYgNscAArQT4vHj3 ZRMKt/6WY8u7lDpTUUWu5WNbjxHv2qxaDmuP7j1IDDgiDjUpDc2ZRU6fhYBTFE8Hi5Os ihdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DprgNULt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id a6-20020a1709063a4600b009b2c4c1eb6bsi209155ejf.754.2023.11.02.15.26.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 15:26:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DprgNULt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id BF8E3811ADAF; Thu, 2 Nov 2023 15:26:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377488AbjKBWZu (ORCPT + 99 others); Thu, 2 Nov 2023 18:25:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234452AbjKBWZs (ORCPT ); Thu, 2 Nov 2023 18:25:48 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4C43191 for ; Thu, 2 Nov 2023 15:25:41 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-50949b7d7ffso1710754e87.0 for ; Thu, 02 Nov 2023 15:25:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698963940; x=1699568740; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=54Wcim5fexlmc9mArCvndyoCrdtUDnHz0mDm1jI0dOs=; b=DprgNULtrVXhddyAN6XzTpEO1fsbLbGVd+UmOPyBiE/ql5xUOo1DOmwFlX62Umo9A1 JLa3mCla+uSrsEjwMo6IiMnZCfwG//LzhqLvrXrL7DFMF6Qk5jrCcDwdJc71OYbZ25FP 8Pw4zh6YsWSw3y68/YEvNn17u9pykQlUK9CPAJHFsViaWPE3/qMsjXt2FrntXyxF1CLg Cx3J+2pum2CK8rbWQkmSwfvxcAbHIra4GAaqmt/yeb7TarGLCTFc4CVLO+d5J5khFMBO mZcoief24GbpHk79LhwDEs0PwsRZaAt5HRSuYD7n5Dt7jO4VDbusgEmgxpI/7KuLvboo TYEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698963940; x=1699568740; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=54Wcim5fexlmc9mArCvndyoCrdtUDnHz0mDm1jI0dOs=; b=VaCwrugdNB1qvpFBv2bOeTo80P0co9HHLlnCoIFiax8CGG7j6+x2X7j1Kt5DSrqOkr 8+C7PKSTFGDjDXmwHPrVKphAN6jmrzwUfvwKHa0VJ0EuKiQEPxabWzzoEc3IE1pp3zul BgXq4ybnMlSo6PI5EuyqvLORKzUV9RFGRj79MGRBUNwqYNzKAg/Tc1cTC739cw9p22ZX s4q4RtNWgxYnzfH4yFfeYK0sAT5g23oTfR8oWbrwKlf/HPI822SUpOQQyznvOdx4Z23h w+RpFi2080hqcFYNcNOquIFJoOLM611xuSVWqK5JFmzDDshvJRXoPhlrS54G4D6tNny2 qYsA== X-Gm-Message-State: AOJu0YxN1kueYn5SeGgmoWgOnAbRJtf70l7DqgM55jv5DCLC3DubtdVp L0D7Lj3N6O15lmrJ/DhMgEv34g== X-Received: by 2002:ac2:4555:0:b0:509:4a55:f189 with SMTP id j21-20020ac24555000000b005094a55f189mr2343918lfm.11.1698963939548; Thu, 02 Nov 2023 15:25:39 -0700 (PDT) Received: from [192.168.1.118] (abyj199.neoplus.adsl.tpnet.pl. [83.9.29.199]) by smtp.gmail.com with ESMTPSA id y93-20020a50bb66000000b0053e6e40cc1asm218128ede.86.2023.11.02.15.25.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Nov 2023 15:25:39 -0700 (PDT) Message-ID: <21dea74b-b802-2e69-af4b-07dfb68b7024@linaro.org> Date: Thu, 2 Nov 2023 23:25:36 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v1 1/3] PCI: qcom: Enable cache coherency for SA8775P RC To: Manivannan Sadhasivam , Dmitry Baryshkov Cc: Mrinmay Sarkar , agross@kernel.org, andersson@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@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 References: <1698767186-5046-1-git-send-email-quic_msarkar@quicinc.com> <1698767186-5046-2-git-send-email-quic_msarkar@quicinc.com> <20231102163619.GA20943@thinkpad> From: Konrad Dybcio In-Reply-To: <20231102163619.GA20943@thinkpad> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 02 Nov 2023 15:26:16 -0700 (PDT) On 02/11/2023 17:36, Manivannan Sadhasivam wrote: > On Thu, Nov 02, 2023 at 05:34:24PM +0200, Dmitry Baryshkov wrote: >> On Tue, 31 Oct 2023 at 17:46, Mrinmay Sarkar wrote: >>> >>> This change will enable cache snooping logic to support >>> cache coherency for SA8755P RC platform. >>> >>> Signed-off-by: Mrinmay Sarkar >>> --- >>> drivers/pci/controller/dwc/pcie-qcom.c | 11 +++++++++++ >>> 1 file changed, 11 insertions(+) >>> >>> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c >>> index 6902e97..6f240fc 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,9 @@ >>> /* PARF_LTSSM register fields */ >>> #define LTSSM_EN BIT(8) >>> >>> +/* PARF_NO_SNOOP_OVERIDE register value */ >>> +#define NO_SNOOP_OVERIDE_EN 0xa >>> + >>> /* PARF_DEVICE_TYPE register fields */ >>> #define DEVICE_TYPE_RC 0x4 >>> >>> @@ -961,6 +965,13 @@ 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")) >> >> Obviously: please populate a flag in the data structures instead of >> doing of_device_is_compatible(). Same applies to the patch 2. >> > > Not necessary at this point. For some unknown reasons, the HW team ended up > disabling cache snooping on this specific platform. Whereas on other platforms, > it is enabled by default. So I have low expectations that we would need this > setting on other platforms in the future. > > My concern with the usage of flag is that it warrants a new "qcom_pcie_cfg" > instance just for this quirk and it looks overkill to me. > > So if we endup seeing this behavior on other platforms as well (unlikely) then > we can switch to the flag approach. This register reads zeroes on 8250, can we confirm it works as expected there? I guess some benchmarks with and without 'dma-coherent'? Konrad