Thread (11 messages) 11 messages, 2 authors, 2016-09-09

[PATCH v8 8/9] arm64: pmu: Detect and enable multiple PMUs in an ACPI system

DORMANTno replies

From: Will Deacon <hidden>
Date: 2016-09-09 17:26:09
Also in: linux-acpi

On Mon, Aug 29, 2016 at 04:48:19PM -0500, Jeremy Linton wrote:
quoted hunk ↗ jump to hunk
+/* 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help