diff mbox series

[v5,08/10] imc: Use pir_to_core_id() rather than cpu_get_core_index()

Message ID 20200422050419.72957-9-svaidy@linux.ibm.com
State Superseded
Headers show
Series Initial fused-core support for POWER9 | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (9547b3da44d546f0083dd3aeb5436226fccf81e3)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Vaidyanathan Srinivasan April 22, 2020, 5:04 a.m. UTC
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>

The IMC HW targets HW ECs, not fused cores on P9

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 hw/imc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Vasant Hegde April 22, 2020, 2:48 p.m. UTC | #1
On 4/22/20 10:34 AM, Vaidyanathan Srinivasan wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> 
> The IMC HW targets HW ECs, not fused cores on P9

Can you add below changes to this patch?

index b487a510a..c4561f5de 100644
--- a/hw/imc.c
+++ b/hw/imc.c
@@ -754,7 +754,7 @@ static int64_t opal_imc_counters_init(uint32_t type, 
uint64_t addr, uint64_t cpu
                 if (!c)
                         return OPAL_PARAMETER;

-               phys_core_id = cpu_get_core_index(c);
+               phys_core_id = pir_to_core_id(c->pir);
                 port_id = phys_core_id % 4;

                 if (proc_chip_quirks & QUIRK_MAMBO_CALLOUTS)


-Vasant



> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> ---
>   hw/imc.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/imc.c b/hw/imc.c
> index 927fba0b..48f43033 100644
> --- a/hw/imc.c
> +++ b/hw/imc.c
> @@ -685,7 +685,7 @@ static int64_t opal_imc_counters_init(uint32_t type, uint64_t addr, uint64_t cpu
>   		 * pdbar in specific scom ports. port_id are in
>   		 * pdbar_scom_index[] and htm_scom_index[].
>   		 */
> -		phys_core_id = cpu_get_core_index(c);
> +		phys_core_id = pir_to_core_id(c->pir);
>   		port_id = phys_core_id % 4;
> 
>   		if (proc_chip_quirks & QUIRK_MAMBO_CALLOUTS)
> @@ -840,7 +840,7 @@ static int64_t opal_imc_counters_start(uint32_t type, uint64_t cpu_pir)
>   		 * Core IMC hardware mandates setting of htm_mode in specific
>   		 * scom ports (port_id are in htm_scom_index[])
>   		 */
> -		phys_core_id = cpu_get_core_index(c);
> +		phys_core_id = pir_to_core_id(c->pir);
>   		port_id = phys_core_id % 4;
> 
>   		if (proc_chip_quirks & QUIRK_MAMBO_CALLOUTS)
> @@ -902,7 +902,7 @@ static int64_t opal_imc_counters_stop(uint32_t type, uint64_t cpu_pir)
>   		 * Core IMC hardware mandates setting of htm_mode in specific
>   		 * scom ports (port_id are in htm_scom_index[])
>   		 */
> -		phys_core_id = cpu_get_core_index(c);
> +		phys_core_id = pir_to_core_id(c->pir);
>   		port_id = phys_core_id % 4;
> 
>   		if (proc_chip_quirks & QUIRK_MAMBO_CALLOUTS)
>
Vaidyanathan Srinivasan May 6, 2020, 11:47 a.m. UTC | #2
* Vasant Hegde <hegdevasant@linux.vnet.ibm.com> [2020-04-22 20:18:31]:

> On 4/22/20 10:34 AM, Vaidyanathan Srinivasan wrote:
> > From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > 
> > The IMC HW targets HW ECs, not fused cores on P9
> 
> Can you add below changes to this patch?
> 
> index b487a510a..c4561f5de 100644
> --- a/hw/imc.c
> +++ b/hw/imc.c
> @@ -754,7 +754,7 @@ static int64_t opal_imc_counters_init(uint32_t type,
> uint64_t addr, uint64_t cpu
>                 if (!c)
>                         return OPAL_PARAMETER;
> 
> -               phys_core_id = cpu_get_core_index(c);
> +               phys_core_id = pir_to_core_id(c->pir);
>                 port_id = phys_core_id % 4;
> 
>                 if (proc_chip_quirks & QUIRK_MAMBO_CALLOUTS)
> 

Thanks Vasant, I have included this hunk.

--Vaidy
diff mbox series

Patch

diff --git a/hw/imc.c b/hw/imc.c
index 927fba0b..48f43033 100644
--- a/hw/imc.c
+++ b/hw/imc.c
@@ -685,7 +685,7 @@  static int64_t opal_imc_counters_init(uint32_t type, uint64_t addr, uint64_t cpu
 		 * pdbar in specific scom ports. port_id are in
 		 * pdbar_scom_index[] and htm_scom_index[].
 		 */
-		phys_core_id = cpu_get_core_index(c);
+		phys_core_id = pir_to_core_id(c->pir);
 		port_id = phys_core_id % 4;
 
 		if (proc_chip_quirks & QUIRK_MAMBO_CALLOUTS)
@@ -840,7 +840,7 @@  static int64_t opal_imc_counters_start(uint32_t type, uint64_t cpu_pir)
 		 * Core IMC hardware mandates setting of htm_mode in specific
 		 * scom ports (port_id are in htm_scom_index[])
 		 */
-		phys_core_id = cpu_get_core_index(c);
+		phys_core_id = pir_to_core_id(c->pir);
 		port_id = phys_core_id % 4;
 
 		if (proc_chip_quirks & QUIRK_MAMBO_CALLOUTS)
@@ -902,7 +902,7 @@  static int64_t opal_imc_counters_stop(uint32_t type, uint64_t cpu_pir)
 		 * Core IMC hardware mandates setting of htm_mode in specific
 		 * scom ports (port_id are in htm_scom_index[])
 		 */
-		phys_core_id = cpu_get_core_index(c);
+		phys_core_id = pir_to_core_id(c->pir);
 		port_id = phys_core_id % 4;
 
 		if (proc_chip_quirks & QUIRK_MAMBO_CALLOUTS)