Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 01 Dec 2018 17:09:39 +0000
From:      bugzilla-noreply@freebsd.org
To:        powerpc@FreeBSD.org
Subject:   [Bug 233693] [PowerPC64] Powerd unable to change cpu frequency
Message-ID:  <bug-233693-25139-wmXtORjlhT@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-233693-25139@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233693

--- Comment #4 from Conrad Meyer <cem@freebsd.org> ---
Wait, aren't we indicing pstate_ids twice?   Is the right fix something like
this:

--- a/sys/powerpc/cpufreq/pmcr.c
+++ b/sys/powerpc/cpufreq/pmcr.c
@@ -189,13 +189,13 @@ pmcr_set(device_t dev, const struct cf_setting *set)
        if (set == NULL)
                return (EINVAL);

-       if (set->spec[0] < 0 || set->spec[0] > npstates)
+#if 0
+       if (set->spec[0] < 0 || set->spec[0] >= npstates)
                return (EINVAL);
+#endif

-       pmcr = ((long)pstate_ids[set->spec[0]] << PMCR_LOWERPS_SHIFT) &
-           PMCR_LOWERPS_MASK;
-       pmcr |= ((long)pstate_ids[set->spec[0]] << PMCR_UPPERPS_SHIFT) &
-           PMCR_UPPERPS_MASK;
+       pmcr = ((long)set->spec[0] << PMCR_LOWERPS_SHIFT) & PMCR_LOWERPS_MASK;
+       pmcr |= ((long)set->spec[0] << PMCR_UPPERPS_SHIFT) & PMCR_UPPERPS_MASK;


Given that spec[0] was assigned:

  176                 sets[i].spec[0] = pstate_ids[i];

in pmcr_settings?

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-233693-25139-wmXtORjlhT>