History log of /freebsd-10-stable/sys/x86/cpufreq/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
326638 06-Dec-2017 jkim

MFC: r267961, r309361, r322710, r323286, r326378, r326383, r326407

Sync. hwpstate with head.

r267961 (hselasky, partial):

Remove a redundant TUNABLE statement.

r309361 (danfe):

- Mention mismatching numbers in MSR vs. ACPI _PSS count warning.
- Rephrase unsupported AMD CPUs message and wrap as an overly long line.
- Improve readability when reporting resulted P-state transition (debug).

r322710, r323286 (cem):

- Add support for family 17h pstate info from MSRs.
- Yield CPU awaiting frequency change.

r326378, r326383, r326407:

- Fix some style(9) nits.
- Add a tunable "debug.hwpstate_verify" to check P-state after changing it
and turn it off by default.

309443 02-Dec-2016 jhb

MFC 308005: Add powerd(8) support for several families of AMD CPUs.

Use the same logic to calculate the nominal CPU frequency from the P-state
MSRs on family 0x12, 0x15, and 0x16 CPUs as is used for family 0x10.
Family 0x14 was included in the original patch in the PR but I left that
out as the BIOS writer's guide for family 0x14 CPUs show a different layout
for the relevant MSR and include a different formulate for calculating the
frequency.

While here, simplify a few expressions and print out the family of
unsupported CPUs in hex rather than decimal.

PR: 212020

305615 08-Sep-2016 pfg

MFC r303891, r303892:
sys: replace comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

260473 09-Jan-2014 mav

MFC r259197:
Do not DELAY() for P-state transition unless we want to see the result.

Intel manual says: "If a transition is already in progress, transition to
a new value will subsequently take effect. Reads of IA32_PERF_CTL determine
the last targeted operating point." So seems it should be fine to just
trigger wanted transition and go. Linux does the same.

258994 05-Dec-2013 sbruno

MFC r257769 to stable/10

Fix powerd/states on AMD cpus. Resolves issues with system reporting:
hwpstate0: set freq failed, err 6

Tested on FX-8150 and others.

PR: kern/167018
Submitted by: avg@
Approved by: re (gjb)

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


250487 10-May-2013 hiren

Adding a detach method to p4tcc driver.

PR: 118739
Submitted by: Dan Lukes <dan@obluda.cz> (earlier version)
Reviewed by: jhb
Approved by: sbruno (mentor)
MFC after: 1 week


241885 22-Oct-2012 eadler

This isn't functionally identical. In some cases a hint to disable
unit 0 would in fact disable all units.

This reverts r241856

Approved by: cperciva (implicit)


241856 22-Oct-2012 eadler

Now that device disabling is generic, remove extraneous code from the
device drivers that used to provide this feature.

Reviewed by: des
Approved by: cperciva
MFC after: 1 week


232199 26-Feb-2012 kan

Fix apparent logic reversal in setting the 'auto_mode' flag.

MFC after: 2 weeks


221102 27-Apr-2011 jkim

Use ACPI-supplied CPU frequencies instead of estimated ones as we are about
to use other values from the same table anyway.

MFC after: 3 days


220433 07-Apr-2011 jkim

Use atomic load & store for TSC frequency. It may be overkill for amd64 but
safer for i386 because it can be easily over 4 GHz now. More worse, it can
be easily changed by user with 'machdep.tsc_freq' tunable (directly) or
cpufreq(4) (indirectly). Note it is intentionally not used in performance
critical paths to avoid performance regression (but we should, in theory).
Alternatively, we may add "virtual TSC" with lower frequency if maximum
frequency overflows 32 bits (and ignore possible incoherency as we do now).


219046 25-Feb-2011 jkim

Set C1 "I/O then Halt" capability bit for Intel EIST. Some broken BIOSes
refuse to load external SSDTs if this bit is unset for _PDC. It seems Linux
and OpenSolaris did the same long ago.

MFC after: 1 week


215398 16-Nov-2010 avg

hwpstate: use CPU_FOREACH when binding to all available processors

Also, add a comment mentioning _PSD - on some systems it's enough to
put one logical CPU into a particular P-state to make other CPUs in
the same domain to enter that P-state.

Also, call sched_unbind() after the loop - sched_bind() automatically
rebinds from previous CPU to a new one, and the new arrangement of code
is safer against early loop exit.

Plus one minor style nit.

MFC after: 10 days


215131 11-Nov-2010 avg

make it possible to actually enable hwpstate_verbose

Either via the tunable or the sysctl.

MFC after: 3 days


212721 16-Sep-2010 mav

Few whitespace cleanups and comments tunings.

Submitted by: arundel


209339 19-Jun-2010 mav

