History log of /freebsd-10.0-release/sys/dev/acpica/acpi_thermal.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

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

# 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


# 255077 30-Aug-2013 dumbbell

acpi_thermal: Warn about insane _TMP temperature only once

A warning is emitted again if the temperature became briefly valid
meanwhile. This avoids spamming the user when the sensor is broken.

Other values (ie. not _TMP) always raise a warning.


# 246128 30-Jan-2013 sbz

Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on device_method_t arrays

Reviewed by: cognet
Approved by: cognet


# 245266 10-Jan-2013 mav

Remove not very useful printf, that can be too chatty.

ASUS P8Z77-V board reports _AC2, _AC3 and _AC4 setpoints as 0C. With active
cooling already automatically set to _AC2, that still caused driver to print
two useless lines about temperature above _AC3 and _AC4 every ten seconds.
Three setponts of 0C is probably a board bug, but the same spam could happen
also in correct case if system is runnign not with the lowest cooling level.


# 241538 14-Oct-2012 avg

acpi_thermal: when _ACx is tripped, all _ALi i>= x should be on

... and not just _ALx as it is now.

MFC after: 20 days


# 227642 17-Nov-2011 eadler

- be more precise about the unit of measurement

Approved by: jhb
MFC after: 3 days


# 227626 17-Nov-2011 eadler

- be more precise about the unit of measurement

Submitted by: Oliver Pinter <oliver.pntr@gmail.com>
Approved by: jhb
MFC after: 3 days


# 223624 28-Jun-2011 kevlo

Remove duplicate header includes


# 220871 19-Apr-2011 mdf

Correctly output the entire array for hw.acpi.thermal._ACx.

Reported by: Taku YAMAMOTO < taku AT tackymt DOT homeip DOT net >
Tested by: Nick Ulen < uncle AT wolfman DOT devio DOT us >


# 220798 18-Apr-2011 mdf

Fix a few acpi sysctls that want "IK" formatting to specify CTLTYPE_INT.
This got broken after r217586.

Pointy hat: to me
Tested by: David Wolfskill < davit AT catwhisker DOT org >


# 209062 11-Jun-2010 avg

fix a few cases where a string is passed via format argument instead of
via %s

Most of the cases looked harmless, but this is done for the sake of
correctness. In one case it even allowed to drop an intermediate buffer.

Found by: clang
MFC after: 2 week


# 196403 20-Aug-2009 jhb

Temporarily revert the new-bus locking for 8.0 release. It will be
reintroduced after HEAD is reopened for commits by re@.

Approved by: re (kib), attilio


# 196037 02-Aug-2009 attilio

Make the newbus subsystem Giant free by adding the new newbus sxlock.
The newbus lock is responsible for protecting newbus internIal structures,
device states and devclass flags. It is necessary to hold it when all
such datas are accessed. For the other operations, softc locking should
ensure enough protection to avoid races.

Newbus lock is automatically held when virtual operations on the device
and bus are invoked when loading the driver or when the suspend/resume
take place. For other 'spourious' operations trying to access/modify
the newbus topology, newbus lock needs to be automatically acquired and
dropped.

For the moment Giant is also acquired in some key point (modules subsystem)
in order to avoid problems before the 8.0 release as module handlers could
make assumptions about it. This Giant locking should go just after
the release happens.

Please keep in mind that the public interface can be expanded in order
to provide more support, if there are really necessities at some point
and also some bugs could arise as long as the patch needs a bit of
further testing.

Bump __FreeBSD_version in order to reflect the newbus lock introduction.

Reviewed by: ed, hps, jhb, imp, mav, scottl
No answer by: ariff, thompsa, yongari
Tested by: pho,
G. Trematerra <giovanni dot trematerra at gmail dot com>,
Brandon Gooch <jamesbrandongooch at gmail dot com>
Sponsored by: Yahoo! Incorporated
Approved by: re (ksmith)


# 193530 05-Jun-2009 jkim

Import ACPICA 20090521.


