Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6572160rdb; Fri, 15 Dec 2023 02:21:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IGpuIOLwF+pV9pvM4MbEhP7yfMLlqdy+AKgeifo2BdIG0CsbVZ1oBRCjY/wnZq4YbltkaZO X-Received: by 2002:a05:6871:794:b0:202:d78c:c4d1 with SMTP id o20-20020a056871079400b00202d78cc4d1mr8829558oap.33.1702635679246; Fri, 15 Dec 2023 02:21:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702635679; cv=none; d=google.com; s=arc-20160816; b=eYdiXvoHyU5htpl1W+hz/T6X527V4wyfF8xYfsBn4tAS2Fj3fJC+60YILt/bP8fqPw KDPu1ZJQ/SO4HypsYg1AxzhLubP7k2CV5ZubmFT53bcJzoT/ENsNsglwg7GVfEgYZp0H Zfj8F/7un+poJ9rz9PWDFrz8DREleLJg0bh4zO79S49yMdcTKzNr28D84j/IwKzBrzql kExnjJ7xhNqQ5/XGE/wa0RSGfsl3XastrKUI90rTYGm09BGbXvvWZ1OAUATZClIDu6tf 7Ikgg48WLXBjPlz982VpbgujXjAuux9/jiOBk5Eno51hQdWylPRwAN28r5Mbt/k1Wrkd YzXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=ZMp/QztxiryzID7yBBs7i8B2OEcWm+VKvHL8oxEN5oE=; fh=mFC8nmckJLq19l2a2JACcOVBANdLlvDzOiUZ3OvRdps=; b=b/0Nfs5Urfn9ijUOGOTUtC2Z5RSlnQZ7UCLESqdSDABgFeFkd1CZLpEcXUnA4hc8gu n6SIMbKUepUuoMyXlz+68FCRUAr0MIM9wLWmv0cR4VjP22R+sc1KzWZoGMAB4tIgMHCD lRL/wjKZA7HjG5Qd90/s/mpjwa2/t+uMBl+NNYhENvPWRN82mH+7mtErhvTBgqjgOTaH 89Gig+cUR+QCkgXo0lOlO+giUr1atsJ3lXF3mCmYTaKMq4V67Gvo7zlZSw8kyA9cV2kq P79NuYQeimuIuddLNARUv2zsXmqsqr2ywpFw3X53Fb5ZNBrw9kftrRpvTMOKheWyuwZn BiHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=QnFykoOB; spf=pass (google.com: domain of linux-kernel+bounces-734-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-734-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 80-20020a630253000000b005b8ee1c0c68si12828894pgc.605.2023.12.15.02.21.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 02:21:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-734-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=QnFykoOB; spf=pass (google.com: domain of linux-kernel+bounces-734-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-734-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 C962CB23473 for ; Fri, 15 Dec 2023 10:19:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 464101CA9D; Fri, 15 Dec 2023 10:19:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="QnFykoOB" X-Original-To: linux-kernel@vger.kernel.org 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 2411E1BDD4; Fri, 15 Dec 2023 10:19:16 +0000 (UTC) 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=quicinc.com Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BF9IAx0010684; Fri, 15 Dec 2023 10:18:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version:content-type; s= qcppdkim1; bh=ZMp/QztxiryzID7yBBs7i8B2OEcWm+VKvHL8oxEN5oE=; b=Qn FykoOBRgpYDTotB37+QPotRcR1Ns1ViJ/u8PrFKe/lbx9fsQ33/llpEm51Ar0eP5 eK+QqnU2CeUhBcDcqWln15XAe4fUz9YVboB1r0dGG5rmzBho2qg8RkT0qiVG4xo2 +IpqIZwTK8FXgN0h0lj+wn6wV916FwHGBNuG/IO1QaFk898K4O7LYvoZvc07vyvr XYGqiVWwQHhVRzu9p9bL0vibxNh4n1N8PSRNv7HopkgynrWYWwM73bLFq0Hf+kY0 quKMOhTAiGyOI9xJ5oRFmet4xzThyi+5g9lBJ7GA2od6G9btVeC8UD5AHZjzSLsj zfgRTJWcKyQizopYqwvQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v07c62q9a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 10:18:52 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BFAIphv028433 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 10:18:51 GMT Received: from hu-bibekkum-hyd.qualcomm.com (10.80.80.8) 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.40; Fri, 15 Dec 2023 02:18:44 -0800 From: Bibek Kumar Patro To: , , , , , , , , , , , , , , CC: , , , , , Bibek Kumar Patro Subject: [PATCH v4 0/5] iommu/arm-smmu: introduction of ACTLR implementation for Qualcomm SoCs Date: Fri, 15 Dec 2023 15:48:22 +0530 Message-ID: <20231215101827.30549-1-quic_bibekkum@quicinc.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: zdyiUgdaVUk47dsjRn4e8xcW3BHpBYwr X-Proofpoint-ORIG-GUID: zdyiUgdaVUk47dsjRn4e8xcW3BHpBYwr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 mlxlogscore=999 mlxscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 bulkscore=0 spamscore=0 phishscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312150069 This patch series consist of three parts and covers the following: 1. Remove cfg inside qcom_smmu structure and replace it with single pointer to qcom_smmu_match_data avoiding replication of multiple members from same. 2. Introduce intital set of driver changes to implement ACTLR register for custom prefetcher settings in Qualcomm SoCs. 3. Add ACTLR data and implementation operations for SM8550. 4. Add ACTLR data and implementation operations for SC7280. 5. Re-enable context caching for Qualcomm SoCs to retain prefetcher settings during reset and runtime suspend. Changes in v4 from v3: New addition: - Remove actlrcfg_size and use NULL end element instead to traverse the actlr table, as this would be a cleaner approach by removing redundancy of actlrcfg_size. - Renaming of actlr set function to arm_smmu_qcom based proprietary convention. - break from loop once sid is found and ACTLR value is initialized in qcom_smmu_set_actlr. - Modify the GFX prefetch value separating into 2 sensible defines. - Modify comments for prefetch defines as per SMMU-500 TRM. Changes to incorporate suggestions from Konrad as follows: - Use Reverse-Christmas-tree sorting wherever applicable. - Pass arguments directly to arm_smmu_set_actlr instead of creating duplicate variables. - Use array indexing instead of direct pointer addressed by new addition of eliminating actlrcfg_size. - Switch the HEX value's case from upper to lower case in SC7280 actlrcfg table. Changes to incorporate suggestions from Dmitry as follows: - Separate changes not related to ACTLR support to different commit with patch 5/5. - Using pointer to struct for arguments in smr_is_subset(). Changes to incorporate suggestions from Bjorn as follows: - fix the commit message for patch 2/5 to properly document the value space to avoid confusion. Fixed build issues reported by kernel test robot [1] for arm64-allyesconfig [2]. [1]: https://lore.kernel.org/all/202312011750.Pwca3TWE-lkp@intel.com/ [2]: https://download.01.org/0day-ci/archive/20231201/202312011750.Pwca3TWE-lkp@intel.com/config Link to v3: https://lore.kernel.org/all/20231127145412.3981-1-quic_bibekkum@quicinc.com/ Changes in v3 from v2: New addition: - Include patch 3/4 for adding ACTLR support and data for SC7280. - Add driver changes for actlr support in gpu smmu. - Add target wise actlr data and implementation ops for gpu smmu. Changes to incorporate suggestions from Robin as follows: - Match the ACTLR values with individual corresponding SID instead of assuming that any SMR will be programmed to match a superset of the data. - Instead of replicating each elements from qcom_smmu_match_data to qcom_smmu structre during smmu device creation, replace the replicated members with qcom_smmu_match_data structure inside qcom_smmu structre and handle the dereference in places that requires them. Changes to incorporate suggestions from Dmitry and Konrad as follows: - Maintain actlr table inside a single structure instead of nested structure. - Rename prefetch defines to more appropriately describe their behavior. - Remove SM8550 specific implementation ops and roll back to default qcom_smmu_500_impl implementation ops. - Add back the removed comments which are NAK. - Fix commit description for patch 4/4. Link to v2: https://lore.kernel.org/all/20231114135654.30475-1-quic_bibekkum@quicinc.com/ Changes in v2 from v1: - Incorporated suggestions on v1 from Dmitry,Konrad,Pratyush. - Added defines for ACTLR values. - Linked sm8550 implementation structure to corresponding compatible string. - Repackaged actlr value set implementation to separate function. - Fixed indentation errors. - Link to v1: https://lore.kernel.org/all/20231103215124.1095-1-quic_bibekkum@quicinc.com/ Changes in v1 from RFC: - Incorporated suggestion form Robin on RFC - Moved the actlr data table into driver, instead of maintaining it inside soc specific DT and piggybacking on exisiting iommus property (iommu = ) to set this value during smmu probe. - Link to RFC: https://lore.kernel.org/all/a01e7e60-6ead-4a9e-ba90-22a8a6bbd03f@quicinc.com/ Bibek Kumar Patro (5): iommu/arm-smmu: refactor qcom_smmu structure to include single pointer iommu/arm-smmu: introduction of ACTLR for custom prefetcher settings iommu/arm-smmu: add ACTLR data and support for SM8550 iommu/arm-smmu: add ACTLR data and support for SC7280 iommu/arm-smmu: re-enable context caching in smmu reset operation .../iommu/arm/arm-smmu/arm-smmu-qcom-debug.c | 2 +- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 184 +++++++++++++++++- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h | 6 +- drivers/iommu/arm/arm-smmu/arm-smmu.c | 5 +- drivers/iommu/arm/arm-smmu/arm-smmu.h | 5 + 5 files changed, 193 insertions(+), 9 deletions(-) -- 2.17.1