Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp909610rdd; Wed, 10 Jan 2024 03:20:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IEwbP0A/mQf0h5TWju8pGqLDY+U7YfHKfheUJMkVM+CVzl3vwjT9A9N3tKiX3/ecByT0ba7 X-Received: by 2002:a05:620a:4515:b0:783:36db:ee91 with SMTP id t21-20020a05620a451500b0078336dbee91mr643259qkp.44.1704885643676; Wed, 10 Jan 2024 03:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704885643; cv=none; d=google.com; s=arc-20160816; b=UA13dfkuu66LqBJHTX1LmhZDmjmZbZtiL04dunHol69W7GUrppb9Bi/mt9fZ/fmbAk Iy3YJ1gDsa2txYL1w8yAFmZMx1wrcT0vkmCW9jUSmILCGpt4c45Edj2JedO6YDbeI5uy Rdcf9jpAsUqlhh3GcVeRQzYQ9yfrraBlaTWFIlkDgLfnlrgCDyLRdiXNL2ZKBUQP1sdA DiC+HFKMLqYHhjlWpkpG8MBFXLXxGDWAylkt0AqphCOUJUP1JEd2uxyT3h5KJhHhB1BH h9SIWNfNWxqpHowF8U/czoEDvRdll9IkGsOkXAK51u2kVT4tzfTmuQujhGRAaI5hI+Ao jK6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=h/8/ZwB243iw6p/xOQp0jUExVkUBtzL3X7VNJeAeTMg=; fh=nJbjU/bpAkDhzqg9z+Fjmp3CREX2apK2Z9HfgRP5aKg=; b=JtDOYMQqOYBepFG6yHkP2mbx4RlHNTpzdDthreXsjdXBQyggQHjRgrMmvTJfGMMvxG jplIvZHlEOEuR0qqC7m6M055xfjudDPNq2WDq6SK0Ekx/Lrh2PfUge8ijoF/l1IbAOQY G41a7cu6Ryv03+UcNxsffw71CSTGoLaG8khQsSdTtsuNV0gBi6J4Hwvt5en64oJZkvSw wXjLUCcz1psQfPIYpFbmrkmes3g4weTpq9eramvLIqdHnPj10L4dLw7m5dzS8HTkVyU4 okngRcTQ+EBaNFzfIdFpGQMwfXQ6W8PDSWU9J5Fp4r+U30Ea1r8hIwqUNsbkqn9uoVV9 rk1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ShQ9qgpf; spf=pass (google.com: domain of linux-kernel+bounces-22067-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22067-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bl24-20020a05620a1a9800b0078337907ec6si643167qkb.664.2024.01.10.03.20.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 03:20:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22067-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ShQ9qgpf; spf=pass (google.com: domain of linux-kernel+bounces-22067-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22067-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5384B1C26074 for ; Wed, 10 Jan 2024 11:20:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DEBC47F55; Wed, 10 Jan 2024 11:18:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="ShQ9qgpf" 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 1B67C47A7C; Wed, 10 Jan 2024 11:18:17 +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 (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40A9jOxu002529; Wed, 10 Jan 2024 11:17:56 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=h/8/ZwB243iw6p/xOQp0jUExVkUBtzL3X7VNJeAeTMg=; b=Sh Q9qgpf4cd+NFZZZZxVITw3En2hp0ST6z9EhCh8cc/SPT35b1ZpUtEBDR7TWVqC6C By7cod4oVJvIlfGGZPIQmmzUOcPpJilUlIYcsrB10QCz9QuwaAFRMZPkDi71D/nv /iKeuKNh02IHaU/e1OGisByf/qe93vgyBtuYycKkhyn7RoblZVL7vyG6TKo4EwTt 9TXt3vlRkWXw26rHUgxFI9KwlLwoa0onpfW2AYzGg5H2Ie+Srqy9E/JpKqGHt4KB 54iwB7+TF9EhaBZSHODlw0dLj8kB39XyEdPTSrOJ/uvyucfNHdjbQBDwqtSb3Uoz lgb2JpkLgrFt+jemU5zQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vhj17h1f3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jan 2024 11:17:56 +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 40ABHtmD010234 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jan 2024 11:17:55 GMT Received: from [10.214.66.253] (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, 10 Jan 2024 03:17:48 -0800 Message-ID: <550cf801-431e-46e7-9f1d-7e80878ab40a@quicinc.com> Date: Wed, 10 Jan 2024 16:47:48 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 1/5] iommu/arm-smmu: re-enable context caching in smmu reset operation Content-Language: en-US To: Konrad Dybcio , , , , , , , , , , , , , , CC: , , , , References: <20240109114220.30243-1-quic_bibekkum@quicinc.com> <20240109114220.30243-2-quic_bibekkum@quicinc.com> <36f9eac0-3086-4d18-9879-02738e99d262@linaro.org> From: Bibek Kumar Patro In-Reply-To: <36f9eac0-3086-4d18-9879-02738e99d262@linaro.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit 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-ORIG-GUID: MOZzoe3EmhfUGLOENSXgl5svdQuY-2MS X-Proofpoint-GUID: MOZzoe3EmhfUGLOENSXgl5svdQuY-2MS 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 suspectscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 impostorscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401100092 On 1/10/2024 4:30 PM, Konrad Dybcio wrote: > > > On 1/9/24 12:42, Bibek Kumar Patro wrote: >> Default MMU-500 reset operation disables context caching in >> prefetch buffer. It is however expected for context banks using >> the ACTLR register to retain their prefetch value during reset >> and runtime suspend. >> >> Replace default MMU-500 reset operation with Qualcomm specific reset >> operation which envelope the default reset operation and re-enables >> context caching in prefetch buffer for Qualcomm SoCs. >> >> Signed-off-by: Bibek Kumar Patro >> --- >>   drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 37 ++++++++++++++++++++-- >>   1 file changed, 34 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c >> b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c >> index 549ae4dba3a6..000e207346af 100644 >> --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c >> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c >> @@ -14,6 +14,16 @@ >> >>   #define QCOM_DUMMY_VAL    -1 >> >> +/* >> + * SMMU-500 TRM defines BIT(0) as CMTLB (Enable context caching in the >> + * macro TLB) and BIT(1) as CPRE (Enable context caching in the prefetch >> + * buffer). The remaining bits are implementation defined and vary >> across >> + * SoCs. >> + */ >> + >> +#define CPRE            (1 << 1) >> +#define CMTLB            (1 << 0) >> + >>   static struct qcom_smmu *to_qcom_smmu(struct arm_smmu_device *smmu) >>   { >>       return container_of(smmu, struct qcom_smmu, smmu); >> @@ -376,11 +386,32 @@ 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 ret; >> +    u32 val; >> +    int i; >> + >> +    ret = arm_mmu500_reset(smmu); >> + >> +    if (ret) > Weird empty line.. Please remove it in the next revision since you're > already going to send a new one.. > > Reviewed-by: Konrad Dybcio > Ack, thanks for pointing this out. Will remove this while sending out the new patch. Thanks & regards, Bibek > Konrad