# 178506 25-Apr-2008 rpaulo

Initialize tz_active to a new constant TZ_ACTIVE_UNKNOWN and make no
assumptions about the state of the cooling devices. Instead, switch them
off on init and, only after that, we are in TZ_ACTIVE_NONE.

Submited by: Andriy Gapon <avg at icyb.net.ua>
Reviewed by: njl


# 176329 16-Feb-2008 ume

Create a thread to handle passive cooling for 1st zone which has _PSV,
_TSP, _TC1 and _TC2.

Contirmed by: "Alexandre \"Sunny\" Kovalenko" <alex.kovalenko_at_verizon.net>
Reviewed by: njl
MFC after: 1 week


# 176327 16-Feb-2008 rpaulo

Allow the user to override the current active cooling state if state
is currently TZ_ACTIVE_NONE.

Submitted by: Andriy Gapon <avg at icyb.net.ua>
Reviewed by: njl (mentor)
Approved by: njl (mentor)
Requested by: njl (mentor)
MFC after: 3 days


# 175014 31-Dec-2007 jhb

Use devclass_get_count() instead of devclass_get_maxunit() to get the
correct number of acpi_thermalX devices. Having this wrong caused the
acpi_thermal thread to realloc the array of devices on each loop iteration.

MFC after: 1 week
PR: kern/118497
Submitted by: Pasi Parviainen


# 174889 24-Dec-2007 ume

Add sysctl mibs for _TSP, _TC1 and _TC2 which is user overridable
but is blocked on user_override mib.
Not a few people want to use a passive cooling without their ACPI
BIOS support.

Reviewed by: njl


# 172836 20-Oct-2007 julian

Rename the kthread_xxx (e.g. kthread_create()) calls
to kproc_xxx as they actually make whole processes.
Thos makes way for us to add REAL kthread_create() and friends
that actually make theads. it turns out that most of these
calls actually end up being moved back to the thread version
when it's added. but we need to make this cosmetic change first.

I'd LOVE to do this rename in 7.0 so that we can eventually MFC the
new kthread_xxx() calls.


# 167249 05-Mar-2007 njl

Check the _TMP value for sanity also. On some systems (HP NX laptops), the
EC occasionally times out and provides bogus values (3000C). This change
prevents those systems from prematurely shutting down while we work on the
underlying problem. Also, bump the sanity value to 0...200C from 0...150C.


# 161951 03-Sep-2006 ume

Support Celsius (nn.nC), Fahrenheit (nn.nF) and Kelvin (nnnn) to
specify temperature.

Reviewed by: njl
MFC after: 3 days


# 160657 25-Jul-2006 njl

Add support for overriding the values for _CRT, _HOT, and _PSV via sysctl.
Prevent casual modification by requiring hw.acpi.thermal.user_override to
be set first. Fix printing of negative temperatures in the K->C conversion.
Document the remaining thermal sysctls.

MFC after: 3 days


# 159476 10-Jun-2006 njl

Minor sysctl cleanup. The RW flag means read|write and so it is redundant
to add the RD flag. Also, the debug node does not need to be writable.


# 150003 11-Sep-2005 obrien

Canonize the include of acpi.h.


# 149482 26-Aug-2005 kan

Unbreak compiles with ACPI_DEBUG.


# 149450 25-Aug-2005 ume

get current temperature from _TMP during passive cooling is active.
it makes CPU freq transition smooth.


# 149449 25-Aug-2005 ume

initialize only ACPI_BUFFER to avoid race condition with passive
cooling thread which refers psv, tc1, tc2 and tsp. The previous
code made the period where sc->tz_zone.tsp was zero, and it caused
panic at msleep().

Reported by: keramida
Tested by: keramida


# 149201 17-Aug-2005 ume

don't raise cpu speed over the value when passive cooling is in
effect. since CPU speed is restored by degrees, we cannot use
the facility of saving cpu speed by CPUFREQ_set() effectively.
so, we need to save the value when passive cooling is in effect.

