Commit Graph

87 Commits

Author SHA1 Message Date
pgoyette
fa22835bbb Replace local handling of entropy gathering with the new common code
recently introduced into sysmon_envsys(4).

Thanks to jruoho@ for testing.
2012-07-29 02:58:27 +00:00
christos
a0b6dd8ad5 Treat empty package returned from _AL<n> method the same as non-existent.
From jmcneill.
2012-07-19 18:03:32 +00:00
tls
7b0b7dedd9 Entropy-pool implementation move and cleanup.
1) Move core entropy-pool code and source/sink/sample management code
   to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
   source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
   avoid expensive operations on disabled entropy sources; make the
   rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
   have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
   system events, and skew between clocks, with a sample implementation
   for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files).  Tested with release
builds on amd64 and evbarm and live testing on amd64.
2012-02-02 19:42:57 +00:00
jmcneill
b2284bc274 _ACx is for active cooling policy, using it for envsys temp 'warn max' doesn't
make sense
2011-10-02 22:20:33 +00:00
jmcneill
07b278992f If there are CPUs associated with this thermal zone, use their names to
create the temperature sensor name:

[acpitz0]
  cpu0 temperature:    53.000  105.000   41.800                   degC
2011-07-16 15:45:24 +00:00
pgoyette
930a8a50f3 Initialize sensors states before registering. 2011-06-20 17:21:50 +00:00
jruoho
9016a5d8a8 Use the new acpi_match_cpu_handle() from acpi_util.c. 2011-06-20 15:36:49 +00:00
pgoyette
ffd31fcd0b Don't set the FVALID_{MAX,MIN} flags since these values are not
min/max legal values.  The values are alarms limits, and they're
already being tracked properly with the flag settings in *props
2011-06-06 17:49:41 +00:00
jruoho
5f852a8424 Change the preprocessor defines around the module(9)'s modcmd() calls such
that the modules show in modstat(8) even though these are "builtin".
2011-02-16 09:05:12 +00:00
jmcneill
c93b203331 If the thermal zone has a _PSL method, print a list of processors
associated with the zone at attach time.

  acpitz0 at acpi0 (THM0)
  acpitz0: levels: critical 127.0 C, passive cooling
  acpitz1 at acpi0 (THM1): cpu0 cpu1
  acpitz1: levels: critical 100.0 C, passive 95.5 C, passive cooling
2011-01-18 21:15:54 +00:00
jruoho
019ba6b902 Use acpi_power_register() for consistency. No functional change. 2011-01-09 14:58:10 +00:00
jruoho
8eae6f006a Bump WARNS to 4. 2010-10-26 04:37:33 +00:00
jruoho
9fad28a567 Add support for module(9). 2010-10-25 17:06:58 +00:00
jruoho
2052593844 Now that we have 1:1 mapping between handles and nodes, use the former for
all power resource operations. Eliminates the wrapper functions.
2010-06-07 17:28:17 +00:00
plunky
6d4cc93fdf adjust autoconfig output: this item is part of a verbose line 2010-06-01 19:20:43 +00:00
plunky
31555cd112 fix up autoconfig output 2010-05-31 17:41:24 +00:00
jruoho
f04ee53053 Use ACPICA's standard notify values from <actypes.h> and move the
device-specific notify constants to the device-specific files.
2010-04-27 05:57:43 +00:00
jruoho
80e5813055 Remove retrieving the zone name via something called "REGN".
We really should not add code that aims to satisfy some oddball firmware,
not in the generic drivers that aim to comply with the specifications.
In the long-term this is even worse than quirk tables.
2010-04-24 19:16:10 +00:00
jruoho
ac93d6907f Some purely cosmetic editing in the name of readability: clean up the softc
and remove unused variables therein, remove unused constants, use
ACPI_DEBUG_PRINT, add more detailed comments, et cetera.
2010-04-24 19:11:48 +00:00
jruoho
1b81a62b62 Now that we are able to remove references to power resources, provide a
detachment routine for acpitz(4). Add comments explaining the relationship
between power resources and active cooling. Also some improvements to code
readability.
2010-04-24 06:31:44 +00:00
jruoho
9ddf2c5165 Merge new code for ACPI power resources.
The old code served us well, but a major overhaul would have been needed for
it to cope with the increased demands of the code -- and the specifications.