Core i5, same as previously Core2Duo, found to not set P-state for single
core lower then set on other cores. Do not try to test P-states on attach
on SMP systems. It is hopeless now and will just pollute verbose logs.
If needed, check still can be forced via loader tunable.


204309 25-Feb-2010 attilio

Introduce the new kernel sub-tree x86 which should contain all the code
shared and generalized between our current amd64, i386 and pc98.

This is just an initial step that should lead to a more complete effort.
For the moment, a very simple porting of cpufreq modules, BIOS calls and
the whole MD specific ISA bus part is added to the sub-tree but ideally
a lot of code might be added and more shared support should grow.

Sponsored by: Sandvine Incorporated
Reviewed by: emaste, kib, jhb, imp
Discussed on: arch
MFC: 3 weeks


199273 14-Nov-2009 mav

Previous solution appeared to be unsufficient. After additional testing
I have found that it is not only desktop CPUs problem. but mobile also.
Probably AP on laptops just started initially at lower frequency, hiding
the problem.

Disable frequency validation by default, for systems with more then one CPU,
until we can implement it properly. It looks like making more harm now then
benefits. Add 'hw.est.strict' loader tunable to control it.

Now my iXsystems Invincibook is able to run at 800MHz lowest frequency,
instead of 1200MHz before, when 800MHz was incorrectly reported invalid.


199269 14-Nov-2009 mav

Retry only once, if BIOS is completely broken and gives zero freqs.


199268 14-Nov-2009 mav

Desktop Core2Duo/Core2Quad CPUs are unable to control frequency of single
CPU core, only pair of them. As result, both cores are running on highest
one of requested frequencies, and that is reported by status register.
Such behavior confuses frequency validation logic, as it runs on only
one core, as SMP is not yet launched, making EIST completely unusable.

To workaround this, add check for validation result. If we haven't found
at least two usable frequencies, then probably we are looking bad and have
to trust data provided by BIOS as-is.


197070 10-Sep-2009 jkim

Consolidate CPUID to CPU family/model macros for amd64 and i386 to reduce
unnecessary #ifdef's for shared code between them.


193530 05-Jun-2009 jkim

Import ACPICA 20090521.


192029 12-May-2009 brueffer

Remove unused variables.

Found with: Coverity Prevent(tm)
CID: 4285, 4286


190521 29-Mar-2009 mr

Extend comment in copyright notice as requested by author.

Submitted by: G.Otsuji


190501 28-Mar-2009 mr

Add support for Phenom (Family 10h) to cpufreq.
Its a newer version provided by the author than in the PR.

PR: kern/128575
Submitted by: Gen Otsuji annona2 [at] gmail.com


187597 22-Jan-2009 jkim

Include a missing header file.

Reported by: thompsa, "build universe"


187594 22-Jan-2009 jkim

Replace couple of strcmp(cpu_vendor, "foo") with cpu_vendor_id for i386
and hide i386-specific code under #ifdef.


186797 05-Jan-2009 jkim

Add Centaur/IDT/VIA vendor ID for Nano family, which has long mode support.


185349 26-Nov-2008 jkim

Remove an unused variable.

Found with: Coverity Prevent(tm)
CID: 3677


185341 26-Nov-2008 jkim

Introduce cpu_vendor_id and replace a lot of strcmp(cpu_vendor, "...").

Reviewed by: jhb, peter (early amd64 version)


185331 26-Nov-2008 sobomax

Add Pentium D cores into the list that can't handle 12.5% and 25%
throttle. My SMP kernel hangs when one of those is selected by
powerd. Errata AA21 here:

ftp://download.intel.com/design/PentiumXE/specupdt/31030717.pdf

MFC after: 2 weeks


184104 21-Oct-2008 jkim

Do not use PowerNow! if FID or VID is missing.


184103 21-Oct-2008 jkim

Use power management information for AMD CPUs from identcpu.c.


182908 10-Sep-2008 jhb

Add a proper detach method to the est(4) driver using cpufreq_unregister().

MFC after: 1 week


182401 28-Aug-2008 jhb

Fail detach if cpufreq_unregister() fails.

MFC after: 1 week


182201 26-Aug-2008 jhb

Disable the code to generate a simple table from the status MSR by default.
This can be enabled by setting the 'hw.est.msr_info' tunable to 1.


182048 23-Aug-2008 jhb

If we are unable to obtain a frequency list from either ACPI or the static
tables, then attempt to build a simple list containing just the high and
low frequencies based on the current CPU frequency calculated during boot
and the contents of the MSR.

MFC after: 1 month


181691 13-Aug-2008 jhb

Attach the cpufreq child devices with specific orders to enforce relative
priority of some of the drivers that manage the same state (e.g. ichss0
vs est0). Specifically, powernow, est, and p4tcc are added at order 10,
ichss at order 20, and smist at order 30. Previously, some laptops were
seeing both ichss0 and est0 attaching and stomping on each other.

