From patchwork Sat Jul 13 06:09:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zeng Heng X-Patchwork-Id: 13732345 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3B13AC3DA42 for ; Sat, 13 Jul 2024 06:14:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uX7gFOb8Wusnp2L5nBRr5gMWGtIS6MuUY4LVRDZq1G8=; b=PTpgCadnImNjAUaVb9EDlfWHwJ wsoi7c8gsjRca8kf4TYaTeH/0jTs2xA1mhPysRuUTvpxvZenT7XbRoAXEPGrU663KRjYLuJ2D/KRd pvKk9SHvg9qqhCPQoMJVIcojaLgX88XlXapNze+tbIkq6m33Qe1nbogbWGfM7CcR5PwNuKiDthT8r fyx+fLt3ajYdFuqMMriMPeBD3LFKPHqu2ZiQiCvlc+rGSov7eJ1TpIWYjDvz6numkm0fL1rnKzmJk tOyEdy6s4nrjBx3pNb9F1PzscOA+jBS/MGsDxO4B6983BHHlCSlbGjvKql0rIkso33OPefpFAaMoo wf9lXDfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSW1S-000000020LM-1xAf; Sat, 13 Jul 2024 06:14:18 +0000 Received: from szxga07-in.huawei.com ([45.249.212.35]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSW0t-0000000209G-2MrW for linux-arm-kernel@lists.infradead.org; Sat, 13 Jul 2024 06:13:45 +0000 Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4WLdMf6WS7z1X4gK; Sat, 13 Jul 2024 14:09:18 +0800 (CST) Received: from kwepemf100008.china.huawei.com (unknown [7.202.181.222]) by mail.maildlp.com (Postfix) with ESMTPS id 2D90F1A0188; Sat, 13 Jul 2024 14:13:34 +0800 (CST) Received: from huawei.com (10.175.103.91) by kwepemf100008.china.huawei.com (7.202.181.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Sat, 13 Jul 2024 14:13:33 +0800 From: Zeng Heng To: CC: , Subject: [PATCH v6.10-rc1 3/4] arm_mpam: Correct the judgment condition of the CMAX feature Date: Sat, 13 Jul 2024 14:09:43 +0800 Message-ID: <20240713060944.2725647-4-zengheng4@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240713060944.2725647-1-zengheng4@huawei.com> References: <20240713060944.2725647-1-zengheng4@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemf100008.china.huawei.com (7.202.181.222) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240712_231343_804967_60E0717B X-CRM114-Status: GOOD ( 10.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org According to Arm Architecture MPAM Reference Manual (version DDI 0598D.b), to check whether hardware supports the CMAX feature or not, not only needs to check the CMAX_WD field of the MPAMF_CCAP_IDR register, but also needs to check the NO_CMAX field. Fixes: a275036b6767 ("arm_mpam: Probe and reset the rest of the features") Signed-off-by: Zeng Heng --- drivers/platform/arm64/mpam/mpam_devices.c | 6 ++++-- drivers/platform/arm64/mpam/mpam_internal.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/platform/arm64/mpam/mpam_devices.c b/drivers/platform/arm64/mpam/mpam_devices.c index acb91352c524..9acac8a22573 100644 --- a/drivers/platform/arm64/mpam/mpam_devices.c +++ b/drivers/platform/arm64/mpam/mpam_devices.c @@ -779,8 +779,10 @@ static void mpam_ris_hw_probe(struct mpam_msc_ris *ris) u32 ccap_features = mpam_read_partsel_reg(msc, CCAP_IDR); props->cmax_wd = FIELD_GET(MPAMF_CCAP_IDR_CMAX_WD, ccap_features); - if (props->cmax_wd) - mpam_set_feature(mpam_feat_ccap_part, props); + if (props->cmax_wd) { + if (!FIELD_GET(MPAMF_CCAP_IDR_NO_CMAX, ccap_features)) + mpam_set_feature(mpam_feat_ccap_part, props); + } } /* Cache Portion partitioning */ diff --git a/drivers/platform/arm64/mpam/mpam_internal.h b/drivers/platform/arm64/mpam/mpam_internal.h index 61aea729aa73..0e714ce7fa96 100644 --- a/drivers/platform/arm64/mpam/mpam_internal.h +++ b/drivers/platform/arm64/mpam/mpam_internal.h @@ -450,6 +450,7 @@ void mpam_resctrl_exit(void); /* MPAMF_CCAP_IDR - MPAM features cache capacity partitioning ID register */ #define MPAMF_CCAP_IDR_CMAX_WD GENMASK(5, 0) +#define MPAMF_CCAP_IDR_NO_CMAX BIT(30) /* MPAMF_MBW_IDR - MPAM features memory bandwidth partitioning ID register */ #define MPAMF_MBW_IDR_BWA_WD GENMASK(5, 0)