Commit 2a6c6476 authored by Zeng Heng's avatar Zeng Heng
Browse files

arm64/mpam: Be compatible with MPAM architecture v1.x

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAWM0R



--------------------------------

Modified to be compatible with MPAM architecture version 1.x instead of
version 1.0 only, otherwise the probe function would fail to initialize
MPAM resource.

Fixes: 2cf7960c ("arm64/mpam: Probe the features resctrl supports")
Signed-off-by: default avatarZeng Heng <zengheng4@huawei.com>
parent caaf346b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -127,12 +127,14 @@ mpam_probe_update_sysprops(u16 max_partid, u16 max_pmg)

static int mpam_device_probe(struct mpam_device *dev)
{
	u64 idr;
	u32 hwfeatures, part_sel;
	u16 max_intpartid = 0;
	u16 max_partid, max_pmg;

	if (mpam_read_reg(dev, MPAMF_AIDR) != MPAM_ARCHITECTURE_V1) {
		pr_err_once("device at 0x%llx does not match MPAM architecture v1.0\n",
	idr = mpam_read_reg(dev, MPAMF_AIDR);
	if ((idr & MPAMF_AIDR_ARCH_MAJOR_REV) != MPAM_ARCHITECTURE_V1) {
		pr_err_once("device at 0x%llx does not match MPAM architecture v1.x\n",
			dev->hwpage_address);
		return -EIO;
	}
+4 −0
Original line number Diff line number Diff line
@@ -48,6 +48,10 @@
#define HAS_MSMON           BIT(30)
#define HAS_PARTID_NRW      BIT(31)

/* MPAMF_AIDR - MPAM architecture ID register */
#define MPAMF_AIDR_ARCH_MAJOR_REV       GENMASK(7, 4)
#define MPAMF_AIDR_ARCH_MINOR_REV       GENMASK(3, 0)

/* MPAMF_IDR */
#define MPAMF_IDR_PMG_MAX_MASK      ((BIT(8) - 1) << 16)
#define MPAMF_IDR_PMG_MAX_SHIFT     16