[Skiboot] [PATCH v9 10/11] skiboot: Add core IMC related counter configuration OPAL call
Michael Ellerman
mpe at ellerman.id.au
Wed May 3 15:55:06 AEST 2017
Anju T Sudhakar <anju at linux.vnet.ibm.com> writes:
> diff --git a/hw/imc.c b/hw/imc.c
> index 6a1982e..f21945d 100644
> --- a/hw/imc.c
> +++ b/hw/imc.c
> @@ -295,25 +315,84 @@ err:
> }
>
> /*
> - * opal_imc_counters_init : This call initialize the IMC engine.
> - *
> + * opal_imc_counters_init : This call initializes core IMC Engine for the
> + * current core, by initializing the pdbars, htm_mode,
> + * and the event_mask. "addr" must be non-zero for this
> + * operation.
> * This call is not being used in case of NEST IMC.
> - * Additional arguments will be added to this call in the following patch.
> */
> -static int64_t opal_imc_counters_init(uint32_t type)
> +static int64_t opal_imc_counters_init(uint32_t type, uint64_t addr)
> {
> - if (type == OPAL_IMC_COUNTERS_NEST)
> + struct proc_chip *chip;
> + int core_id, phys_core_id, ret = OPAL_PARAMETER;
> +
> + switch (type) {
> + case OPAL_IMC_COUNTERS_NEST:
> prerror("IMC: unknown operation for nest imc\n");
> - return OPAL_PARAMETER;
> + return ret;
It shouldn't be an error to call INIT for NEST counters, it should just
do nothing and return OPAL_SUCCESS.
Making it an error means Linux needs to know that it shouldn't call INIT
for NEST counters, which is ugly.
Also if we ever do need to initialise something for NEST counters, old
kernels won't be calling INIT, so they will need to be updated before
they can work. Whereas if it's a nop to begin with then old kernels will
already call it, and new skiboot can add any initialisation it needs in
future.
cheers
More information about the Skiboot
mailing list