XXX: This isn't quite ideal, but works with the existing hacks, I think
what we really want instead is a single "speedstep0" device for CPUs
that the ichss, est, and smist drivers probe (but with differing
priorities).

MFC after: 1 week


179445 30-May-2008 jhb

After probing the available frequency settings, restore the CPU to run at
whatever frequency it started at instead of always picking the highest
frequency. The first version of this driver attempted to do this, but it
set the speed to the first frequency in the list rather than the value it
had saved.

MFC after: 1 week
Discussed with: rpaulo, phk


178719 02-May-2008 rpaulo

Remove unused variable saved_id16.

Pointy hat to: me
Pointed out by: jhb
MFC after: 1 week


177297 17-Mar-2008 phk

A cautionary XXX comment about seemingly bogus errata checks.


177296 17-Mar-2008 phk

Increase time we wait for things to settle to 1 millisecond,
10 microseconds is too short.

Always set the cpu to the highest frequency so that we get through
boot and don't handicap cpus where powerd(8) is not used.


177295 17-Mar-2008 phk

Revert last commit and stop committing before morning tea.


177294 17-Mar-2008 phk

Increase time we wait for things to settle to 1 millisecond,
10 microseconds is too short.

Always set the cpu to the highest frequency so that we get through
boot and don't handicap cpus where powerd(8) is not used.


177287 17-Mar-2008 phk

Use correct bitmask for identifying chip family.


177040 10-Mar-2008 jhb

- Don't execute cpuid to fetch the features. We already have the features
present in cpu_feature2. Also, use CPUID2_EST rather than a magic
number.
- Don't free the ACPI settings list in detach if we are going to fail the
request. Otherwise an attempt to kldunload est would free the array
but the driver would keep trying to use it.

MFC after: 1 week


176714 01-Mar-2008 gibbs

In est_acpi_info(), initialize count before passing its pointer to
CPUFREQ_DRV_SETTINGS(). The value of count on input is used to
prefent overflow of the settings buffer passed into CPUFREQ_DRV_SETTINGS().

This corrects the "est: CPU supports Enhanced Speedstep, but is not recognized."
error on my system.

MFC after: 1 week


176649 28-Feb-2008 rpaulo

Validate the id16 values gathered from ACPI (previously a TODO item).
Style changes by me and njl.

Approved by: njl (mentor)
Reviewed by: njl (mentor)
Submitted by: Takeharu KATO <takeharu1219 at ybb.ne.jp>
PR: 119350
MFC after: 1 week


170874 17-Jun-2007 njl

Use bus_dma to get a page in the first 4 GB. Since the physical address
of the magic string is passed in a 32-bit register, we can't use high
memory in the PAE case. This also eliminates a use of vtophys().

Tested by: Jeff Shimbo <jts767 / gmail.com>
MFC after: 1 week


166197 23-Jan-2007 bruno

o introduce a flags 'errata' for HW bugs onto the softc.
o remove errata_a0 and introduce the corresponding flags into 'errata'.
o introduce a new errata for K8, namely some platform might set the
PENDING_BIT but aren't able to unset it, also don't loop forever
waiting PENDING_BIT being cleared.
o try to introduce a workaround for the PENDING_BIT stuck problem,
o support now half multipliers for K8.

Tested by: Abdullah Al-Marrie

Approved by: njl


158651 16-May-2006 phk

Since DELAY() was moved, most <machine/clock.h> #includes have been
unnecessary.


158446 11-May-2006 njl

Add support for the VIA C7-M processor family.

Remove an unnecessary check of the table's bus clock. CPUs that
support this feature export only the high/low settings via the MSR,
packed into 32 bits.

Hardware from: Centaur Technologies
MFC after: 1 week


155996 25-Feb-2006 cperciva

Add frequency-voltage tables for Intel 778, 758, 773, 753, and 733J
processors.

Obtained from: Intel Datasheet 302189-008


151593 23-Oct-2005 njl

Like acpi_throttle, set frequency to 100% in attach. Some BIOSen may set
this value lower, making the system quite slow after booting.


148583 31-Jul-2005 cperciva

Print cpu_vendor and the MSR value if we don't support this processor
even though we're not asking people to contact us.

Requested by: njl


148578 31-Jul-2005 cperciva

Remove the instruction to "contact the maintainer" for unrecognized
CPUs. Intel refuses to give me the information I need, and getting
more emails about this doesn't help.


145287 19-Apr-2005 njl

Add a driver for SMI-based SpeedStep. The hardware supports two frequency
settings and is an older version of the same design used for ICH SpeedStep.
It is only known to be available on PIIX4 chipsets.

Many thanks to Bruno Ducrot for writing the driver and Jon Noack for
testing.

Submitted by: Bruno Ducrot


