Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2315595rwi; Thu, 3 Nov 2022 15:42:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6b2btqYdsW2N7gsqOYmkLgutUW2nWiiTtcCWmpfkxkwF64G8rk8F2W964YUn+/PwegwOow X-Received: by 2002:a63:7e4d:0:b0:43c:8ce9:2a9f with SMTP id o13-20020a637e4d000000b0043c8ce92a9fmr27769200pgn.528.1667515362206; Thu, 03 Nov 2022 15:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667515362; cv=none; d=google.com; s=arc-20160816; b=mStH4rWsgOLeJ9jr+hd5vG6c4P3sWugXJu/LcpvESQyXEx3EaE9NyfcEnIS+BfW2T1 lf1iG0EGlNkmKpKa6fxiWDgF3WAB/CY/+IwCkpLKRrnSDXL64hxrwdLgXZzFBudON7s6 OeQcqN5ReFZN2a3KHhbTRhQPZl+uvzLwlubNVRH2EO6KlHuXato1daD648ygAVtN4BL6 VTWj2r/dIVZ8erZRpMHUEiNDMo/8O/r4Znv3pZVaxrUUtXiKuaMdzxtaiQeVVQnB47zJ fpSrMPXYT2ilHb4QfE/K+aASC/Jh8msjlt7dDPuX5L4yiGGEj79xoxHV6KoWVggz2iNa OFNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=dAvGo8hUVnCJdOaOHwloI5JQG/uqE/A2irutxgEtJ8c=; b=I23W93ZBL2lVPoVsNE8gdJHgP2mUkX9693Z7H6ZUdxEZXWZ1qm0srQRC6vL9klBq/E go0cwTsuhrmkh0MFlxGi3/LnPrO5oF6j9WnjmPGneyvN3LhCRreVTCBowWqHFgGTNKuD eByhm2stZbbqjB8LMbGEA3exh0un8bIAw1vwjaaNzUrKx0n5c3GhCs1AtMLBPYdUZXGp Fx7nVTHo3xGYY7zNR/6kD6aajRupWxhJeJjvGq5Y06m64m6mAtxAkMAvUhsOzbynJR9E sVgnLc+cG9+p/l1122lBhHvTMN0A3C/efCfRPTAe3L/KUnqlrIl24s2SUJfeCTcrIgx6 97RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=OV3Xnbb6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r133-20020a632b8b000000b0046edb8cdbf7si2381873pgr.795.2022.11.03.15.42.30; Thu, 03 Nov 2022 15:42:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=OV3Xnbb6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231690AbiKCWWZ (ORCPT + 97 others); Thu, 3 Nov 2022 18:22:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229985AbiKCWWW (ORCPT ); Thu, 3 Nov 2022 18:22:22 -0400 Received: from m12-14.163.com (m12-14.163.com [220.181.12.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C11411F2FC for ; Thu, 3 Nov 2022 15:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=dAvGo 8hUVnCJdOaOHwloI5JQG/uqE/A2irutxgEtJ8c=; b=OV3Xnbb6nUIdXSokE6oN9 lip5QPVy2fijo9pjyjm3UtwYrIqar5X1+K4XjI6+XFjkB9gJAabjzO50uySICzbQ RW4x/D225ulsj9UVOeRpQU6wS8KVU5nY7C+g7F3oT0q65dZ9oKfcLT83Ozsi47H5 /5Ms7VIZJuimlv4tF/Rmks= Received: from localhost.localdomain (unknown [171.221.150.41]) by smtp10 (Coremail) with SMTP id DsCowABnmznpPmRjRFnrKg--.58971S4; Fri, 04 Nov 2022 06:21:44 +0800 (CST) From: Chen Lin To: will@kernel.org Cc: robin.murphy@arm.com, joro@8bytes.org, treding@nvidia.com, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Chen Lin Subject: [PATCH] iommu/arm-smmu: Warn once when the perfetcher errata patch fails to apply Date: Fri, 4 Nov 2022 06:21:21 +0800 Message-Id: <20221103222121.3051-1-chen45464546@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: DsCowABnmznpPmRjRFnrKg--.58971S4 X-Coremail-Antispam: 1Uf129KBjvdXoWrtw45XF4fKr43WF1xXrW3Awb_yoWkCrcEv3 Wru3srA34rArW7Ww1Yq3Way3s2kr47Zrn7Wr4Sq3s3JrnrXFyrAan2qF95Kw4xGFy0vFy2 qF1Yg3yxJry7WjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRNBTYUUUUUU== X-Originating-IP: [171.221.150.41] X-CM-SenderInfo: hfkh0kqvuwkkiuw6il2tof0z/xtbB2A+unmBHMc4a7wAAsK X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Default reset value of secure banked register SMMU_sACR.cache_lock is 1. If it is not been set to 0 by secure software(eg: atf), the non-secure linux cannot clear ARM_MMU500_ACTLR_CPRE bit. In this situation, the prefetcher errata is not applied successfully, warn once. Signed-off-by: Chen Lin --- drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c b/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c index 658f3cc83278..2d2252b3e518 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c @@ -136,6 +136,9 @@ int arm_mmu500_reset(struct arm_smmu_device *smmu) 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); + reg = arm_smmu_cb_read(smmu, i, ARM_SMMU_CB_ACTLR); + if (reg & ARM_MMU500_ACTLR_CPRE) + dev_warn_once(smmu->dev, "Failed to alpply prefetcher errata patch, check SMMU_sACR.cache_lock\n"); } return 0; -- 2.25.1