linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/hv-24x7: Fix pvr check when setting interface version
@ 2023-01-31 18:48 Kajol Jain
  2023-02-01 14:11 ` Sachin Sant
  2023-02-15 12:40 ` Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Kajol Jain @ 2023-01-31 18:48 UTC (permalink / raw)
  To: mpe; +Cc: atrajeev, kjain, maddy, Sachin Sant, disgoel, linuxppc-dev

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")
Reported-by: Sachin Sant <sachinp@linux.ibm.com>
Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
---
 arch/powerpc/perf/hv-24x7.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
index 33c23225fd54..8c3253df133d 100644
--- a/arch/powerpc/perf/hv-24x7.c
+++ b/arch/powerpc/perf/hv-24x7.c
@@ -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;
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/hv-24x7: Fix pvr check when setting interface version
  2023-01-31 18:48 [PATCH] powerpc/hv-24x7: Fix pvr check when setting interface version Kajol Jain
@ 2023-02-01 14:11 ` Sachin Sant
  2023-02-03  4:53   ` kajoljain
  2023-02-15 12:40 ` Michael Ellerman
  1 sibling, 1 reply; 4+ messages in thread
From: Sachin Sant @ 2023-02-01 14:11 UTC (permalink / raw)
  To: Kajol Jain; +Cc: Athira Rajeev, Madhavan Srinivasan, linuxppc-dev, disgoel



> On 01-Feb-2023, at 12:18 AM, Kajol Jain <kjain@linux.ibm.com> wrote:
> 
> 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")
> Reported-by: Sachin Sant <sachinp@linux.ibm.com>
> Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
> ---

Thanks for the fix. Tested on Power8 successfully.
Tested-by: Sachin Sant <sachinp@linux.ibm.com>

> arch/powerpc/perf/hv-24x7.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
> index 33c23225fd54..8c3253df133d 100644
> --- a/arch/powerpc/perf/hv-24x7.c
> +++ b/arch/powerpc/perf/hv-24x7.c
> @@ -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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/hv-24x7: Fix pvr check when setting interface version
  2023-02-01 14:11 ` Sachin Sant
@ 2023-02-03  4:53   ` kajoljain
  0 siblings, 0 replies; 4+ messages in thread
From: kajoljain @ 2023-02-03  4:53 UTC (permalink / raw)
  To: Sachin Sant; +Cc: Athira Rajeev, Madhavan Srinivasan, linuxppc-dev, disgoel



On 2/1/23 19:41, Sachin Sant wrote:
> 
> 
>> On 01-Feb-2023, at 12:18 AM, Kajol Jain <kjain@linux.ibm.com> wrote:
>>
>> 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")
>> Reported-by: Sachin Sant <sachinp@linux.ibm.com>
>> Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
>> ---
> 
> Thanks for the fix. Tested on Power8 successfully.
> Tested-by: Sachin Sant <sachinp@linux.ibm.com>
> 
>> arch/powerpc/perf/hv-24x7.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
>> index 33c23225fd54..8c3253df133d 100644
>> --- a/arch/powerpc/perf/hv-24x7.c
>> +++ b/arch/powerpc/perf/hv-24x7.c
>> @@ -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?

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/hv-24x7: Fix pvr check when setting interface version
  2023-01-31 18:48 [PATCH] powerpc/hv-24x7: Fix pvr check when setting interface version Kajol Jain
  2023-02-01 14:11 ` Sachin Sant
@ 2023-02-15 12:40 ` Michael Ellerman
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2023-02-15 12:40 UTC (permalink / raw)
  To: Kajol Jain, mpe; +Cc: disgoel, atrajeev, linuxppc-dev, maddy, Sachin Sant

On Wed, 1 Feb 2023 00:18:04 +0530, Kajol Jain wrote:
> 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.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/hv-24x7: Fix pvr check when setting interface version
      https://git.kernel.org/powerpc/c/60bd7936f99fd8cdbeca67180f80ea13d8b97a76

cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-15 12:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-31 18:48 [PATCH] powerpc/hv-24x7: Fix pvr check when setting interface version Kajol Jain
2023-02-01 14:11 ` Sachin Sant
2023-02-03  4:53   ` kajoljain
2023-02-15 12:40 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).