Repoeted by: Kevin Oberman <oberman__at__es.net>


# 148703 04-Aug-2005 ume

don't do mutex locking around kthread_create() call.

Reported by: Maxim Maximov <mcsi__at__mcsi.pp.ru>


# 148138 18-Jul-2005 ume

Implement passive cooling. It is enabled for tz0 by default where
it is available.

Reviewed by: njl


# 142195 21-Feb-2005 njl

Set the start of the cooling time later on, when we're actually performing
the switch. Other interim tests (i.e., for minimum runtime) could
invalidate the start time. This fixes transitions to cooler states in that
now they go to the next active state (_AC0 -> _AC1) instead of going
straight to off (_AC0 -> off).

Submitted by: Alexandre "Sunny" Kovalenko (Alex.Kovalenko / verizon.net)


# 135548 21-Sep-2004 njl

Initialize the flags value properly. We used to do this in acpi_tz_all_off()
but that function has been removed. This avoids a potential unnecessary
fan switch on boot. Also remove some commented out code.

MFC after: 3 days


# 134961 08-Sep-2004 njl

Clean up rev 1.49 by using the temperature conversion for _PSV also and
wrap a long line.


# 134909 07-Sep-2004 njl

Don't change the state of the system in acpi_tz_establish(). Before, we
would turn off all fans when initializing a zone. However, the HP Omnibook
500 generates a notify saying the zone needs to be re-evaluated whenever
its fan is switched on or off. This produced an infinite loop. Also, note
that running _SCP can generate the same notify.

Since we need to make sure old fan references are turned off when getting
new ones, run acpi_tz_monitor() first. This will turn off any unneeded
fans. Then, check for new settings. After that, run acpi_tz_monitor()
again to turn on/off any fans referenced by the new settings.

Tested by: brooks


# 134541 30-Aug-2004 peter

Add a suffix descriptor for the acpi thermal values as a hint for the userland
sysctl tool to print a more readable value for temperatures.


# 133624 13-Aug-2004 njl

MPSAFE locking

* Restructure the event handling path. acpi_tz_thread() now calls
acpi_tz_timeout() any time an event occurs. acpi_tz_timeout() checks
the flags and calls acpi_tz_power_profile(), acpi_tz_establish(), and
acpi_tz_monitor() as appropriate. Notifies only do a wakeup and let
acpi_tz_thread() do the actual work. This path is cleaner and allows
locking since the call path is now always a D.A.G.
* Add the acpi_tz_signal() function to set flags and wake the thread.
* Remove the tz_tmp_updating flag since calls are serialized by
acpi_tz_thread().
* Remove Giant locking.


# 129879 30-May-2004 phk

Add missing <sys/module.h> includes


# 129696 25-May-2004 njl

Remove call to _INI for thermal devices. ACPI-CA now calls _INI for
Devices, ThermalZones, and Processors.


# 128991 06-May-2004 njl

Add back sys/reboot.h which is needed.


# 128990 06-May-2004 njl

Make unnecessary globals static and remove unused includes.

Pointed out by: cscout


# 128150 12-Apr-2004 njl

Remove a check for the return value added in rev 1.41. It's not an error
to fail to turn off a fan, since the case is that it's usually already off.


# 128071 09-Apr-2004 njl

Add MODULE_DEPEND entries so some of these drivers can eventually be
loaded separately from ACPI (i.e., embedded use).


# 128047 09-Apr-2004 njl

Replace more ad-hoc versions of acpi_GetReference(). Since the type of
Reference objects changed from ACPI_TYPE_ANY to ACPI_TYPE_LOCAL_REFERENCE
in Oct. 2002, this may help systems where switching the cooler on failed.
We support both types for now until this sorts out.


# 126662 05-Mar-2004 njl

A user can set tz_requested via the hw.acpi.thermal.tzX.active sysctl.
The previous logic meant that if a user sets it to a minimal cooling value
acpi_thermal will not use higher cooling levels. Reverse the logic so that
the user requesting a level (say, 2) also gets 0 - 1 also.

