summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi_thermal.c
Commit message (Collapse)AuthorAgeFilesLines
* acpi_thermal: Warn about insane _TMP temperature only oncedumbbell2013-08-301-5/+26
| | | | | | | 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.
* Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on ↵sbz2013-01-301-1/+1
| | | | | | | device_method_t arrays Reviewed by: cognet Approved by: cognet
* Remove not very useful printf, that can be too chatty.mav2013-01-101-8/+1
| | | | | | | | 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.
* acpi_thermal: when _ACx is tripped, all _ALi i>= x should be onavg2012-10-141-6/+11
| | | | | | ... and not just _ALx as it is now. MFC after: 20 days
* - be more precise about the unit of measurementeadler2011-11-171-1/+1
| | | | | Approved by: jhb MFC after: 3 days
* - be more precise about the unit of measurementeadler2011-11-171-1/+1
| | | | | | Submitted by: Oliver Pinter <oliver.pntr@gmail.com> Approved by: jhb MFC after: 3 days
* Remove duplicate header includeskevlo2011-06-281-1/+0
|
* Correctly output the entire array for hw.acpi.thermal._ACx.mdf2011-04-191-1/+2
| | | | | Reported by: Taku YAMAMOTO < taku AT tackymt DOT homeip DOT net > Tested by: Nick Ulen < uncle AT wolfman DOT devio DOT us >
* Fix a few acpi sysctls that want "IK" formatting to specify CTLTYPE_INT.mdf2011-04-181-7/+7
| | | | | | | This got broken after r217586. Pointy hat: to me Tested by: David Wolfskill < davit AT catwhisker DOT org >
* fix a few cases where a string is passed via format argument instead ofavg2010-06-111-4/+2
| | | | | | | | | | 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
* Temporarily revert the new-bus locking for 8.0 release. It will bejhb2009-08-201-3/+0
| | | | | | reintroduced after HEAD is reopened for commits by re@. Approved by: re (kib), attilio
* Make the newbus subsystem Giant free by adding the new newbus sxlock.attilio2009-08-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Import ACPICA 20090521.jkim2009-06-051-1/+3
|
* Initialize tz_active to a new constant TZ_ACTIVE_UNKNOWN and make norpaulo2008-04-251-1/+20
| | | | | | | | 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
* Create a thread to handle passive cooling for 1st zone which has _PSV,ume2008-02-161-19/+20
| | | | | | | | _TSP, _TC1 and _TC2. Contirmed by: "Alexandre \"Sunny\" Kovalenko" <alex.kovalenko_at_verizon.net> Reviewed by: njl MFC after: 1 week
* Allow the user to override the current active cooling state if staterpaulo2008-02-161-1/+2
| | | | | | | | | | 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
* Use devclass_get_count() instead of devclass_get_maxunit() to get thejhb2007-12-311-1/+1
| | | | | | | | | 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
* Add sysctl mibs for _TSP, _TC1 and _TC2 which is user overridableume2007-12-241-0/+40
| | | | | | | | 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
* Rename the kthread_xxx (e.g. kthread_create()) callsjulian2007-10-201-3/+3
| | | | | | | | | | | 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.
* Check the _TMP value for sanity also. On some systems (HP NX laptops), thenjl2007-03-051-3/+10
| | | | | | 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.
* Support Celsius (nn.nC), Fahrenheit (nn.nF) and Kelvin (nnnn) toume2006-09-031-1/+0
| | | | | | | specify temperature. Reviewed by: njl MFC after: 3 days
* Add support for overriding the values for _CRT, _HOT, and _PSV via sysctl.njl2006-07-251-13/+55
| | | | | | | | 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
* Minor sysctl cleanup. The RW flag means read|write and so it is redundantnjl2006-06-101-2/+2
| | | | to add the RD flag. Also, the debug node does not need to be writable.
* Canonize the include of acpi.h.obrien2005-09-111-1/+1
|
* Unbreak compiles with ACPI_DEBUG.kan2005-08-261-0/+2
|
* get current temperature from _TMP during passive cooling is active.ume2005-08-251-15/+33
| | | | it makes CPU freq transition smooth.
* initialize only ACPI_BUFFER to avoid race condition with passiveume2005-08-251-1/+8
| | | | | | | | | 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
* don't raise cpu speed over the value when passive cooling is inume2005-08-171-11/+24
| | | | | | | | 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>
* don't do mutex locking around kthread_create() call.ume2005-08-041-4/+16
| | | | Reported by: Maxim Maximov <mcsi__at__mcsi.pp.ru>
* Implement passive cooling. It is enabled for tz0 by default whereume2005-07-181-13/+277
| | | | | | it is available. Reviewed by: njl
* Set the start of the cooling time later on, when we're actually performingnjl2005-02-221-2/+2
| | | | | | | | | 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)
* Initialize the flags value properly. We used to do this in acpi_tz_all_off()njl2004-09-211-33/+2
| | | | | | | 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
* Clean up rev 1.49 by using the temperature conversion for _PSV also andnjl2004-09-081-4/+5
| | | | wrap a long line.
* Don't change the state of the system in acpi_tz_establish(). Before, wenjl2004-09-071-16/+22
| | | | | | | | | | | | | | 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
* Add a suffix descriptor for the acpi thermal values as a hint for the userlandpeter2004-08-301-10/+10
| | | | sysctl tool to print a more readable value for temperatures.
* MPSAFE lockingnjl2004-08-131-120/+108
| | | | | | | | | | | | | * 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.
* Add missing <sys/module.h> includesphk2004-05-301-0/+1
|
* Remove call to _INI for thermal devices. ACPI-CA now calls _INI fornjl2004-05-251-6/+0
| | | | Devices, ThermalZones, and Processors.
* Add back sys/reboot.h which is needed.njl2004-05-061-0/+1
|
* Make unnecessary globals static and remove unused includes.njl2004-05-061-1/+0
| | | | Pointed out by: cscout
* Remove a check for the return value added in rev 1.41. It's not an errornjl2004-04-121-8/+1
| | | | to fail to turn off a fan, since the case is that it's usually already off.
* Add MODULE_DEPEND entries so some of these drivers can eventually benjl2004-04-091-0/+1
| | | | loaded separately from ACPI (i.e., embedded use).
* Replace more ad-hoc versions of acpi_GetReference(). Since the type ofnjl2004-04-091-67/+28
| | | | | | 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.
* A user can set tz_requested via the hw.acpi.thermal.tzX.active sysctl.njl2004-03-051-1/+1
| | | | | | | | | 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>
* Change to acpi_{Get,Set}Integer to provide both methods. Convert allnjl2004-03-031-9/+4
| | | | | | callers to the new API. Submitted by: Mark Santcroos <marks@ripe.net>
* Call _INI on Thermal Zones as well as devices.njl2004-02-281-0/+6
|
* Notify the user (at kern.emerg) that the system will be shutting down ifnjl2004-02-031-5/+13
| | | | | | 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).
* If the temperature is at _HOT or _CRT for 3 sequential readings, shutdownnjl2004-02-021-14/+21
| | | | | | | | | | | | | 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>
* Bite the bullet and uncomment the shutdown() in case we hit the _CRT ornjl2004-01-121-4/+4
| | | | | _HOT temperatures. We have to do this at some point to keep from getting imp(tm) melted hardware.
* Use the appropriate values for the notifies. No change in behaviornjl2003-12-311-2/+2
| | | | | | since both notifies result in the same function being called. Found by: documenting the code
OpenPOWER on IntegriCloud