Module Name:    src
Committed By:   ryo
Date:           Mon Feb 22 06:21:35 UTC 2021

Modified Files:
        src/sys/dev/fdt: cpufreq_dt.c

Log Message:
It is more appropriate to use clk_get_rate() rather than sc->sc_freq_target * 
1000000.
ci_data.cpu_cc_freq should be set to a higher precision value.

In addition, when cpufreq_dt_init(), or while throttling, sc->sc_freq_target 
should not
be referenced by cpufreq_dt_change_cb() because it does not have the correct 
value.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/fdt/cpufreq_dt.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/dev/fdt/cpufreq_dt.c
diff -u src/sys/dev/fdt/cpufreq_dt.c:1.18 src/sys/dev/fdt/cpufreq_dt.c:1.19
--- src/sys/dev/fdt/cpufreq_dt.c:1.18	Wed Jan 27 03:10:21 2021
+++ src/sys/dev/fdt/cpufreq_dt.c	Mon Feb 22 06:21:35 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cpufreq_dt.c,v 1.18 2021/01/27 03:10:21 thorpej Exp $ */
+/* $NetBSD: cpufreq_dt.c,v 1.19 2021/02/22 06:21:35 ryo Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill <jmcne...@invisible.ca>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpufreq_dt.c,v 1.18 2021/01/27 03:10:21 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufreq_dt.c,v 1.19 2021/02/22 06:21:35 ryo Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -86,7 +86,7 @@ cpufreq_dt_change_cb(void *arg1, void *a
 	struct cpufreq_dt_softc * const sc = arg1;
 	struct cpu_info *ci = curcpu();
 
-	ci->ci_data.cpu_cc_freq = sc->sc_freq_target * 1000000;
+	ci->ci_data.cpu_cc_freq = clk_get_rate(sc->sc_clk);
 }
 
 static int

Reply via email to