PR: kern/61592
Submitted by: Andrew Thompson <andy@fud.org.nz>


# 126560 03-Mar-2004 njl

Change to acpi_{Get,Set}Integer to provide both methods. Convert all
callers to the new API.

Submitted by: Mark Santcroos <marks@ripe.net>


# 126388 28-Feb-2004 njl

Call _INI on Thermal Zones as well as devices.


# 125366 03-Feb-2004 njl

Notify the user (at kern.emerg) that the system will be shutting down if
it is still above the critical temperature on the next poll cycle. This
is a 10 second advance notice by default. Document the private
(non-standard) notify we will be using with devd(8).


# 125335 02-Feb-2004 njl

If the temperature is at _HOT or _CRT for 3 sequential readings, shutdown
the system. Also, decrease the poll interval to 10 seconds from 30
seconds. This is needed because some systems will report an invalid high
temperature for one poll cycle. It is suspected this is due to the
embedded controller timing out. A typical value is 138C for one cycle on a
system that is otherwise 65C. This prevents the system from prematurely
shutting down after one invalid reading. It will still shut down after 30
seconds of high temperature, which is the same as previous default
behavior.

Tested by: Scott Lambert <lambert AT lambertfam.org>


# 124439 12-Jan-2004 njl

Bite the bullet and uncomment the shutdown() in case we hit the _CRT or
_HOT temperatures. We have to do this at some point to keep from getting
imp(tm) melted hardware.


# 124029 31-Dec-2003 njl

Use the appropriate values for the notifies. No change in behavior
since both notifies result in the same function being called.

Found by: documenting the code


# 121493 25-Oct-2003 njl

Add devctl(4) notify support to ACPI. Various subsystems now notify
userland whenever events occur. See the example in devd.conf below
to see how to use it.


# 120453 26-Sep-2003 njl

Consistently print attach messages.


# 119529 28-Aug-2003 njl

Style and whitespace changes. Also, make the ivar functions non-inline
since inlining failed due to the size of BUS_*


# 119418 24-Aug-2003 obrien

Use __FBSDID().
Also some minor style cleanups.


# 105282 16-Oct-2002 jhb

Catch up to changes in acpivar.h to add support for using ACPI on
4-stable systems.

Sponsored by: The Weather Channel


# 104354 02-Oct-2002 scottl

Some kernel threads try to do significant work, and the default KSTACK_PAGES
doesn't give them enough stack to do much before blowing away the pcb.
This adds MI and MD code to allow the allocation of an alternate kstack
who's size can be speficied when calling kthread_create. Passing the
value 0 prevents the alternate kstack from being created. Note that the
ia64 MD code is missing for now, and PowerPC was only partially written
due to the pmap.c being incomplete there.
Though this patch does not modify anything to make use of the alternate
kstack, acpi and usb are good candidates.

Reviewed by: jake, peter, jhb


# 102470 27-Aug-2002 iwasaki

Fix a bug about the cooling system controlling in acpi_thermal driver.
Recent version of ACPI CA returns the package object which contains
object reference elements if the elements are named objects.
We need to be careful when you use acpi_ForeachPackageObject() in new
code...


# 97274 25-May-2002 bde

Fixed printf format errors which apparently crept in while -Wformat was
disabled for gcc-3.


# 96926 19-May-2002 peter

Brutally deal with __func__ being 'const char *' on gcc-3.1.


# 91640 04-Mar-2002 iwasaki

Add generalized power profile code.
This makes other power-management system (APM for now) to be able to
generate power profile change events (ie. AC-line status changes), and
other kernel components, not only the ACPI components, can be notified
the events.

- move subroutines in acpi_powerprofile.c (removed) to kern/subr_power.c
- call power_profile_set_state() also from APM driver when AC-line
status changes
- add call-back function for Crusoe LongRun controlling on power
profile changes for a example


# 91215 25-Feb-2002 msmith

The thermal thread needs to take Giant before it does anything with the
interpreter.

