Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1617589

Re: [PATCH v6 03/11] powerpc/powernv: Detect supported IMC units and its events

From Stewart Smith <stewart@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v6 03/11] powerpc/powernv: Detect supported IMC units and its events
Date 2017-04-06 10:40 +0200
Message-ID <ttb7s-66T-3@gated-at.bofh.it> (permalink)
References <tsbCx-8d5-7@gated-at.bofh.it> <tsbCy-8d5-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Madhavan Srinivasan <maddy@linux.vnet.ibm.com> writes:
> --- a/arch/powerpc/platforms/powernv/opal-imc.c
> +++ b/arch/powerpc/platforms/powernv/opal-imc.c
> @@ -33,6 +33,388 @@
<snip>
> +static void imc_pmu_setup(struct device_node *parent)
> +{
> +	struct device_node *child;
> +	int pmu_count = 0, rc = 0;
> +	const struct property *pp;
> +
> +	if (!parent)
> +		return;
> +
> +	/* Setup all the IMC pmus */
> +	for_each_child_of_node(parent, child) {
> +		pp = of_get_property(child, "compatible", NULL);
> +		if (pp) {
> +			/*
> +			 * If there is a node with a "compatible" field,
> +			 * that's a PMU node
> +			 */
> +			rc = imc_pmu_create(child, pmu_count);
> +			if (rc)
> +				return;
> +			pmu_count++;
> +		}
> +	}
> +}

This doesn't strike me as the right kind of structure, the presence of a
compatible property really just says "hey, there's this device and it's
compatible with these ways of accessing it".

I'm guessing the idea behind having imc-nest-offset/size in a top level
node is because it's common to everything under it and the aim is to not
blow up the device tree to be enormous.

So why not go after each ibm,imc-counters-nest compatible node under the
top level ibm,opal-in-memory-counters node? (i'm not convinced that
having ibm,ibmc-counters-nest versus ibm,imc-counters-core and
ibm,imc-counters-thread as I see in the dts is correct though, as
they're all accessed exactly the same way?)

-- 
Stewart Smith
OPAL Architect, IBM.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v6 03/11] powerpc/powernv: Detect supported IMC units and its events Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2017-04-03 17:00 +0200
  Re: [PATCH v6 03/11] powerpc/powernv: Detect supported IMC units and its events Daniel Axtens <dja@axtens.net> - 2017-04-04 03:50 +0200
    Re: [PATCH v6 03/11] powerpc/powernv: Detect supported IMC units and  its events Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2017-04-05 14:40 +0200
  Re: [PATCH v6 03/11] powerpc/powernv: Detect supported IMC units and its events Stewart Smith <stewart@linux.vnet.ibm.com> - 2017-04-06 10:40 +0200
    Re: [PATCH v6 03/11] powerpc/powernv: Detect supported IMC units and  its events Anju T Sudhakar <anju@linux.vnet.ibm.com> - 2017-04-06 11:40 +0200

csiph-web