Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp136123rbb; Fri, 23 Feb 2024 14:54:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWCfWr/HNo15nKUAp8kk1NMJmvr/HNYfDclP3iBhOJyN6fhA48/XorO128Bj6yDknNftmLi9b/2cm9Ldn1m7tBSV0dWu3HSXsOrPlS+3g== X-Google-Smtp-Source: AGHT+IFWhYhKOKL/P3j3E40bcQma51WcVpvan0A/MV2UqSmOWMXmiZRDxIWDVWgvpejjCyp8DTTC X-Received: by 2002:a05:6a20:e198:b0:1a0:d756:e280 with SMTP id ks24-20020a056a20e19800b001a0d756e280mr1247323pzb.30.1708728877303; Fri, 23 Feb 2024 14:54:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708728877; cv=pass; d=google.com; s=arc-20160816; b=TQ6T5i2wqq0gCH6N+DbvhCvM4Mi10KzvHmGVt54t0cvs/ixZfebWyi9fg0FAWzXExL NqWsx1TLqEX2GnPIVBkzqy6Ebao916uxptby26hmPKnYQHGN2H1kTUmK7ie249ztMglx 5pigjMP1A7ODQMeryZx9tMH9WJLjc2+zyx9dw9evtGfCrU+gCSw70O3Z/Dah/ICGDi9o 5+CLC36NUAl9TV+vnVJM1BVeu+fgxsfDNfCAxbUeyWTdWQtd9jCWKpsh0xMW7Z4NkPkA khfU+dkuEsaalzd0CNcmstHm/o2yySk4ydSc1pBjy6nABSm2tNpZJjd/Do8Id/ySbkib aDNA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=hXzNNVVfvc7jRTAESVnMHlkgfXv1tq+RlwZmh9V0qxE=; fh=mcX8EMjfnDu+7/41nVKncH2HeU2VmkOPVEhBVQcA1f4=; b=VDhJoyyaksfMkfnqJtoItiw5lvl1TEWgW1xlyUJA1b8mdFXmYlbt0V0YuYcjMUzK2x H7zfkw3E++C9XKxNp3rzsNEh4FytX18yHg+q6jPlbec44tUSj6+S35fZqzeo/vigs1Bj sTtBztAyJCOoeO4vriivS9GpwYgGmTXGmnOmJYOveCZ8l9+47ifRsEGhd6Scba194kej Jja2Kok0LVmSqxHnygX1dPCXyPc/6Zlw2ec9359BQeajuJttAa7KzdnLEMjIgxqDNKoi aBqfs6pZI6QC1ZI55Cj3HUeSySCg62uMOFRgD89PWrJnN3jB1RoWv7m2MZXnOWSvjRH0 nJDA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YsZPHsz5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79290-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79290-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f17-20020a635111000000b005dc13a2e7c1si12394pgb.117.2024.02.23.14.54.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 14:54:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79290-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YsZPHsz5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79290-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79290-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F27DA28768D for ; Fri, 23 Feb 2024 22:54:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C5AB14CADC; Fri, 23 Feb 2024 22:54:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YsZPHsz5" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85C491419B3; Fri, 23 Feb 2024 22:54:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708728867; cv=none; b=LNp27+1yk39CtK8YfBtfDiaoiUtXXKc7yFGxyy/Zl9PMxwZ4pYxDhns932T4Tcwd5PEh6id9lN6hsMwoihiiUYKNOn26+49Zs2dVbikKKIHeSL9fp8gBVYHJMC2dW+H+QUNyZtrf0Km2bX4R9uMivot0beWUa40VwS/JBDsSs9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708728867; c=relaxed/simple; bh=0NSUedbjyUk5R7hCcVkUZdvNMS/jzvFh6DRYgWh6R8c=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=sWLpSJihS8iibk9jpLNm7bSXecBhq2jioPyTzYD5E4UoY26hGHFHAC8905A2940t8HIbHimZmHKdj+80LFSMD65A7+CCvzO7bchFpdT8hEAIXbOAJ8jnwGDV0R1pUiJxOArAyolhVXbnQcoLCI7U5QsUqHAbeebw10QgH6844Y8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YsZPHsz5; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9C20C433C7; Fri, 23 Feb 2024 22:54:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708728867; bh=0NSUedbjyUk5R7hCcVkUZdvNMS/jzvFh6DRYgWh6R8c=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=YsZPHsz5raerQE80c8dON9WhwjgnZnIGP/CdqHiR1h6RPx/Hkh44I+f91o0jhk7YG BrGNkJ9pKYgdC1yhLs9XycYQUqdZsKvjMuRDJP6Q31eySEYOGTZ1Fqz2ppsjHcmrbc UokZK/Ozi4TcwTfHV12hPMreJD5ha5pVFPGW9AtbseYWUrzmVwaX4wiJldsbPpiDbK HkGt/ointiIK+uT9jhDrVZ5kPeJn0fC19ztaqVy0IqfA4gFk0+H51IwRCvvvWJ756+ yAVZItBMOnxXTUreSGnyOn+vY9PBRhiwL2ircyGdIoihcqcpGtwF2Elrkv1e8iQInp 8pTiumOHJUagA== Date: Fri, 23 Feb 2024 16:54:25 -0600 From: Bjorn Helgaas To: Mrinmay Sarkar Cc: andersson@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, konrad.dybcio@linaro.org, manivannan.sadhasivam@linaro.org, robh@kernel.org, quic_shazhuss@quicinc.com, quic_nitegupt@quicinc.com, quic_ramkri@quicinc.com, quic_nayiluri@quicinc.com, dmitry.baryshkov@linaro.org, quic_krichai@quicinc.com, quic_vbadigan@quicinc.com, quic_schintav@quicinc.com, Lorenzo Pieralisi , Krzysztof =?utf-8?Q?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 Subject: Re: [PATCH v5 1/3] PCI: qcom: Enable cache coherency for SA8775P RC Message-ID: <20240223225425.GA103870@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1708697021-16877-2-git-send-email-quic_msarkar@quicinc.com> On Fri, Feb 23, 2024 at 07:33:38PM +0530, Mrinmay Sarkar wrote: > Due to some hardware changes, SA8775P has set the NO_SNOOP attribute > in its TLP for all the PCIe controllers. NO_SNOOP attribute when set, > the requester is indicating that there no cache coherency issues exit > for the addressed memory on the host i.e., memory is not cached. But > in reality, requester cannot assume this unless there is a complete > control/visibility over the addressed memory on the host. s/that there no/that no/ s/exit/exist/ Forgive my ignorance here. It sounds like the cache coherency issue would refer to system memory, so the relevant No Snoop attribute would be in DMA transactions, i.e., Memory Reads or Writes initiated by PCIe Endpoints. But it looks like this patch would affect TLPs initiated by the Root Complex, not those from Endpoints, so I'm confused about how this works. If this were in the qcom-ep driver, it would make sense that setting No Snoop in the TLPs initiated by the Endpoint could be a problem, but that doesn't seem to be what this patch is concerned with. > And worst case, if the memory is cached on the host, it may lead to > memory corruption issues. It should be noted that the caching of memory > on the host is not solely dependent on the NO_SNOOP attribute in TLP. > > So to avoid the corruption, this patch overrides the NO_SNOOP attribute > by setting the PCIE_PARF_NO_SNOOP_OVERIDE register. This patch is not > needed for other upstream supported platforms since they do not set > NO_SNOOP attribute by default. > > 8775 has IP version 1.34.0 so intruduce a new cfg(cfg_1_34_0) for this > platform. Assign enable_cache_snoop flag into struct qcom_pcie_cfg and > set it true in cfg_1_34_0 and enable cache snooping if this particular > flag is true. s/intruduce/introduce/ Bjorn