144881 10-Apr-2005 njl

Properly terminate the table generated from ACPI info. The cpufreq
settings are length-counted while the EST table is null-terminated.
This fixes extra garbage states being reported with ACPI probing.


144877 10-Apr-2005 njl

Advertise p4tcc via acpi_get_features() _PDC support.


144630 04-Apr-2005 njl

Add support for _PDC/_OSC by advertising that we support direct access to
the PERF_CTL/STS MSRs via the new acpi_get_features() method. This should
allow newer systems to use SpeedStep.


144380 31-Mar-2005 njl

Remove check of numpst to allow more K8 variants to attach. The other
checks, including cpuid_is_k7(), will catch CPUs that really don't support
this method.

Submitted by: Bruno Ducrot
Tested by: Jari Kirma (kirma cs.hut.fi)


144194 27-Mar-2005 njl

Add the powernow driver, which handles AMD Mobile Athlon PowerNow! (k7)
and AMD Cool&Quiet PowerNow! (k8) cpufreq control. This driver is enabled
for both i386 and amd64 architectures. It has both acpi and legacy BIOS
attachments. Thanks to Bruno Ducrot for writing this driver and Jung-uk
Kim for testing.

Submitted by: Bruno Ducrot (ducrot:poupinou.org)


143902 21-Mar-2005 njl

Add support for probing EST settings from ACPI. This should handle more
modern CPUs that have multiple VID#s that aren't detectable via public
methods. We use the control value from acpi_perf as the id16 for setting
a given frequency.


142625 27-Feb-2005 njl

Make a pass through all drivers checking specs for desired behavior on
SMP systems. It appears all drivers except ichss should attach to each
CPU and that settings should be performed on each CPU. Add comments about
this. Also, add a guard for p4tcc's identify method being called more than
once.


142394 24-Feb-2005 njl

Correct an off-by-one error in the number of settings est announces.
The extraneous "0" state was not fatal but useless.


142308 23-Feb-2005 njl

Import a rewrite of p4tcc for the cpufreq(4) framework. This includes
a bugfix of clearing the On-Demand flag when going back to 100%. It
has been tested and works on an IBM R32. Note original work done by
Ted Unangst and sobomax@.


142203 22-Feb-2005 njl

Support disabling individual cpufreq drivers with hints, e.g.,
hint.ichss.0.disabled="1"


142140 20-Feb-2005 njl

Add the Enhanced SpeedStep driver (EST). Currently, this driver only works
on the previous generation of Pentium-M processors (Banias). Support for
Dothan and later processors involves working with acpi_perf(4) to extract
information about supported states. This driver should work on MP systems
including HTT. It is experimental and may have a few bugs but has been
tested to not crash at least.

Thanks to Colin Percival for his initial work on this driver.


141455 07-Feb-2005 sobomax

Fix the problem with incorrect throttling level reported immediately after
reboot. Safter the reboot the TCC is usually in the Automatic mode, in which
reading current performance level is likely to produce bogus results make sure
to switch it to the On-Demand mode and set to some known performance level.
Unfortunately there is no reliable way to check that TCC is in the Automatic
mode. Reading bit 4 of ACPI Thermal Monitor Control Register produces 0
regardless of the current mode.

MFC after: 1 week


139724 05-Jan-2005 imp

Start all license/copyright notice comments with /*-, per tradition


134200 23-Aug-2004 sobomax

o Fix whitespace bug introduced in the previous commit.

Submitted by: ru

o Simplify p4tcc_power_profile().

Submitted by: maxim


134199 23-Aug-2004 sobomax

o Extend boot output: print out mimimum/maximum performance value and number
of performance steps available;

o similarly to Enhanced SpeedStep driver, export list of all available steps
via hw.p4tcc.cpuperf_levels sysctl.


126412 29-Feb-2004 maxim

o Typo: Ternal -> Thermal.


124930 24-Jan-2004 sobomax

- Move performance-controlling sysctls into hw.p4tcc.* tree;

Suggested by: nate

- get rid of "magick" values in code and make sysctl's reflecting reality
on processor versions which have one or another frequency "forbidden"
due to errata.

MFC after: 2 weeks


124684 18-Jan-2004 sobomax

Add new CPU_ENABLE_TCC option, from NOTES:

CPU_ENABLE_TCC enables Thermal Control Circuitry (TCC) found in some
Pentium(tm) 4 and (possibly) later CPUs. When enabled and detected,
TCC allows to restrict power consumption by using machdep.cpuperf*
sysctls. This operates independently of SpeedStep and is useful on
systems where other mechanisms such as apm(4) or acpi(4) don't work.

Given the fact that many, even modern, notebooks don't work properly
with Intel ACPI, this is indeed very useful option for notebook owners.

Obtained from: OpenBSD
MFC after: 2 weeks