RehabMan
Moderator
- Joined
- May 2, 2012
- Messages
- 181,058
- Motherboard
- Intel DH67BL
- CPU
- i7-2600K
- Graphics
- HD 3000
- Mac
- Mobile Phone
I've been examining the ACPISensors code and DSDT code, and I've come to the following observation:
I think ACPISensors (in my case) only reads the first two entries of the TACH package, and (possibly) fails to evaluate anything else. I've tested switching the order of FAN0 and FAN1 in the TACH package (don't think matter should order), and when the fans don't show up in HWMonitor, the kernel log buffer shows the trace code for the FIRST FANx device ONLY!
Here's the code:
Code:Device (SMCD) { Name (_HID, "FAN0000") Name (TACH, Package () { "CPUFan", "FAN1", "System Fan", "FAN0" }) Method (FAN0, 0, Serialized) { \RMDT.PUSH("running FAN0") Store (\_SB.PCI0.LPCB.EC.FANL, Local0) \RMDT.P2("[FAN0] FANL is ", Local0) Store (\_SB.PCI0.LPCB.EC.FANH, Local1) \RMDT.P2("[FAN0] FANH is ", Local1) If (Local0) { Subtract (Local0, Local1, Local2) Multiply (Local2, 0x3E8, Local2) Store (Local2, Local0) } \RMDT.P2("[FAN0] returned Local0 value: ", Local0) Return (Local0) } Method (FAN1, 0, Serialized) { \RMDT.PUSH("running FAN1") Store (\_SB.PCI0.LPCB.EC.FA2L, Local0) \RMDT.P2("[FAN1] FANL is ", Local0) Store (\_SB.PCI0.LPCB.EC.FA2H, Local1) \RMDT.P2("[FAN1] FANH is ", Local1) If (Local0) { Subtract (Local0, Local1, Local2) Multiply (Local2, 0x3E8, Local2) Store (Local2, Local0) } \RMDT.P2("[FAN1] returned Local0 value: ", Local0) Return (Local0) } }
And then kernel log buffer:
Code:ACPIDebug: "running FAN1" ACPIDebug: { "[FAN1] FANL is ", 0x0, } ACPIDebug: { "[FAN1] FANH is ", 0x0, } ACPIDebug: { "[FAN1] returned Local0 value: ", 0x0, } ACPIDebug: "running FAN1" ACPIDebug: { "[FAN1] FANL is ", 0x0, } ACPIDebug: { "[FAN1] FANH is ", 0x0, } ACPIDebug: { "[FAN1] returned Local0 value: ", 0x0, }
When I switch it so that "System Fan", "FAN0" is on the top, it'll read and evaluate FAN0. In this case, FAN1 makes up the first two entries in the package, so it evaluates those.
I'll DL the ACPISensors source code and add some traces to the code. The section in particular I'm eyeing is:
Code:// Parse tachometer table if (kIOReturnSuccess == acpiDevice->evaluateObject("TACH", &object) && object) { addSensorsFromArray(OSDynamicCast(OSArray, object), kFakeSMCCategoryFan); OSSafeRelease(object); } else ACPISensorsDebugLog("tachometer description table (TACH) not found");
If you have anything to make of this, please let me know! For now, I'll work on adding traces to ACPISensors source code...
-Duncan
ACPISensors::addSensorsFromArray definitely evaluates all entries returned from TACH:
Code:
...
for (UInt32 index = 0; index + 1 < array->getCount(); index += 2) {
...