Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Dec 2019 22:26:56 +0000 (UTC)
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355361 - head/sys/dev/cpufreq
Message-ID:  <201912032226.xB3MQuNX092522@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: manu
Date: Tue Dec  3 22:26:55 2019
New Revision: 355361
URL: https://svnweb.freebsd.org/changeset/base/355361

Log:
  cpufreq_dt: Do not fetch again hw.ncpu
  
  MD code already set the global variable mp_ncpus according to
  the tunable hw.ncpu so use the global variable directly.
  
  Reported by:	ian

Modified:
  head/sys/dev/cpufreq/cpufreq_dt.c

Modified: head/sys/dev/cpufreq/cpufreq_dt.c
==============================================================================
--- head/sys/dev/cpufreq/cpufreq_dt.c	Tue Dec  3 22:08:54 2019	(r355360)
+++ head/sys/dev/cpufreq/cpufreq_dt.c	Tue Dec  3 22:26:55 2019	(r355361)
@@ -446,7 +446,7 @@ cpufreq_dt_attach(device_t dev)
 	struct cpufreq_dt_softc *sc;
 	phandle_t node;
 	phandle_t cnode, opp, copp;
-	int cpu, ncpu;
+	int cpu;
 	uint64_t freq;
 	int rv = 0;
 	enum opp_version version;
@@ -456,11 +456,9 @@ cpufreq_dt_attach(device_t dev)
 	node = ofw_bus_get_node(device_get_parent(dev));
 	cpu = device_get_unit(device_get_parent(dev));
 
-	if (TUNABLE_INT_FETCH("hw.ncpu", &ncpu)) {
-		if (cpu >= ncpu) {
-			device_printf(dev, "Not attaching as cpu is not present\n");
-			return (ENXIO);
-		}
+	if (cpu >= mp_ncpus) {
+		device_printf(dev, "Not attaching as cpu is not present\n");
+		return (ENXIO);
 	}
 
 	if (regulator_get_by_ofw_property(dev, node,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912032226.xB3MQuNX092522>