Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp771635rdf; Fri, 3 Nov 2023 14:58:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHsuoeEPgQ1tbtmEDymEA1p2WVXwpcDIxxbPRbowKxEw0Hov59D2CBcL3zbouV9b6uIbSh7 X-Received: by 2002:a17:902:f392:b0:1cc:64bc:ecf3 with SMTP id f18-20020a170902f39200b001cc64bcecf3mr10415005ple.34.1699048715134; Fri, 03 Nov 2023 14:58:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699048715; cv=none; d=google.com; s=arc-20160816; b=UU3tLnIc3VqvDC8wbCwKUv9Arar3fp3uac3YiU2AvAAvyxkjowZK7bK0KNe2IOntnt Dnc97fS0UrrorLOwbEA4xlPicA8E+rMrAeWBTXjrKULogneROaK+hpwk8SaX6ILtgWKX yBOknD+e27pUnr13Q1WXPDXef5udA5CAwh+v/XmhCK0La/qjHzrSGvBLSMhyefo6orNW nzrLlug27qPmEP9fDYlGW6rm8Zab3j69NJqePFoXeFqSwBVB2OmJmh8c0QVWe11IfvEu nJ51H1PmzJ/he8oNO0mzx6mJj1W5B60o5dz2GKZcGPW+727RcHwhroklQgsCuhkzhS6e 7XNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pvHqC7poFx7BMy+LdsPLJ3AAQCZp3Oo4BjaZBQGHt+E=; fh=tOxrsMndee4zIOy0VZB9aWWeYwsag5IiwXbbn3eahec=; b=q3qwJcn8GoBJp4PEhDS9pPWYIO7CHTCAyQA7sCXFqeODQSEZLTW6cSwKSVfcd+OKEg YsTJPpw4T61adn7K78k0PTZN4PRimH+rR+g/yq8fhckz9hYEDUZMvLj9SeVPvU53tErN G4uNISlmivmPpGmW2XJY51dN29f3xG7I0aiWjUJv5VRyEdqmnfE8Fsnvzm7v3qa3WDkR w1TH84anJUlR2pg/I9g/nk3AbQtDm6G4jLH9ZGeNDD/ZkX1GsFZYQ8ua8ISxKAMB+gUn PhH5m+MpF71L+CmST/fcVbfDkpVp7AY9TMeq188uBdY4r+BoOKTD2FGVMzuT4V17EtmA 0AVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LOT0XksP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id q12-20020a170903204c00b001cc2989d3e0si2187987pla.562.2023.11.03.14.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 14:58:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LOT0XksP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id C0E17836509A; Fri, 3 Nov 2023 14:58:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230332AbjKCV61 (ORCPT + 99 others); Fri, 3 Nov 2023 17:58:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbjKCV6Z (ORCPT ); Fri, 3 Nov 2023 17:58:25 -0400 Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12913A2 for ; Fri, 3 Nov 2023 14:58:23 -0700 (PDT) Received: by mail-yb1-xb2f.google.com with SMTP id 3f1490d57ef6-d9a518d66a1so2626844276.0 for ; Fri, 03 Nov 2023 14:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699048702; x=1699653502; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pvHqC7poFx7BMy+LdsPLJ3AAQCZp3Oo4BjaZBQGHt+E=; b=LOT0XksP+myBzb+k3dHDN+KY5lmDAzACgCEayy/2Jnmqlll9O6d8LvDnAj1lHddYxP wTV9bzWHVf2uwrzDWAmw5gv3daePNhbJox6LRbHQDByYpqRApN3HmtplzVDArS7B8YBN VmJw+kZ+ijRQSEWCZkuP9Xq+VY7WU9HD/bi3CY+to8kIq16piCB49kMeZBzwppqaFZtD ty8MfN5oH4y8AQs/skdiAOLKz9qGHo5QGzqPdw3BP4t+QcPmKcaGXD6eyxP7l6JFexRH qiCwyS2IvXrDNNs2VeQY1Li8wUDHXBge65VVr6o6MQxw5PRFDQPC/SlMttOJuCqri6RO tFjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699048702; x=1699653502; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pvHqC7poFx7BMy+LdsPLJ3AAQCZp3Oo4BjaZBQGHt+E=; b=ks2ZEsDUoY710bInd7X95kpn2CRiLmSrxPe2McvqSTDC5wEgCjp8A2wTYtc1M+Mf4y 79Xc/Elb4Jm7l2YM75cLk4rN14OufbG5GGjo9m20au/ODA+++ST8Z6JnZ7mHBDTBkqah xpAfAWqLxoqk296mhxgHIUzaUOYrnpcD7Pb4WZ5HfFns7Iyii9P1zrIOqTcjYe/GGvtz t/t2zUUd/QRD8cLOm2AHh5ikEmQ6ApRxQGG4JGBXdCk3yN5nd7Gz8D+eMPao3txC6Vqu 20RVV/YXmybJ0n4Ig5PdTEg2eYZ6OAFlZTspH6OdGiGuKyV5l2ZiVme7GVOQQnXV8ZKx VRHA== X-Gm-Message-State: AOJu0YzoMiOY5qlM5pmaWgbYCKn+ZaacbBryd/xQYCY9Nk5sJzGujezI aGNXXmhUeREX2T4CUDvHu2oskZpFtNvdngRQJySB5w== X-Received: by 2002:a5b:9d2:0:b0:d81:5d20:97b9 with SMTP id y18-20020a5b09d2000000b00d815d2097b9mr21018506ybq.31.1699048701977; Fri, 03 Nov 2023 14:58:21 -0700 (PDT) MIME-Version: 1.0 References: <20231103215124.1095-1-quic_bibekkum@quicinc.com> <20231103215124.1095-4-quic_bibekkum@quicinc.com> In-Reply-To: <20231103215124.1095-4-quic_bibekkum@quicinc.com> From: Dmitry Baryshkov Date: Fri, 3 Nov 2023 23:58:10 +0200 Message-ID: Subject: Re: [PATCH 3/3] iommu/arm-smmu: re-enable context caching in smmu reset operation To: Bibek Kumar Patro Cc: will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, a39.skl@gmail.com, konrad.dybcio@linaro.org, quic_saipraka@quicinc.com, quic_pkondeti@quicinc.com, quic_molvera@quicinc.com, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, qipl.kernel.upstream@quicinc.com Content-Type: text/plain; charset="UTF-8" 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]); Fri, 03 Nov 2023 14:58:32 -0700 (PDT) On Fri, 3 Nov 2023 at 23:53, 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. > > Signed-off-by: Bibek Kumar Patro > --- > drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 26 ++++++++++++++++++---- > 1 file changed, 22 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 590b7c285299..f342b4778cf1 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > @@ -457,11 +457,29 @@ static int qcom_smmu_def_domain_type(struct device *dev) > return match ? IOMMU_DOMAIN_IDENTITY : 0; > } > > +#define ARM_MMU500_ACTLR_CPRE BIT(1) > + > +static int qcom_smmu500_reset(struct arm_smmu_device *smmu) > +{ > + int i; > + u32 reg; > + > + arm_mmu500_reset(smmu); > + > + for (i = 0; i < smmu->num_context_banks; ++i) { > + reg = arm_smmu_cb_read(smmu, i, ARM_SMMU_CB_ACTLR); > + reg |= ARM_MMU500_ACTLR_CPRE; > + arm_smmu_cb_write(smmu, i, ARM_SMMU_CB_ACTLR, reg); > + } Wrong indentation. Did you run your patches through checkpatch.pl? > + > + return 0; > +} > + > static int qcom_sdm845_smmu500_reset(struct arm_smmu_device *smmu) > { > int ret; > > - arm_mmu500_reset(smmu); > + qcom_smmu500_reset(smmu); > > /* > * To address performance degradation in non-real time clients, > @@ -488,7 +506,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, > }; > @@ -507,7 +525,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, > }; > @@ -523,7 +541,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 > -- With best wishes Dmitry