Submitted by: Magnus B{ckstr|m <b@etek.chalmers.se>


# 91126 23-Feb-2002 msmith

Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.
The AcpiGetInto* interfaces are obsoleted by ACPI_ALLOCATE_BUFFER.

Convert to using a kthread rather than timeout() to avoid problems
with the interpreter sleeping.


# 89054 08-Jan-2002 msmith

Staticise devclasses and some unnecessarily global variables.


# 88420 22-Dec-2001 iwasaki

Add OS layer ACPI mutex and threading support.
- Temporary fix a bug of Intel ACPI CA core code.
- Add OS layer ACPI mutex support. This can be disabled by
specifying option ACPI_NO_SEMAPHORES.
- Add ACPI threading support. Now that we have a dedicate taskqueue for
ACPI tasks and more ACPI task threads can be created by specifying option
ACPI_MAX_THREADS.
- Change acpi_EvaluateIntoBuffer() behavior slightly to reuse given
caller's buffer unless AE_BUFFER_OVERFLOW occurs. Also CM battery's
evaluations were changed to use acpi_EvaluateIntoBuffer().
- Add new utility function acpi_ConvertBufferToInteger().
- Add simple locking for CM battery and temperature updating.
- Fix a minor problem on EC locking.
- Make the thermal zone polling rate to be changeable.
- Change minor things on AcpiOsSignal(); in ACPI_SIGNAL_FATAL case,
entering Debugger is easier to investigate the problem rather than panic.


# 86552 18-Nov-2001 iwasaki

Cleanups of verbose printing. All the messages for the debugging is
disabled unless verbose flag is set. Also fix some messages in terms
of English.
The critical messages and error messages in probe/attach routine are
unchanged by this commit.


# 86399 15-Nov-2001 iwasaki

Two minor changes.
- Change _ACx sysctl oid from ten of _AC[0-9] to one _ACx.
- Better error printing on _TMP evaluation.

Reviewed by: msmith


# 85699 29-Oct-2001 iwasaki

Some small improvements of ACPI thermal driver.
- Give a guaranteed minimum cooling run time to avoid too frequent
cooling system On/Off switching. The minimum cooling run time can be
specified by hw.acpi.thermal.min_runtime in sec.
- Refine message printing (_AC-1 -> NONE).
- Add verbose mode enable/disable capability by hw.acpi.verbose in bool.

Reviewed by: acpi-jp@ folks


# 82967 04-Sep-2001 iwasaki

Just print a message in acpi_tz_monitor() only when new active state
is different from the previous active state.
This reduce tons of 'acpi_tz0: _AC0: temperature 64.0 >= setpoint 64.0'
messages.

Reviewed by: msmith


# 82372 26-Aug-2001 msmith

Updates to match the ACPI CA 20010816 import:

- New debug macro (ACPI_DEBUG_PRINT), reducing debug-case code size.
- New debug level/subsystem codes.


# 82043 21-Aug-2001 msmith

Remove noisy printfs from the notify handler; having these go off
every couple of seconds is not useful.


# 80078 21-Jul-2001 msmith

Convert from acpi_strerror() to AcpiFormatException()

Fix dangling include of the dear departed acpi_ecreg.h


# 79385 07-Jul-2001 msmith

Quiet the complaint about the _SCP method if it doesn't exist; it's
not mandatory.


# 79375 06-Jul-2001 msmith

Add support for user-requested override of cooling levels.

Monitor the system power profile, and use _SCP to adjust thermal zones
accordingly.

Simplify the behaviour of the timeout routine, and add some temporary
debugging.


# 79283 05-Jul-2001 msmith

Fix a couple of misunderstandings in the monitor code. Passive cooling
is a parallel adjunct to active cooling, not a lesser evil. The _ACx
levels sort from 0 being hottest, not coolest.

Sanity check the returned temperature values, since we are having
trouble reading them on some systems.

Rearrange sysctl nodes a bit; this is probably close to the final layout.


# 78999 29-Jun-2001 msmith

Add ACPI lock support.

Pass the softc, not the device_t to the Notify handler.

Don't invoke the Interpreter from callout context, as it may sleep.
Use AcpiOsQueueForExecution, which is called from taskqueue_swi.


# 78915 28-Jun-2001 msmith

Sync to my work in progress:

- Reorder the acpi_* functions in a sensible fashion
- Add acpi_ForeachPackageObject and acpi_GetHandleInScope
- Use the new debugging layer/level names
- Implement most of the guts of the acpi_thermal module; passive cooling
isn't there yet, but active cooling should work.
- Implement power resource handling (acpi_powerres.c)

This compiles and mostly works, but my test coverage is small, so feedback
is welcome.


# 78662 23-Jun-2001 iwasaki

Add sysctl interface (Read-only) for temprature, AC-line and Battery.
Patches for acpi_cmbat.c submitted by Munehiro Matsuda.


# 77432 29-May-2001 msmith

- Updates for new constant naming in the ACPI CA 20010518 update.
- Use __func__ instead of __FUNCTION.
- Support power-off to S3 or S5 (takawata)
- Enable ACPI debugging earlier (with a sysinit)
- Fix a deadlock in the EC code (takawata)
- Improve arithmetic and reduce the risk of spurious wakeup in
AcpiOsSleep.
- Add AcpiOsGetThreadId.
- Simplify mutex code (still disabled).


# 71874 31-Jan-2001 msmith

Tidy up.

Don't print temperatures at attach time - they're usually wrong.

Use acpi_EvaluateInteger instead of doing things the hard way.


# 71462 23-Jan-2001 jhb

Axe unused local variable.


# 70271 22-Dec-2000 takawata

Add ACPI AC adaptor and ACPI Control Method Battery.
And install notify handler for thermal zone .


# 69744 08-Dec-2000 msmith

- Convert a lot of homebrew debugging output to use the ACPI CA debugging
infrastructure. It's not perfect, but it's a lot better than what
we've been using so far. The following rules apply to this:
o BSD component names should be capitalised
o Layer names should be taken from the non-CA set for now. We
may elect to add some new BSD-specific layers later.

- Make it possible to turn off selective debugging flags or layers
by listing them in debug.acpi.layer or debug.acpi.level prefixed
with !.

- Fully implement support for avoiding nodes in the ACPI namespace.
Nodes may be listed in the debug.acpi.avoid environment variable;
these nodes and all their children will be ignored (although still
scanned over) by ACPI functions which scan the namespace. Multiple
nodes can be specified, separated by whitespace.

- Implement support for selectively disabling ACPI subsystem components
via the debug.acpi.disable environment variable. The following
components can be disabled:
o bus creation/scanning of the ACPI 'bus'
o children attachment of children to the ACPI 'bus'
o button the acpi_button control-method button driver
o ec the acpi_ec embedded-controller driver
o isa acpi replacement of PnP BIOS for ISA device discovery
o lid the control-method lid switch driver
o pci pci root-bus discovery
o processor CPU power/speed management
o thermal system temperature detection and control
o timer ACPI timecounter
Multiple components may be disabled by specifying their name(s)
separated by whitespace.

- Add support for ioctl registration. ACPI subsystem components may
register ioctl handlers with the /dev/acpi generic ioctl handler,
allowing us to avoid the need for a multitude of /dev/acpi* control
devices, etc.


# 67761 28-Oct-2000 msmith

Initial FreeBSD OSPM (operating system power management) modules for
ACPICA. Most of these are still works in progress. Support exists for:

- Fixed feature and control method power, lid and sleep buttons.
- Detection of ISA PnP devices using ACPI namespace.
- Detection of PCI root busses using ACPI namespace.
- CPU throttling and sleep states (incomplete)
- Thermal monitoring and cooling control (incomplete)
- Interface to platform embedded controllers (mostly complete)
- ACPI timer (incomplete)
- Simple userland control of sleep states.
- Shutdown and poweroff.