powerpc/hv-24x7: Fix pvr check when setting interface version
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.
--- arch/powerpc/perf/hv-24x7.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
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 ) interface_version =1 ;else { interface_version =2 ;
Signature · 1 line
2.39.0
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 usesPVR_POWER8when assigning the interface version for power8 platform. But power8 can also have other pvr values likePVR_POWER8EandPVR_POWER8NVL. Hence the interface version won't be set properly incase ofPVR_POWER8EandPVR_POWER8NVL.
Fix this issue by adding the checks forPVR_POWER8EandPVR_POWER8NVLas well.
Quoted 4 lines
Fixes ec3eb9d941a9 ("powerpc/perf: Use PVR rather than oprofile field to determine CPU version")Reported-by Sachin Sant <[email protected]>Signed-off-by Kajol Jain <[email protected]>---
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
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?
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 usesPVR_POWER8when assigning the interface version for power8 platform. But power8 can also have other pvr values likePVR_POWER8EandPVR_POWER8NVL. Hence the interface version won't be set properly incase ofPVR_POWER8EandPVR_POWER8NVL.
Fix this issue by adding the checks forPVR_POWER8EandPVR_POWER8NVLas well.Quoted 4 lines
Fixes ec3eb9d941a9 ("powerpc/perf: Use PVR rather than oprofile field to determine CPU version")Reported-by Sachin Sant <[email protected]>Signed-off-by Kajol Jain <[email protected]>---
Thanks for the fix. Tested on Power8 successfully.
Tested-by Sachin Sant <[email protected]>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@@ -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
Michael Ellerman
AppliedQuoted 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 usesPVR_POWER8when assigning the interface version for power8 platform. But power8 can also have other pvr values likePVR_POWER8EandPVR_POWER8NVL. Hence the interface version won't be set properly incase ofPVR_POWER8EandPVR_POWER8NVL.
Fix this issue by adding the checks forPVR_POWER8EandPVR_POWER8NVLas 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