Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2479557rdb; Wed, 15 Nov 2023 01:46:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxEw7jNTFWnDEURtD3viNg7fY1Zs+ML8IRiH2eF4SyNKp9AqQb5JTzrlu/pTOpoG0PEeZU X-Received: by 2002:a05:6359:1a92:b0:16b:fb5a:20bb with SMTP id rv18-20020a0563591a9200b0016bfb5a20bbmr2771473rwb.29.1700041579875; Wed, 15 Nov 2023 01:46:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700041579; cv=none; d=google.com; s=arc-20160816; b=eSd/pMa+ZTrWC6VWp6mEWnU1A6SQSxkju01DvcnrdnLSPJYVqC/+sti/NVwDTWVZdq dX4sYg00iNTxCZPC97bLj+gO9yWnh863PV0kOQdxS6OU7h93ISRr1CEjMY6SWPDc4zJ8 L7N6Yiivz0XaHL5G8WnKRnaxBgSSqg3M0HPp+OSOVVCu1rD6sYPEqzxfFplXmoC2STxL x4iVWyPLoRq/d/NFMCZ4X84MV60DwdhG+yUr2t9hin3iRNYpVCejlqBk9kJ07Ojd4RZ8 PKmzscNtvyFNQqujHZhBQ45p+zyf3L9qmCW+NDxesGTT9u6a4ZE9S/kZbxFPRwVbWVwQ sj+g== 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:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=SnhYnfHeB3cxrsWYIELnF5pFN+u2BcbzLXaHgsjZAVg=; fh=jwZb5TAece+7p3muIYiUZGSNnJJ3ROvkQiebxQ8yzp0=; b=XFPYrOlAgpfQI5vXBB3eLCUcmBjBlbbLfLd8v4YI82lZMiuuVYy3b+7kWVVDw1GBAb OHi9KlQRra5zy92xzMyZJIkqxBkceKbqviURbmWMNewBXZULpSTDeJB9lhBlXWxRgbxp x3c6E9uKKz7t2JdInQoeaQhNa0I4ogn/ahs7hARQXYtYK17mad27IAmWf/TpKNxDZruw fSXXjHBZacsZyXxPeg22iXREL+k4QkAm9FIbydg/T5QHo0w8h78HfM5Cv0U0adZI4sog edzGZoNss9Ak9+DJHfbHO68Llqwtbq5HFG8QB1nZC6heTccY6D2b+LCogjR+QlO3ZPo3 n54Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=i5uzYkpW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id bs132-20020a63288a000000b005a9fde46fa0si9256401pgb.130.2023.11.15.01.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 01:46:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=i5uzYkpW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 969EE8077FB2; Wed, 15 Nov 2023 01:45:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234784AbjKOJpv (ORCPT + 99 others); Wed, 15 Nov 2023 04:45:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234688AbjKOJpt (ORCPT ); Wed, 15 Nov 2023 04:45:49 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A884B11C; Wed, 15 Nov 2023 01:45:46 -0800 (PST) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AF9FON0030235; Wed, 15 Nov 2023 09:45:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=SnhYnfHeB3cxrsWYIELnF5pFN+u2BcbzLXaHgsjZAVg=; b=i5uzYkpWAVYtbefX5KuS3d1pLqLBqVDZpTmf+FkbZQqa4B0sIaMYkFd0gzWXqyZKhcFs lZkaoKu1PsiVeJ0ZgdYjYSrrkeu2aXAeYbZyVENiK5Cki11ClHJpBSRCKhPLnKVcFu4e g3cuEu8QYI+/toMUySvwrcbRvsPYh6oh+AokIKFhYSyCJT7ktdfZHJlKQJVciqLWTA54 AruNsu0teBm5DSMlAn3JKVKUSMLEYG0zyfBOtEwmnaX9QtO1UsurjB6uny3thPCgt8W/ bykdoez1SODzzp56TFazA+HILQTU20FcM/e+ZQAZgGzlwUfXE7voKsZ9scuNRyoG2BS7 Ig== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ucfka9gmb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 09:45:25 +0000 Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3AF9jPF3007067 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 09:45:25 GMT Received: from [10.214.66.253] (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.39; Wed, 15 Nov 2023 01:45:20 -0800 Message-ID: <72b30354-0497-45cf-8b71-e4f265eb0005@quicinc.com> Date: Wed, 15 Nov 2023 15:15:17 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/3] iommu/arm-smmu: re-enable context caching in smmu reset operation Content-Language: en-US To: Dmitry Baryshkov CC: , , , , , , , , , , , References: <20231114135654.30475-1-quic_bibekkum@quicinc.com> <20231114135654.30475-4-quic_bibekkum@quicinc.com> From: Bibek Kumar Patro In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: gMeGl_0zgcZ19JZc4iL69MEDlzAKvabo X-Proofpoint-GUID: gMeGl_0zgcZ19JZc4iL69MEDlzAKvabo X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-15_07,2023-11-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 spamscore=0 bulkscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 priorityscore=1501 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311150073 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 15 Nov 2023 01:45:59 -0800 (PST) On 11/14/2023 7:45 PM, Dmitry Baryshkov wrote: > On Tue, 14 Nov 2023 at 15:57, Bibek Kumar Patro > wrote: >> >> Context caching is re-enabled in the prefetch buffer for Qualcomm SoCs >> through SoC specific reset ops, which is disabled in the default MMU-500 >> reset ops, but is expected for context banks using ACTLR register to >> retain the prefetch value during reset and runtime suspend. > > Please refer to Documentation/process/submitting-patches.rst and > rephrase this following the rules there. > Noted, will go through the description once and rephrase it in next version complying with rules. >> >> Signed-off-by: Bibek Kumar Patro >> --- >> drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 25 ++++++++++++++++++---- >> 1 file changed, 21 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c >> index 0eaf6f2a2e49..fa867b1d9d16 100644 >> --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c >> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c >> @@ -478,11 +478,28 @@ static int qcom_smmu_def_domain_type(struct device *dev) >> return match ? IOMMU_DOMAIN_IDENTITY : 0; >> } >> >> +static int qcom_smmu500_reset(struct arm_smmu_device *smmu) >> +{ >> + int i; >> + u32 reg; >> + >> + arm_mmu500_reset(smmu); >> + >> + /* Re-enable context caching after reset */ >> + for (i = 0; i < smmu->num_context_banks; ++i) { >> + reg = arm_smmu_cb_read(smmu, i, ARM_SMMU_CB_ACTLR); >> + reg |= CPRE; >> + arm_smmu_cb_write(smmu, i, ARM_SMMU_CB_ACTLR, reg); >> + } >> + >> + return 0; >> +} >> + >> static int qcom_sdm845_smmu500_reset(struct arm_smmu_device *smmu) >> { >> int ret; >> >> - arm_mmu500_reset(smmu); >> + qcom_smmu500_reset(smmu); > > Is this applicable for sdm845? For all other platforms supported by > qcom_smmu_500 implementation? > In arm_mmu500_reset operation drivers/iommu/arm/arm-smmu/arm-smmu-impl.c CPRE bit is reset for all SoC based on mmu500 platform, hence for all Qualcomm SoCs including sm845 we are setting back the CPRE bit. >> >> /* >> * To address performance degradation in non-real time clients, >> @@ -509,7 +526,7 @@ static const struct arm_smmu_impl qcom_smmu_500_impl = { >> .init_context = qcom_smmu_init_context, >> .cfg_probe = qcom_smmu_cfg_probe, >> .def_domain_type = qcom_smmu_def_domain_type, >> - .reset = arm_mmu500_reset, >> + .reset = qcom_smmu500_reset, >> .write_s2cr = qcom_smmu_write_s2cr, >> .tlb_sync = qcom_smmu_tlb_sync, >> }; >> @@ -528,7 +545,7 @@ static const struct arm_smmu_impl sm8550_smmu_500_impl = { >> .init_context = qcom_smmu_init_context, >> .cfg_probe = qcom_smmu_cfg_probe, >> .def_domain_type = qcom_smmu_def_domain_type, >> - .reset = arm_mmu500_reset, >> + .reset = qcom_smmu500_reset, >> .write_s2cr = qcom_smmu_write_s2cr, >> .tlb_sync = qcom_smmu_tlb_sync, >> }; >> @@ -544,7 +561,7 @@ static const struct arm_smmu_impl qcom_adreno_smmu_v2_impl = { >> static const struct arm_smmu_impl qcom_adreno_smmu_500_impl = { >> .init_context = qcom_adreno_smmu_init_context, >> .def_domain_type = qcom_smmu_def_domain_type, >> - .reset = arm_mmu500_reset, >> + .reset = qcom_smmu500_reset, >> .alloc_context_bank = qcom_adreno_smmu_alloc_context_bank, >> .write_sctlr = qcom_adreno_smmu_write_sctlr, >> .tlb_sync = qcom_smmu_tlb_sync, >> -- >> 2.17.1 >> > >