Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp32204rdb; Wed, 20 Dec 2023 05:39:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGPhnY9h73Y/92ZHKJCgWtgfjZ21F7naYFK+1eTRUEFkNhGO7h8EOxgQkg4KaeA0I9uiRRE X-Received: by 2002:a05:6e02:2165:b0:35d:731d:8200 with SMTP id s5-20020a056e02216500b0035d731d8200mr24209564ilv.25.1703079555318; Wed, 20 Dec 2023 05:39:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703079555; cv=none; d=google.com; s=arc-20160816; b=XPPCKcsGhr6aFAZFsGIlx4S0UZHZ1QzBKcJEJ+FPaDt0O9oghwboZepBzrkiNLDqBj kinl0eaIM1hf8EZY1DWLuG+s8MH6FJ99ipKCvUvQc4pzPqviJc6SzFKg1BSGbyowJkOE EH8Xgk/zZCEl0oYQ2oIBK2Au/UoayhHUrocBUztc1qEiXxBVEgbkRdw7eevFIhxjAqcl 8KQOvi3yvEvSHQ3Wr8sXb8reKGbUvZL07XHUYWDYlInuAVp4aSfO86Zbt3x1rU7MJ0Sb 1MKYPcXI5WzMCBh2sJvCeaaSM+Xd3nMKR7LflEvtilWAc20VsNfo+jmCDBNzRWNRgcTw WRfg== 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=pN4BHUhiNI6+9uqvMcSXwIU07/RDI9wrKIK5K3yeVVA=; fh=mFC8nmckJLq19l2a2JACcOVBANdLlvDzOiUZ3OvRdps=; b=o+gwQ9Q7/6Uj+pTvoyZSTpshM345cZ32Ki2PSuHCZtog9uGldaIdeKzMVMWq8qESQg c5IpdkHOJ0Sc8baLyE+g7E1FqEoq8XuvtyLrFwoepNCrv0Oz4l+8znwjsnU1Cxas97b7 lpQiXejlE2flYSBKiYhvKeAvCfhA56m4p22Yx9ipk1A08HZXS2bRX+TJOMjrjjPGoxc1 d9Ln/a553p87Dfl7PsOulyC8UZMEADKxDu2cTwVIBBcaFX35pqPhE6VhQJDQSRiKGLNb BbiLR2WWXmoLLosFWDIAvF4iYFyl22GgvakPgQgclhGAH3bwpyJbdQ+wRcmqGvi9EVkB BBtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bu7KCtlv; spf=pass (google.com: domain of linux-kernel+bounces-6971-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6971-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d3-20020a656b83000000b005cdc9b097d6si1669695pgw.747.2023.12.20.05.39.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 05:39:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6971-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bu7KCtlv; spf=pass (google.com: domain of linux-kernel+bounces-6971-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6971-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 C9A1EB219DD for ; Wed, 20 Dec 2023 13:39:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 75C2336AE5; Wed, 20 Dec 2023 13:39:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="bu7KCtlv" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 5C3AE34569; Wed, 20 Dec 2023 13:39:00 +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 (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BKDA8W2031091; Wed, 20 Dec 2023 13:38:33 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=pN4BHUhiNI6+9uqvMcSXwIU07/RDI9wrKIK5K3yeVVA=; b=bu 7KCtlv+RgFAZYzpF3hHI45i2DMX/yYJCM8TvgzBgOnx/acrfHPUTevpOgHydC7jL 8wNTLi7bSgp0XrdULOS05L6D5MzKpnd/8W1/qEippjRD/OF9r6cGlEZYwjeOvlkA 4bMOxV0ZwxGY+Es356HuKmuRAYW4DHU+QczRHtp1U/DDP8LJT8WkLRM8xLV6re7T ntAN6Bnh358YPkoJQxuVkORPpcl4ZGY3qzwN1F+UIqDXA+BVSl5J4LXUuyyQ0vRs XNbZoEKJ+GKLMVfQU3MvH7w6x8dRu71zRpRnErFIRATmy4aQFWQLwalCsOB+4EbT UFXicKv4/6GhF0RX3pfw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v3tnw10s4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Dec 2023 13:38:33 +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 3BKDcWkS021718 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Dec 2023 13:38:32 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; Wed, 20 Dec 2023 05:38:26 -0800 From: Bibek Kumar Patro To: , , , , , , , , , , , , , , CC: , , , , , Bibek Kumar Patro Subject: [PATCH v6 0/5] iommu/arm-smmu: introduction of ACTLR implementation for Qualcomm SoCs Date: Wed, 20 Dec 2023 19:08:03 +0530 Message-ID: <20231220133808.5654-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: nasanex01a.na.qualcomm.com (10.52.223.231) 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: ZaJChor2nKTZJ6wRCweOi9d5ouyxV7fI X-Proofpoint-ORIG-GUID: ZaJChor2nKTZJ6wRCweOi9d5ouyxV7fI 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_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 impostorscore=0 suspectscore=0 phishscore=0 bulkscore=0 clxscore=1015 mlxlogscore=999 lowpriorityscore=0 adultscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312200097 This patch series consist of five parts and covers the following: 1. Re-enable context caching for Qualcomm SoCs to retain prefetcher settings during reset and runtime suspend. 2. Remove cfg inside qcom_smmu structure and replace it with single pointer to qcom_smmu_match_data avoiding replication of multiple members from same. 3. Introduce intital set of driver changes to implement ACTLR register for custom prefetcher settings in Qualcomm SoCs. 4. Add ACTLR data and implementation operations for SM8550. 5. Add ACTLR data and implementation operations for SC7280. Changes in v6 from v5: - Remove extra Suggested-by tags. - Add return check for arm_mmu500_reset in 1/5 as discussed. Link to v5: https://lore.kernel.org/all/20231219135947.1623-1-quic_bibekkum@quicinc.com/ Changes in v5 from v4: New addition: - Modify copyright year in arm-smmu-qcom.h to 2023 from 2022. Changes to incorporate suggestions from Dmitry as follows: - Modify the defines for prefetch in (foo << bar) format as suggested.(FIELD_PREP could not be used in defines is not inside any block/function) Changes to incorporate suggestions from Konrad as follows: - Shift context caching enablement patch as 1/5 instead of 5/5 to be picked up as independent patch. - Fix the codestyle to orient variables in reverse xmas tree format for patch 1/5. - Fix variable name in patch 1/5 as suggested. Link to v3: https://lore.kernel.org/all/20231215101827.30549-1-quic_bibekkum@quicinc.com/ 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: re-enable context caching in smmu reset operation 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/arm-smmu/arm-smmu-qcom-debug.c | 2 +- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 189 +++++++++++++++++- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h | 8 +- drivers/iommu/arm/arm-smmu/arm-smmu.c | 5 +- drivers/iommu/arm/arm-smmu/arm-smmu.h | 5 + 5 files changed, 199 insertions(+), 10 deletions(-) -- 2.17.1