Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/fdt It is more appropriate to use clk_get_rate() rat...



details:   https://anonhg.NetBSD.org/src/rev/de2285431d61
branches:  trunk
changeset: 959697:de2285431d61
user:      ryo <ryo%NetBSD.org@localhost>
date:      Mon Feb 22 06:21:35 2021 +0000

description:
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.

diffstat:

 sys/dev/fdt/cpufreq_dt.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 49d68c150eba -r de2285431d61 sys/dev/fdt/cpufreq_dt.c
--- a/sys/dev/fdt/cpufreq_dt.c  Mon Feb 22 05:23:36 2021 +0000
+++ b/sys/dev/fdt/cpufreq_dt.c  Mon Feb 22 06:21:35 2021 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
        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



Home | Main Index | Thread Index | Old Index