linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v8 8/9] arm64: pmu: Detect and enable multiple PMUs in an ACPI system
Date: Fri, 9 Sep 2016 18:26:09 +0100	[thread overview]
Message-ID: <20160909172609.GD11418@arm.com> (raw)
In-Reply-To: <1472507300-9844-9-git-send-email-jeremy.linton@arm.com>

On Mon, Aug 29, 2016 at 04:48:19PM -0500, Jeremy Linton wrote:
> +/* Count number and type of CPU cores in the system. */
> +static void __init arm_pmu_acpi_determine_cpu_types(struct list_head *pmus)
> +{
> +	int i;
> +	bool alloc_failure = false;
> +
> +	for_each_possible_cpu(i) {
> +		struct cpuinfo_arm64 *cinfo = per_cpu_ptr(&cpu_data, i);
> +		u32 partnum = MIDR_PARTNUM(cinfo->reg_midr);
> +		struct pmu_types *pmu;
> +
> +		list_for_each_entry(pmu, pmus, list) {
> +			if (pmu->cpu_type == partnum) {
> +				pmu->cpu_count++;
> +				break;
> +			}
> +		}
> +
> +		/* we didn't find the CPU type, add an entry to identify it */
> +		if ((&pmu->list == pmus) && (!alloc_failure)) {
> +			pmu = kzalloc(sizeof(struct pmu_types), GFP_KERNEL);
> +			if (!pmu) {
> +				pr_warn("Unable to allocate pmu_types\n");
> +				/*
> +				 * continue to count cpus for any pmu_types
> +				 * already allocated, but don't allocate any
> +				 * more pmu_types. This avoids undercounting.
> +				 */
> +				alloc_failure = true;

I thought we were ripping this out?

Will

  reply	other threads:[~2016-09-09 17:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29 21:48 [PATCH v8 0/9] Enable PMUs in ACPI systems Jeremy Linton
2016-08-29 21:48 ` [PATCH v8 1/9] arm64: pmu: add fallback probe table Jeremy Linton
2016-08-29 21:48 ` [PATCH v8 2/9] arm64: pmu: Probe default hw/cache counters Jeremy Linton
2016-08-29 21:48 ` [PATCH v8 3/9] arm64: pmu: Hoist pmu platform device name Jeremy Linton
2016-08-29 21:48 ` [PATCH v8 4/9] arm64: Rename the common MADT parse routine Jeremy Linton
2016-08-29 21:48 ` [PATCH v8 5/9] arm64: pmu: Cache PMU interrupt numbers from MADT parse Jeremy Linton
2016-08-29 21:48 ` [PATCH v8 6/9] arm: arm64: Add routine to determine cpuid of other cpus Jeremy Linton
2016-08-29 21:48 ` [PATCH v8 7/9] arm: arm64: pmu: Assign platform PMU CPU affinity Jeremy Linton
2016-08-29 21:48 ` [PATCH v8 8/9] arm64: pmu: Detect and enable multiple PMUs in an ACPI system Jeremy Linton
2016-09-09 17:26   ` Will Deacon [this message]
2016-08-29 21:48 ` [PATCH v8 9/9] MAINTAINERS: Tweak ARM PMU maintainers Jeremy Linton

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=20160909172609.GD11418@arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).