ok jmcneill@, pgoyette@
2010-04-22 18:40:09 +00:00
christos
b62024a026 fix dmesg printing. 2010-04-16 01:52:54 +00:00
jruoho
55052eca77 As discussed with jmcneill@, install a global "bus notification handler"
that receives all notifications and deliver notifications to drivers via it.
2010-04-15 07:02:24 +00:00
jruoho
fb53d8ceed No need to spread the ACPICA type system any more than is necessary:
UINT8 -> uint8_t and UINT32 -> uint32_t.
2010-04-14 19:27:28 +00:00
jruoho
2786f7261b Silence errors from the integer evaluations in case the objects are not found.
(This was too verbose even for ACPI_DEBUG.) Also fit the status messages to
one line during boot by using aprint_verbose() for extra information.
2010-03-17 20:29:32 +00:00
pgoyette
89bf6ebb9f Remove setting of edata->monitor since that member no longer exists. 2010-03-14 18:05:07 +00:00
jruoho
5a425210a3 Remove <dev/acpi/acpica.h> from all files. It is included from
<dev/acpi/acpivar.h>. Ditto for <dev/sysmon/sysmonvar.h>, <sys/bus.h>,
<dev/pci/pcivar.h>, and <dev/isa/isavar.h>.

Also nuke a lot of unused and invalid headers. Some of these are audibly
provided by standard headers (namely <sys/param.h> and <sys/device.h>), some
have nothing to do with ACPI devices (e.g. <sys/syslog.h>), and some are
nonexistent local includes (e.g. "mpu_ym.h"). Moreoever, try to group the
includes into their respective blocks.

Tested with GENERIC and ALL (i386). No functional change.
2010-03-05 14:00:16 +00:00
pgoyette
e1fc7f5215 As pointed out by Rhialto, "degrees Kelvin" is redundant. So fix a
couple of comments related to converstion between Kelvin and degC.
2010-03-05 12:44:16 +00:00
pgoyette
fe9cd1c415 Print correct temperature value, and properly display negative temperatures.
Resolves PR kern/36615
2010-02-18 14:10:15 +00:00
pgoyette
52af77f5e8 Adapt to changes in sysmon's limit structure. 2010-02-14 23:06:58 +00:00
jruoho
4d0db25236 Fix incorrect notify handler type (ACPI_SYSTEM_NOTIFY -> ACPI_DEVICE_NOTIFY). 2010-02-01 09:45:04 +00:00
jruoho
e5a9d901c0 Use acpi_eval_reference_handle() to simplify code. No functional change.
ok jmcneill@, pgoyette@
2010-01-18 18:36:49 +00:00
jruoho
517e16fb9b Fix a minor bug where a reference handle is used for error reporting even
though it may not be present. While here, convert few lines to aprint_*().

ok pgoyette@
2010-01-18 17:09:17 +00:00
jruoho
57bb616085 Fix a memory leak/corruption by commenting out the evaluation of the _PSL
control method. If it is needed in the future, the output buffer must be
freed after use.

ok pgoyette@, jmcneill@
2010-01-05 13:47:52 +00:00
pgoyette
390d022573 Don't set sensor state to SWARNOVER here. Doing so based only on the
device's active cooling levels prevents the user from overriding these
limits with his own values.

XXX We should probably also change setting SCRITOVER state to SCRITICAL,
XXX but right now that just confuses things.  We currently don't have a
XXX way for a sensor to be both SCRITICAL and SCRITOVER.
2010-01-01 15:55:30 +00:00
pgoyette
5c06b9862c In ATZ_F_VERBOSE mode, log a message whenever the active cooling level
changes, even when the new level is ATZ_ACTIVE_NONE
2009-12-24 00:26:28 +00:00
pgoyette
07dad0134f Since we're using the active cooling levels as warning threshold, we
should store the value in the correct location.  We're already setting
the correct flag bit.

