From: Suzuki K Poulose <Suzuki.Poulose@arm.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, robh@kernel.org,
will.deacon@arm.com, sudeep.holla@arm.com,
frowand.list@gmail.com, devicetree@vger.kernel.org,
Jonathan.Cameron@huawei.com, marc.zyngier@arm.com,
peterz@infradead.org, mathieu.poirier@linaro.org,
leo.yan@linaro.org
Subject: Re: [PATCH v8 8/8] perf: ARM DynamIQ Shared Unit PMU support
Date: Fri, 20 Oct 2017 11:17:41 +0100 [thread overview]
Message-ID: <b6fbfa75-a420-7cba-2f94-05317e72a9b3@arm.com> (raw)
In-Reply-To: <20171018092011.auey5hgpnjwkpsej@lakrids.cambridge.arm.com>
On 18/10/17 10:20, Mark Rutland wrote:
> Hi Suzuki,
>
> This generally looks good. My comments below are mostly minor, modulo
> the probing/hotplug bit at the end.
>
...
>> +static void dsu_pmu_probe_pmu(void *data)
>> +{
>> + struct dsu_pmu *dsu_pmu = data;
>> + u64 num_counters;
>> + u32 cpmceid[2];
>> +
>> + num_counters = (__dsu_pmu_read_pmcr() >> CLUSTERPMCR_N_SHIFT) &
>> + CLUSTERPMCR_N_MASK;
>> + /* We can only support upto 31 independent counters */
>
> s/upto/up to/
>
> Does the hardware spec allow for more than this?
No, the "counter" mask registers are 32bit wide, with Bit 31 reserved for the
Cycle counter.
>
>> + if (WARN_ON(num_counters > 31))
>> + num_counters = 31;
>> + dsu_pmu->num_counters = num_counters;
>> + if (!dsu_pmu->num_counters)
>> + return;
>> + cpmceid[0] = __dsu_pmu_read_pmceid(0);
>> + cpmceid[1] = __dsu_pmu_read_pmceid(1);
>> + bitmap_from_u32array(dsu_pmu->cpmceid_bitmap,
>> + DSU_PMU_MAX_COMMON_EVENTS,
>> + cpmceid,
>> + ARRAY_SIZE(cpmceid));
>> +}
>
> [...]
>
>> +
>> +static int dsu_pmu_device_probe(struct platform_device *pdev)
>> +{
>> + int irq, rc, cpu;
>> + struct dsu_pmu *dsu_pmu;
>> + char *name;
>> + static atomic_t pmu_idx = ATOMIC_INIT(-1);
>> +
>> + dsu_pmu = dsu_pmu_alloc(pdev);
>> + if (IS_ERR(dsu_pmu))
>> + return PTR_ERR(dsu_pmu);
>> +
>> + rc = dsu_pmu_dt_get_cpus(pdev->dev.of_node, &dsu_pmu->associated_cpus);
>> + if (rc) {
>> + dev_warn(&pdev->dev, "Failed to parse the CPUs\n");
>> + return rc;
>> + }
>> +
>> + rc = smp_call_function_any(&dsu_pmu->associated_cpus,
>> + dsu_pmu_probe_pmu,
>> + dsu_pmu, 1);
>
> Can we probe the relevant CPUs in the same was as the qcom l2 pmu, using
> notifiers?
>
> That way we'd work better with maxcpus=.
>
> We have to do this cross-call in the arm_pmu driver because we need the
> name at probe time, but that doesn't apply here. We should be able to
> lazily initialize the set of events and number of counters.
OK, I will make the necessary changes.
Thanks a lot for the review.
Cheers
Suzuki
prev parent reply other threads:[~2017-10-20 10:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-10 10:32 [PATCH v8 0/8] perf: Support for ARM DynamIQ Shared Unit Suzuki K Poulose
2017-10-10 10:32 ` [PATCH v8 1/8] perf: Export perf_event_update_userpage Suzuki K Poulose
2017-10-10 10:32 ` [PATCH v8 2/8] of: Add helper for mapping device node to logical CPU number Suzuki K Poulose
2017-10-10 10:32 ` [PATCH v8 3/8] coresight: of: Use of_cpu_node_to_id helper Suzuki K Poulose
2017-10-10 10:32 ` [PATCH v8 4/8] irqchip: gic-v3: " Suzuki K Poulose
2017-10-10 10:33 ` [PATCH v8 5/8] arm64: Use of_cpu_node_to_id helper for CPU topology parsing Suzuki K Poulose
2017-10-17 15:24 ` Mark Rutland
2017-10-17 16:11 ` Will Deacon
2017-10-17 16:20 ` Suzuki K Poulose
2017-10-17 16:42 ` Suzuki K Poulose
2017-10-10 10:33 ` [PATCH v8 6/8] arm_pmu: Use of_cpu_node_to_id helper Suzuki K Poulose
2017-10-17 15:26 ` Mark Rutland
2017-10-10 10:33 ` [PATCH v8 7/8] dt-bindings: Document devicetree binding for ARM DSU PMU Suzuki K Poulose
2017-10-18 9:20 ` Mark Rutland
2017-10-10 10:33 ` [PATCH v8 8/8] perf: ARM DynamIQ Shared Unit PMU support Suzuki K Poulose
2017-10-18 9:20 ` Mark Rutland
2017-10-20 10:17 ` Suzuki K Poulose [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b6fbfa75-a420-7cba-2f94-05317e72a9b3@arm.com \
--to=suzuki.poulose@arm.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=mark.rutland@arm.com \
--cc=mathieu.poirier@linaro.org \
--cc=peterz@infradead.org \
--cc=robh@kernel.org \
--cc=sudeep.holla@arm.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®