Module Name:    src
Committed By:   ryo
Date:           Fri Aug 24 21:56:13 UTC 2018

Modified Files:
        src/sys/arch/arm/fdt: psci_fdt.c

Log Message:
/cpus node may have any nodes except cpu. count only nodes of device_type "cpu"


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/fdt/psci_fdt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/fdt/psci_fdt.c
diff -u src/sys/arch/arm/fdt/psci_fdt.c:1.13 src/sys/arch/arm/fdt/psci_fdt.c:1.14
--- src/sys/arch/arm/fdt/psci_fdt.c:1.13	Mon Aug 13 12:28:02 2018
+++ src/sys/arch/arm/fdt/psci_fdt.c	Fri Aug 24 21:56:13 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: psci_fdt.c,v 1.13 2018/08/13 12:28:02 skrll Exp $ */
+/* $NetBSD: psci_fdt.c,v 1.14 2018/08/24 21:56:13 ryo Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcne...@invisible.ca>
@@ -29,7 +29,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.13 2018/08/13 12:28:02 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.14 2018/08/24 21:56:13 ryo Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -175,6 +175,7 @@ psci_fdt_bootstrap(void)
 	extern void cortex_mpstart(void);
 	uint64_t mpidr, bp_mpidr;
 	int child;
+	const char *devtype;
 
 	const int cpus = OF_finddevice("/cpus");
 	if (cpus == -1) {
@@ -186,7 +187,9 @@ psci_fdt_bootstrap(void)
 	/* Count CPUs */
 	arm_cpu_max = 0;
 	for (child = OF_child(cpus); child; child = OF_peer(child))
-		if (fdtbus_status_okay(child))
+		if (fdtbus_status_okay(child) && ((devtype =
+		    fdtbus_get_string(child, "device_type")) != NULL) &&
+		    (strcmp(devtype, "cpu") == 0))
 			arm_cpu_max++;
 
 	if (psci_fdt_preinit() != 0)

Reply via email to