Should resolve problem reported by Frank Wille on current-users...
2009-12-23 02:29:46 +00:00
uebayasi
c197134fb4 Remove a debug printf(). 2009-11-29 18:08:22 +00:00
cegger
6f85be6a06 By reading the ACPI dump I figured out that my
HP Pavillion dv9700 laptop features a fan sensor
in the ACPI Thermal Zone which is beyond of the ACPI
Spec.

envstat shows
[acpitz0]
  Processor Thermal Zone:     56.000   95.000                       degC
                     FAN:       2840                                 RPM

envstat -W shows the limits
[acpitz0]
  Processor Thermal Zone:     55.000                                degC
                     FAN:       2570     4500     2000               RPM

Patch presented on tech-kern@.

No comments.
2009-11-25 13:54:23 +00:00
cegger
29e2a7eb92 evaluate _RTV as preparation for passive cooling. 2009-11-23 14:42:39 +00:00
mlelstv
23ab96a36b Allow for 'options ACPI_DEBUG' by providing module declarations
and using memory allocation macros instead of calling AcpiOs* stubs
directly.
2009-09-16 10:47:54 +00:00
jmcneill
80adfeb08d PR# kern/41179: Incorrect return values from AcpiOsExecute()
ACPICA functions return ACPI_STATUS instead of int, so use it for
consistency.
2009-08-25 10:34:08 +00:00
pgoyette
de4ed96bf9 Use a macro to define the conversion between ACPI temperatures and those
used by sysmon_envsys(4).

No functional change.
2009-07-04 13:36:49 +00:00
pgoyette
caff4fea85 Remove an unused mutex. This was left-over from two years ago when
driver was updated to sysmon_envsys V2;  a simple_lock was turned into
a mutex.  But the only code that ever used the simple_lock was removed
so the mutex can also be removed.

Noticed by njoly@
2009-07-03 21:18:40 +00:00
pgoyette
2d29649a47 Properly convert ACPI zone values to uKelvins.
Patch from njoly@
2009-07-03 15:34:10 +00:00
pgoyette
5de2729099 Change acpi_tz sensor behavior as follows:
1. ENVSYS_WARNOVER event is generated whenever any active cooling level
   is exceeded.

2. ENVSYS_CRITOVER event is generated whenever _HOT limit is exceeded;
   if the _HOT limit is not defined, then ENVSYS_CRITOVER will be
   generated when the _CRT limit is exceeded.

3. For Passive Cooling Only mode, there will be no change in behavior.

Additionally, since there are specific actions taken at each of the Active
Cooling Levels (powering parts of a zone on or off), and the limits are not
user-programmable,

4. The {warn,crit}{min,max} threshold levels will be specified only
   by the device itself;  event reporting thresholds may not be set
   from userland.

No comments received for two weeks after proposing these changes on both
current-users@ and tech-kern@
2009-06-30 16:14:49 +00:00
pgoyette
7c25ce0d52 Explicitly set sensor's units to ENVSYS_STEMP rather than having
it work only because ENVSYS_STEMP is #defined to 0
2009-06-03 22:34:18 +00:00
pgoyette
5a84f3060e Since we no longer have individual events for each sensor value limit,
we don't need individual flag bits.  Clean up extra bit definitions.
Bump kernel version - welcome to 5.99.13
2009-06-01 20:08:44 +00:00
pgoyette
7355d18b97 Leave the task of displaying sensor states to envsys_sysmon() unless we
are in debug mode.
2008-11-09 13:54:06 +00:00
pgoyette
18913ef363 Temp sensor should report a critical-overtemp condition (ENVSYS_SCRITOVER)
not a simple critical (ENVSYS_SCRITICAL) condition.
2008-11-09 03:36:04 +00:00