From nobody Wed Dec 17 01:32:09 2025 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (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 4D46CA41 for ; Mon, 22 Jul 2024 04:05:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721621135; cv=none; b=HQfFz8STGVPbnitvsaQoFQqvwT1304huRRKn4bcyGdHUjkDgYgosCQQ1flMm578gdnU+bLkW7ixidPjI1GrtvUoVC9mojNIQbCUDVPjERaPMrybdBSiIS9q+JCnHbvmpZk1+1KI7pjVbn5kqfIQCXjdFanOWax1DCydoPitDyOo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721621135; c=relaxed/simple; bh=pRysUHIv8ye9ZAnFZcRDd5Yr1XT1Elzpnisa/eQLrwg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ASpe9qqOKZkaozBgv/OLWsmFkoSznxXKma4oP+kbNTGZPMG9J17u2PCQaB4SbyuAet6rfctfloQQHG2fN4gdpwN/1PPA+tndlSJjpBVjae3gd88QfZBVuYOYYm8i315szzIkd1K+y9r0zWnH/qCX9OOo4BPGI+thP82f9ooEd2Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4WS69n4c3QznbX1; Mon, 22 Jul 2024 12:04:45 +0800 (CST) Received: from kwepemf100008.china.huawei.com (unknown [7.202.181.222]) by mail.maildlp.com (Postfix) with ESMTPS id F2A8E1800A1; Mon, 22 Jul 2024 12:05:30 +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; Mon, 22 Jul 2024 12:05:30 +0800 From: Zeng Heng To: , , , CC: , , , Subject: [PATCH mpam/v6.10-rc1 RFC 3/4] arm_mpam: Correct the judgment condition of the CMAX feature Date: Mon, 22 Jul 2024 12:01:20 +0800 Message-ID: <20240722040121.515021-4-zengheng4@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240722040121.515021-1-zengheng4@huawei.com> References: <20240722040121.515021-1-zengheng4@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemf100008.china.huawei.com (7.202.181.222) Content-Type: text/plain; charset="utf-8" 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 =3D mpam_read_partsel_reg(msc, CCAP_IDR); =20 props->cmax_wd =3D 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); + } } =20 /* 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); =20 /* 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) =20 /* MPAMF_MBW_IDR - MPAM features memory bandwidth partitioning ID register= */ #define MPAMF_MBW_IDR_BWA_WD GENMASK(5, 0) --=20 2.25.1