From owner-svn-src-stable@freebsd.org Fri Jun 19 19:33:19 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C68753376AD; Fri, 19 Jun 2020 19:33:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pTVl4dxqz3TkR; Fri, 19 Jun 2020 19:33:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A7882050B; Fri, 19 Jun 2020 19:33:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JJXJiw006797; Fri, 19 Jun 2020 19:33:19 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JJXJkj006796; Fri, 19 Jun 2020 19:33:19 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191933.05JJXJkj006796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 19:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362417 - stable/12/sys/dev/cpufreq X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/dev/cpufreq X-SVN-Commit-Revision: 362417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 19:33:19 -0000 Author: manu Date: Fri Jun 19 19:33:19 2020 New Revision: 362417 URL: https://svnweb.freebsd.org/changeset/base/362417 Log: MFC r361964: coufreq_dt: Rename DEBUG to DPRINTF DEBUG is a kernel configuration flag and if used cpufreq_dt.c will fail the build of kernel. PR: 246867 Submitted by: Oskar Holmund (oskar.holmlund@ohdata.se) Differential Revision: https://reviews.freebsd.org/D25080 Modified: stable/12/sys/dev/cpufreq/cpufreq_dt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cpufreq/cpufreq_dt.c ============================================================================== --- stable/12/sys/dev/cpufreq/cpufreq_dt.c Fri Jun 19 19:33:06 2020 (r362416) +++ stable/12/sys/dev/cpufreq/cpufreq_dt.c Fri Jun 19 19:33:19 2020 (r362417) @@ -53,9 +53,9 @@ __FBSDID("$FreeBSD$"); #include "cpufreq_if.h" #if 0 -#define DEBUG(dev, msg...) device_printf(dev, "cpufreq_dt: " msg); +#define DPRINTF(dev, msg...) device_printf(dev, "cpufreq_dt: " msg); #else -#define DEBUG(dev, msg...) +#define DPRINTF(dev, msg...) #endif enum opp_version { @@ -111,12 +111,12 @@ cpufreq_dt_find_opp(device_t dev, uint64_t freq) sc = device_get_softc(dev); - DEBUG(dev, "Looking for freq %ju\n", freq); + DPRINTF(dev, "Looking for freq %ju\n", freq); for (n = 0; n < sc->nopp; n++) if (CPUFREQ_CMP(sc->opp[n].freq, freq)) return (&sc->opp[n]); - DEBUG(dev, "Couldn't find one\n"); + DPRINTF(dev, "Couldn't find one\n"); return (NULL); } @@ -145,7 +145,7 @@ cpufreq_dt_get(device_t dev, struct cf_setting *set) sc = device_get_softc(dev); - DEBUG(dev, "cpufreq_dt_get\n"); + DPRINTF(dev, "cpufreq_dt_get\n"); if (clk_get_freq(sc->clk, &freq) != 0) return (ENXIO); @@ -157,7 +157,7 @@ cpufreq_dt_get(device_t dev, struct cf_setting *set) cpufreq_dt_opp_to_setting(dev, opp, set); - DEBUG(dev, "Current freq %dMhz\n", set->freq); + DPRINTF(dev, "Current freq %dMhz\n", set->freq); return (0); } @@ -171,10 +171,10 @@ cpufreq_dt_set(device_t dev, const struct cf_setting * sc = device_get_softc(dev); - DEBUG(dev, "Working on cpu %d\n", sc->cpu); - DEBUG(dev, "We have %d cpu on this dev\n", CPU_COUNT(&sc->cpus)); + DPRINTF(dev, "Working on cpu %d\n", sc->cpu); + DPRINTF(dev, "We have %d cpu on this dev\n", CPU_COUNT(&sc->cpus)); if (!CPU_ISSET(sc->cpu, &sc->cpus)) { - DEBUG(dev, "Not for this CPU\n"); + DPRINTF(dev, "Not for this CPU\n"); return (0); } @@ -206,26 +206,26 @@ cpufreq_dt_set(device_t dev, const struct cf_setting * device_printf(dev, "Couldn't find an opp for this freq\n"); return (EINVAL); } - DEBUG(sc->dev, "Current freq %ju, uvolt: %d\n", freq, uvolt); - DEBUG(sc->dev, "Target freq %ju, , uvolt: %d\n", + DPRINTF(sc->dev, "Current freq %ju, uvolt: %d\n", freq, uvolt); + DPRINTF(sc->dev, "Target freq %ju, , uvolt: %d\n", opp->freq, opp->uvolt_target); if (uvolt < opp->uvolt_target) { - DEBUG(dev, "Changing regulator from %u to %u\n", + DPRINTF(dev, "Changing regulator from %u to %u\n", uvolt, opp->uvolt_target); error = regulator_set_voltage(sc->reg, opp->uvolt_min, opp->uvolt_max); if (error != 0) { - DEBUG(dev, "Failed, backout\n"); + DPRINTF(dev, "Failed, backout\n"); return (ENXIO); } } - DEBUG(dev, "Setting clk to %ju\n", opp->freq); + DPRINTF(dev, "Setting clk to %ju\n", opp->freq); error = clk_set_freq(sc->clk, opp->freq, CLK_SET_ROUND_DOWN); if (error != 0) { - DEBUG(dev, "Failed, backout\n"); + DPRINTF(dev, "Failed, backout\n"); /* Restore previous voltage (best effort) */ error = regulator_set_voltage(sc->reg, copp->uvolt_min, @@ -234,13 +234,13 @@ cpufreq_dt_set(device_t dev, const struct cf_setting * } if (uvolt > opp->uvolt_target) { - DEBUG(dev, "Changing regulator from %u to %u\n", + DPRINTF(dev, "Changing regulator from %u to %u\n", uvolt, opp->uvolt_target); error = regulator_set_voltage(sc->reg, opp->uvolt_min, opp->uvolt_max); if (error != 0) { - DEBUG(dev, "Failed to switch regulator to %d\n", + DPRINTF(dev, "Failed to switch regulator to %d\n", opp->uvolt_target); /* Restore previous CPU frequency (best effort) */ (void)clk_set_freq(sc->clk, copp->freq, 0); @@ -271,7 +271,7 @@ cpufreq_dt_settings(device_t dev, struct cf_setting *s struct cpufreq_dt_softc *sc; ssize_t n; - DEBUG(dev, "cpufreq_dt_settings\n"); + DPRINTF(dev, "cpufreq_dt_settings\n"); if (sets == NULL || count == NULL) return (EINVAL); @@ -465,7 +465,7 @@ cpufreq_dt_attach(device_t dev) node = ofw_bus_get_node(device_get_parent(dev)); sc->cpu = device_get_unit(device_get_parent(dev)); - DEBUG(dev, "cpu=%d\n", sc->cpu); + DPRINTF(dev, "cpu=%d\n", sc->cpu); if (sc->cpu >= mp_ncpus) { device_printf(dev, "Not attaching as cpu is not present\n"); return (ENXIO); @@ -519,12 +519,12 @@ cpufreq_dt_attach(device_t dev) if (strcmp(device_type, "cpu") != 0) continue; if (cpu == sc->cpu) { - DEBUG(dev, "Skipping our cpu\n"); + DPRINTF(dev, "Skipping our cpu\n"); CPU_SET(cpu, &sc->cpus); cpu++; continue; } - DEBUG(dev, "Testing CPU %d\n", cpu); + DPRINTF(dev, "Testing CPU %d\n", cpu); copp = -1; if (version == OPP_V1) OF_getencprop(cnode, "operating-points", &copp, @@ -533,7 +533,8 @@ cpufreq_dt_attach(device_t dev) OF_getencprop(cnode, "operating-points-v2", &copp, sizeof(copp)); if (opp == copp) { - DEBUG(dev, "CPU %d is using the same opp as this one (%d)\n", cpu, sc->cpu); + DPRINTF(dev, "CPU %d is using the same opp as this one (%d)\n", + cpu, sc->cpu); CPU_SET(cpu, &sc->cpus); } cpu++;