Skip to contentSkip to conversation

powerpc/hv-24x7: Fix pvr check when setting interface version

PATCH Applied Kajol Jain 3 participants 4 messages Jan 31, 2023 – Feb 15, 2023 PowerPC

lore
Share & tools
lore

Kajol Jain

author
#0 lore raw

PATCH 1/1 powerpc/hv-24x7: Fix pvr check when setting interface version

Commit ec3eb9d941a9 ("powerpc/perf: Use PVR rather than oprofile field to determine CPU version") added usage of pvr value instead of oprofile field to determine the platform. In hv-24x7 pmu driver code, pvr check uses PVR_POWER8 when assigning the interface version for power8 platform. But power8 can also have other pvr values like PVR_POWER8E and PVR_POWER8NVL. Hence the interface version won't be set properly incase of PVR_POWER8E and PVR_POWER8NVL.
Fix this issue by adding the checks for PVR_POWER8E and PVR_POWER8NVL as well.

Fixes ec3eb9d941a9 ("powerpc/perf: Use PVR rather than oprofile field to determine CPU version")
---
 arch/powerpc/perf/hv-24x7.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/perf/hv-24x7.c +2 -1
index 33c23225fd54..8c3253df133d 100644
@@ -1727,7 +1727,8 @@ static int hv_24x7_init(void)
 	}
 
 	/* POWER8 only supports v1, while POWER9 only supports v2. */
-	if (PVR_VER(pvr) == PVR_POWER8)
+	if (PVR_VER(pvr) == PVR_POWER8 || PVR_VER(pvr) == PVR_POWER8E ||
+			PVR_VER(pvr) == PVR_POWER8NVL)
 		interface_version = 1;
 	else {
 		interface_version = 2;
Signature · 1 line
2.39.0
Tested-by on v1 1/1
#1 lore raw
Quoted 15 lines · Kajol Jain

Commit ec3eb9d941a9 ("powerpc/perf: Use PVR rather than oprofile field to determine CPU version") added usage of pvr value instead of oprofile field to determine the platform. In hv-24x7 pmu driver code, pvr check uses PVR_POWER8 when assigning the interface version for power8 platform. But power8 can also have other pvr values like PVR_POWER8E and PVR_POWER8NVL. Hence the interface version won't be set properly incase of PVR_POWER8E and PVR_POWER8NVL.
Fix this issue by adding the checks for PVR_POWER8E and PVR_POWER8NVL as well.

Quoted 4 lines
Fixes ec3eb9d941a9 ("powerpc/perf: Use PVR rather than oprofile field to determine CPU version")

---

Thanks for the fix. Tested on Power8 successfully.

Quoted 8 lines

arch/powerpc/perf/hv-24x7.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/perf/hv-24x7.c +0 -0
index 33c23225fd54..8c3253df133d 100644

arch/powerpc/perf/hv-24x7.c static int hv_24x7_init(void) · line 1731

Quoted 6 lines
arch/powerpc/perf/hv-24x7.c +2 -1
@@ -1727,7 +1727,8 @@ static int hv_24x7_init(void)
 }
 
 /* POWER8 only supports v1, while POWER9 only supports v2. */
- if (PVR_VER(pvr) == PVR_POWER8)
+ if (PVR_VER(pvr) == PVR_POWER8 || PVR_VER(pvr) == PVR_POWER8E ||
+ PVR_VER(pvr) == PVR_POWER8NVL)

Do we really need the check for Power8NV?

author
#2 lore raw
Quoted 33 lines · Sachin Sant
Quoted 15 lines · Kajol Jain

Commit ec3eb9d941a9 ("powerpc/perf: Use PVR rather than oprofile field to determine CPU version") added usage of pvr value instead of oprofile field to determine the platform. In hv-24x7 pmu driver code, pvr check uses PVR_POWER8 when assigning the interface version for power8 platform. But power8 can also have other pvr values like PVR_POWER8E and PVR_POWER8NVL. Hence the interface version won't be set properly incase of PVR_POWER8E and PVR_POWER8NVL.
Fix this issue by adding the checks for PVR_POWER8E and PVR_POWER8NVL as well.

Quoted 4 lines
Fixes ec3eb9d941a9 ("powerpc/perf: Use PVR rather than oprofile field to determine CPU version")

---

Thanks for the fix. Tested on Power8 successfully.

Quoted 10 lines

arch/powerpc/perf/hv-24x7.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/perf/hv-24x7.c +0 -0
index 33c23225fd54..8c3253df133d 100644
@@ -1727,7 +1727,8 @@ static int hv_24x7_init(void)
 }
 
Quoted 6 lines

arch/powerpc/perf/hv-24x7.c static int hv_24x7_init(void) · line 1731

Quoted 4 lines
arch/powerpc/perf/hv-24x7.c +2 -1
 /* POWER8 only supports v1, while POWER9 only supports v2. */
- if (PVR_VER(pvr) == PVR_POWER8)
+ if (PVR_VER(pvr) == PVR_POWER8 || PVR_VER(pvr) == PVR_POWER8E ||
+ PVR_VER(pvr) == PVR_POWER8NVL)

Do we really need the check for Power8NV?

Hi Sachin,
Thanks for testing the patch. Here the NVL in POWER8NVL corresponds
to "NVLink" and its not related to PowerNV. PVR value used to specify processor version which might be in used in any of pseries/powernv, hence I added this check.

Thanks,
Kajol Jain

#3 lore raw
In reply to Kajol Jain
Quoted 11 lines · Kajol Jain

Commit ec3eb9d941a9 ("powerpc/perf: Use PVR rather than oprofile field to determine CPU version") added usage of pvr value instead of oprofile field to determine the platform. In hv-24x7 pmu driver code, pvr check uses PVR_POWER8 when assigning the interface version for power8 platform. But power8 can also have other pvr values like PVR_POWER8E and PVR_POWER8NVL. Hence the interface version won't be set properly incase of PVR_POWER8E and PVR_POWER8NVL.
Fix this issue by adding the checks for PVR_POWER8E and PVR_POWER8NVL as well.

Quoted 1 line

[...]

Applied to powerpc/next.

[1/1] powerpc/hv-24x7: Fix pvr check when setting interface version

      https://git.kernel.org/powerpc/c/60bd7936f99fd8cdbeca67180f80ea13d8b97a76

cheers