Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp1060808lqs; Wed, 6 Mar 2024 05:23:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXx0FbXVFBpsIN3WfO5wMhh+rneqg4HlPD04v+4qn0Wakn8uz4zEJ+ILnPNxOn25K+tfSvZUHyFYcNi4/iMKhXqTuZprEGYhm9Pac9/KQ== X-Google-Smtp-Source: AGHT+IEcYiOTN1MBtNhctcpdcDFITOZDADU1wd0E5Wh5FE9L10qjI5GD72MUKPEJD96bhVY0EOtS X-Received: by 2002:a05:6830:1146:b0:6e4:ed55:3a0c with SMTP id x6-20020a056830114600b006e4ed553a0cmr5055673otq.9.1709731388335; Wed, 06 Mar 2024 05:23:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709731388; cv=pass; d=google.com; s=arc-20160816; b=MAXKrRMF/r9HzVBU+vD+Lz6xptQypSFJ6v746/foy1mPCyejBhoA9WbFyoZaDROurz M15eIvsdoIeJEuo9zZpJg+SOmxGdK4f5h5Ds3Ycux6tyNJW1RWa7e1SPcYsBJc0+QM8b X0hwCoOIYGX3+xqWZhtScCleudUAUFoUkY6h2RI3rbzJJqSdLM14VlPa+jFMBCfh87W5 XqzgOefmeiuvRWETZHAy8tLY8OLnFkRFzApNMvIFrPKO/DBd713BWGVQAg2x/dbhc5BZ rMdXqea2KrkoRiApEK9WQ4M9WDJwJwOYVnrcemRSq/9bWT1oAcAmNNM7p8qVmBo/9oAB YuTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature; bh=9+sWLPYVN5M6BOe2ZCbASqp6MUFhVnfnocABlSvSYs0=; fh=U07vPWZGFupyqG75VTYHapr4ITV9uIDhOYgiGnbhD2M=; b=HcBZerVYVB+nTG04XhuFFAJ/Ju1jUL/7F03DhsXeKxg0ru+rwJ64QiLIdPwldth+ml afzXYzq9lMsoTnc3M5YKBx9Zv7EjlR/kGFLgfHW4vpE7uAStG1kBcJr208lp9Zx3IvHP l//wW+YKyQf3KLgh2Z3uo5NyUnkCtockn+Ndfk/h6npOpV+8/zGeryvsMc9KDRRa5f1R qc/IuisT1JNFLZhIFEArsTEgJ0AThsVYadBv5Hx4jjpMGGyXXHTyDSrRt5PK2lbQYMYy LA/T8Ysm5RkcEjyF2cTvXQ0i3XwjrvHKMX+YUeyPsZMCeuB1ISKVEWZwEcgsl4/LScn8 oWgQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=XDZSj4MI; arc=pass (i=1 spf=pass spfdomain=qualcomm.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-93951-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93951-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id r32-20020a632060000000b005dc905460f4si11670786pgm.3.2024.03.06.05.23.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 05:23:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93951-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=XDZSj4MI; arc=pass (i=1 spf=pass spfdomain=qualcomm.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-93951-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93951-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E94E8B21BA4 for ; Wed, 6 Mar 2024 13:11:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B82A130ACC; Wed, 6 Mar 2024 13:11:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="XDZSj4MI" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 4BE39130E5A; Wed, 6 Mar 2024 13:11:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709730690; cv=none; b=cH/xjK+vh7af0bqpZA4kr2vEiy5kgpxWlepAVWHeQ8wcWovjO5eb8B6FlY3egPowlDcPyoNooyL2+/QbDnxyvM3cMXVEapOdS6FKxJ1NboeMEy5/vJ48IzQm5mfg1xknuR1bEB5tiPWHWPxhXZ5zOdgUX9JXTPREK5lFPe72jFI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709730690; c=relaxed/simple; bh=eRzr15zzkKLVQLaXWePd28hOMNIbG9iTc6oNCPSa59g=; h=From:To:Cc:Subject:Date:Message-Id; b=MP7GvXQZtAY7R+mneXh1/106nyHibKC8HDiw0Bv7Y4C3x6IDhxErnjZSuMnNSKs3USSyrOhKKETG7967caYx5jiHkirQy35bSSPIXltwI4kNMnEPFSoaUog0QrzttOK0bh+xcTFjcN0zih/PGJbjh3K2Pt9+xF5PewG0FC5Gq7c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=XDZSj4MI; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426CPihh001569; Wed, 6 Mar 2024 13:11:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id; s=qcppdkim1; bh=9+sWLPYVN5M6 BOe2ZCbASqp6MUFhVnfnocABlSvSYs0=; b=XDZSj4MI1Rj2WqV5FD+h5IWmn2LB ZZWAhAZrgVUJVVDC2tIGyV8ZxGBygDJUBfdNxy0IYJQ2Jj+R2dh0iNN2bOgkMFEj uaESYN3eZ2yn/rUVlcUOwZQ6Ursl52wyeJa1MNBMQgQUYp9dFnn//6YuKz+nmi5Z FIRiyL1bzD43AmdD95fz0Ner+3eNnP/8xLZ3PTEvKFZTbCRw4NYRKCgdxhZt7S8b HAJmJv3UsBOJFfxs+1WOfZnamPEFO9W8eOfpQ8CbK5NdxQKdsJkNz1yUjvSsaqxv TJDhF1hhlC+ShVUSjigo1nFhwQ/Aaq+wewzThmYzxiBxc1acpwF/q57rcg== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpjy3rtd0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Mar 2024 13:11:19 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 426DBGev019074; Wed, 6 Mar 2024 13:11:16 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3wp0608qkb-1; Wed, 06 Mar 2024 13:11:16 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 426DBGsv019069; Wed, 6 Mar 2024 13:11:16 GMT Received: from hu-sgudaval-hyd.qualcomm.com (hu-msarkar-hyd.qualcomm.com [10.213.111.194]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 426DBGtd019068; Wed, 06 Mar 2024 13:11:16 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 3891782) id 1482B26B8; Wed, 6 Mar 2024 18:41:15 +0530 (+0530) From: Mrinmay Sarkar To: andersson@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, konrad.dybcio@linaro.org, manivannan.sadhasivam@linaro.org, robh@kernel.org Cc: quic_shazhuss@quicinc.com, quic_nitegupt@quicinc.com, quic_ramkri@quicinc.com, quic_nayiluri@quicinc.com, quic_krichai@quicinc.com, quic_vbadigan@quicinc.com, quic_schintav@quicinc.com, Mrinmay Sarkar , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=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: [PATCH v6 0/3] arm64: qcom: sa8775p: add cache coherency support for SA8775P Date: Wed, 6 Mar 2024 18:41:09 +0530 Message-Id: <1709730673-6699-1-git-send-email-quic_msarkar@quicinc.com> X-Mailer: git-send-email 2.7.4 X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: nrc6TKXXHQ8UKOExaGgtpOfVK_wjkBqE X-Proofpoint-ORIG-GUID: nrc6TKXXHQ8UKOExaGgtpOfVK_wjkBqE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_08,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060105 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 no cache coherency issues exist 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. 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. This series is to enable cache snooping logic in both RC and EP driver and add the "dma-coherent" property in dtsi to support cache coherency in SA8775P platform. Dependency ---------- Depends on: https://lore.kernel.org/all/1701432377-16899-1-git-send-email-quic_msarkar@quicinc.com/ https://lore.kernel.org/all/20240306-dw-hdma-v4-4-9fed506e95be@linaro.org/ [1] V5 -> V6: - updated commit message as per comments - added Kdoc comments in patch1 - change variable name from enable_cache_snoop to override_no_snoop - sort reg offset define in patch2 V4 -> V5: - Updated commit message in both Patch1 and patch2 - change variable name from no_snoop_override to enable_cache_snoop - rebased patch2 on top of [1] v3 -> v4: - added new cfg(cfg_1_34_0) for SA8775P in both RC and EP driver. - populated a flag in the data structures instead of doing of_device_is_compatible() in both RC and EP patch. - update commit mesaage and added reveiwed-by tag in commit message in dtsi patch. v2 -> v3: - update commit message(8755 -> 8775). v1 -> v2: - update cover letter with explanation. - define each of these bits and ORing at usage time rather than directly writing value in register. Mrinmay Sarkar (3): PCI: qcom: Override NO_SNOOP attribute for SA8775P RC PCI: qcom-ep: Override NO_SNOOP attribute for SA8775P EP arm64: dts: qcom: sa8775p: Mark PCIe EP controller as cache coherent arch/arm64/boot/dts/qcom/sa8775p.dtsi | 1 + drivers/pci/controller/dwc/pcie-qcom-ep.c | 20 +++++++++++++++++--- drivers/pci/controller/dwc/pcie-qcom.c | 25 ++++++++++++++++++++++++- 3 files changed, 42 insertions(+), 4 deletions(-) -- 2.7.4