aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/coretemp/coretemp.c
Commit message (Collapse)AuthorAgeFilesLines
* newbus: replace leftover device unit wildcardsAhmad Khalifa2025-06-211-1/+1
| | | | | | Reviewed by: imp, jhb Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D50913
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* coretemp: Only log critical temperature eventssadaszewski2023-02-051-1/+3
| | | | | | | | | | | | | | | According to the Intel manual https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-3b-part-2-manual.pdf the Thermal Status (0) and Thermal Status Log (1) bits report only a high temperature on the CPU, not a critical temperature as suggested in the coretemp driver. Check the Critical Temperature Log (5) instead. The critical temperature waives guarantees of correct function, therefore the CPU could have for example written some wrong values into memory at that point and the OS should be stopped ASAP as the state is no longer reliable. Reviewed by: imp (confirmed descriptions of bits, linux ignores these bits) Pull Request: https://github.com/freebsd/freebsd-src/pull/562
* coretemp: Remove unused devclass argument to DRIVER_MODULE.John Baldwin2022-05-091-3/+1
|
* Make CPU children explicitly share parent unit numbers.Alexander Motin2021-09-251-1/+1
| | | | | | Before this device unit number match was coincidental and broke if I disabled some CPU device(s). Aside of cosmetics, for some drivers (may be considered broken) it caused talking to wrong CPUs.
* coretemp: use x86_msr_op for thermal MSR accessKonstantin Belousov2021-08-051-41/+16
| | | | | | | | Reviewed by: markj Discussed with: mav Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31386
* coretemp(4): Switch to smp_rendezvous_cpus().Alexander Motin2021-07-301-22/+37
| | | | | | | | | | Use of smp_rendezvous_cpus() instead of sched_bind() allows to not block indefinitely if target CPU is running some thread with higher priority, while all we need is single rdmsr/wrmsr instruction call. I guess it should also be much cheaper than full thread migration. MFC after: 2 weeks Sponsored by: iXsystems, Inc.
* hwpmc: Always set pmc_cpuid to somethingRyan Moeller2020-07-141-1/+1
| | | | | | | | | | | | | | | pmc_cpuid was uninitialized for most AMD processor families. We can still populate this string for unimplemented families. Also added a CPUID_TO_STEPPING macro and converted existing code to use it. Reviewed by: mav MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25673 Notes: svn path=/head/; revision=363206
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-1/+2
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* Extract eventfilter declarations to sys/_eventfilter.hConrad Meyer2019-05-201-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Notes: svn path=/head/; revision=347984
* Quiet coretemp probeMatt Macy2018-06-151-0/+3
| | | | | | | | | | | | | | Only the first device will print coretemp0: <CPU On-Die Thermal Sensors> numa-domain 0 on cpu0 instead of all hyper threads Submitted by: kbowling Reviewed by: imp, sbruno Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15727 Notes: svn path=/head/; revision=335186
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Fix the deciKelvin to Celsius conversion in kernel.Luiz Otavio O Souza2016-05-221-1/+1
| | | | | | | | | | | | | | After r285994, sysctl(8) was fixed to use 273.15 instead of 273.20 as 0C reference and as result, the temperature read in sysctl(8) now exibits a +0.1C difference. This commit fix the kernel references to match the reference value used in sysctl(8) after r285994. Sponsored by: Rubicon Communications (Netgate) Notes: svn path=/head/; revision=300421
* Mark the coretemp(4) sysctls as MPSAFE, ensuring that Giant won't be heldMark Johnston2013-02-181-6/+6
| | | | | | | | | | | | | unnecessarily by a user thread waiting to run on a specific CPU after calling sched_bind(). Reviewed by: rstone Approved by: emaste (co-mentor) Sponsored by: Sandvine Incorporated MFC after: 1 week Notes: svn path=/head/; revision=246951
* Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on ↵Sofian Brabez2013-01-301-1/+1
| | | | | | | | | | device_method_t arrays Reviewed by: cognet Approved by: cognet Notes: svn path=/head/; revision=246128
* This isn't functionally identical. In some cases a hint to disableEitan Adler2012-10-221-0/+2
| | | | | | | | | | | unit 0 would in fact disable all units. This reverts r241856 Approved by: cperciva (implicit) Notes: svn path=/head/; revision=241885
* Now that device disabling is generic, remove extraneous code from theEitan Adler2012-10-221-2/+0
| | | | | | | | | | | device drivers that used to provide this feature. Reviewed by: des Approved by: cperciva MFC after: 1 week Notes: svn path=/head/; revision=241856
* #PROCHOT assertion is sticky after reading the MSR (accordingly withAttilio Rao2011-09-191-1/+4
| | | | | | | | | | | | | | Intel manuals) it must be cleared by writing a 0. Fix that. Sponsored by: Sandvine Incorporated Reported by: rstone Reviewed by: delphij, emaste, rstone Approved by: re (kib) MFC after: 1 week Notes: svn path=/head/; revision=225662
* Expose more variables from coretemp(4) via sysctl:Xin LI2011-09-021-60/+157
| | | | | | | | | | | | | | - tjmax - Tj(max) value from the CPU - delta - current delta reading - resolution - sensor resolution in Celsius - throttle_log - whether a #PROCHOT was asserted since last reset Submitted by: Mark Johnston <markjdb gmail.com> (mostly) MFC after: 1 month Approved by: re (kib) Notes: svn path=/head/; revision=225339
* Bump the maximum coretemp limit (for CPU temperature) to 110. SeveralAttilio Rao2011-08-191-2/+2
| | | | | | | | | | | | cores with temp in the range 101-105 have been found in the past. Sponsored by: Sandvine Incorporated Reviewed by: delphij, emaste Approved by: re (kib) MFC after: 3 days Notes: svn path=/head/; revision=225009
* Detect and set Atom's Tj(max) to 90 if it's not the 45nm D400/D500/N400Xin LI2011-05-051-0/+9
| | | | | | | | | series. MFC after: 2 weeks Notes: svn path=/head/; revision=221509
* Correct a typo. According to Intel document 318914, the Tj(max) for Core 2Xin LI2011-05-021-1/+1
| | | | | | | | | | Duo Mobile CPUs should be 105. Noticed by: Mark Johnston <markjdb gmail.com> MFC after: 3 days Notes: svn path=/head/; revision=221335
* Catch known CPUs before using IA32_TEMPERATURE_TARGET.Xin LI2010-08-041-28/+40
| | | | | | | | | | | | This way we would have an opportunity to hide the Tj(target) value doesn't seem right stuff if we know it's not working there. Add temperature value for Core2 Duo Extreme Mobile that I have access to. Notes: svn path=/head/; revision=210833
* Improve cputemp(4) driver wrt newer Intel processors, especiallyXin LI2010-07-291-13/+47
| | | | | | | | | | | | | | | | | | Xeon 5500/5600 series: - Utilize IA32_TEMPERATURE_TARGET, a.k.a. Tj(target) in place of Tj(max) when a sane value is available, as documented in Intel whitepaper "CPU Monitoring With DTS/PECI"; (By sane value we mean 70C - 100C for now); - Print the probe results when booting verbose; - Replace cpu_mask with cpu_stepping; - Use CPUID_* macros instead of rolling our own. Approved by: rpaulo MFC after: 1 month Notes: svn path=/head/; revision=210624
* Change 'dev.cpu.N.temperature', sysctl I (degC) to IK (Kelvin).Norikatsu Shigemura2009-09-061-3/+5
| | | | | | | | | | Approved by: re (rwatson) Reviewed by: rpaulo Suggested by: ume MFC After: 3 days Notes: svn path=/head/; revision=196889
* Introduce cpu_vendor_id and replace a lot of strcmp(cpu_vendor, "...").Jung-uk Kim2008-11-261-1/+2
| | | | | | | Reviewed by: jhb, peter (early amd64 version) Notes: svn path=/head/; revision=185341
* style(9): remove FreeBSD CVS ID from the initial license comment.Rui Paulo2008-05-141-3/+0
| | | | | | | MFC after: 1 day Notes: svn path=/head/; revision=178989
* Change the check for cpu_high to actually match CPUID 0x06.Rui Paulo2008-05-111-3/+3
| | | | | | | | | Submitted by: Arthur Hartwig <arthur.hartwig at nokia.com> PR: 122878 MFC after: 3 days Notes: svn path=/head/; revision=178950
* Don't attach to non Core CPUs. This is needed because on the PIII,Rui Paulo2008-02-141-0/+9
| | | | | | | | | | querying the number of sensors returns > 0. PR: 120541 Approved by: njl (mentor) Notes: svn path=/head/; revision=176279
* Disable the check for errata AE18. On MacBooks (1,1 version) there'sRui Paulo2008-01-101-0/+6
| | | | | | | | | no problem with coretemp and C3 state. Approved by: njl (mentor) Notes: svn path=/head/; revision=175214
* Backout sensors framework.Alexander Leidinger2007-10-151-45/+34
| | | | | | | | Requested by: phk Discussed on: cvs-all Notes: svn path=/head/; revision=172674
* Convert coretemp(4) to the hardware sensors framework andAlexander Leidinger2007-10-141-34/+45
| | | | | | | | | | | | | make sure to never call sched_bind() for uninitialised CPUs. Submitted by: Constantine A. Murenin <cnst@FreeBSD.org> Sponsored by: Google Summer of Code 2007 (GSoC2007/cnst-sensors) Mentored by: syrinx Tested by: many OKed by: kensmith Notes: svn path=/head/; revision=172633
* Style nits + more reliable Tj(max) detection + improved reporting ofDag-Erling Smørgrav2007-08-231-34/+42
| | | | | | | | | | critical temperature + sched_unbind() after rdmsr + initialize sc_dev. Submitted by: Rui Paulo <rpaulo@fnop.net>, cnst Approved by: re (kensmith) Notes: svn path=/head/; revision=171933
* Add a driver for the on-die digital thermal sensor found on Intel CoreDag-Erling Smørgrav2007-08-151-0/+268
and newer CPUs (including Core 2 and Core / Core 2 based Xeons). The driver attaches to each cpu device and creates a sysctl node in that device's sysctl context (dev.cpu.N.temperature). When invoked, the handler binds to the appropriate CPU to ensure a correct reading. Submitted by: Rui Paulo <rpaulo@fnop.net> Sponsored by: Google Summer of Code 2007 Tested by: des, marcus, Constantine A. Murenin, Ian FREISLICH Approved by: re (kensmith) MFC after: 3 weeks Notes: svn path=/head/; revision=171854