Repository navigation
Surface Book 3: Add thermal sensors and fans (main and base) - #190
Conversation
…eed for Surface Book 3 The Surface Book 3 EC provides the same thermal sensor (TMP, function 2) and fan speed (FAN, instance 1) interfaces as the newer devices that already list them, but the Surface Book 3 node group does not include them. Add both nodes so that surface_temp and surface_fan can bind. Tested on a Surface Book 3 (15", i7-1065G7) by registering the same two nodes from an out-of-tree module: surface_temp exposes the nine EC sensors (I_RTS1 to I_RTS8 and I_VTS1, names reported by the EC) and surface_fan reports the fan speed. The values match the raw EC readings obtained through the SSAM cdev. The fan maximum already follows the platform profile on this device (about 6000 to 8000 rpm from low-power to performance), so keep the platform profile node without the has_fan property. The analysis, the out-of-tree test module and this changelog were prepared with the help of an AI coding assistant (Claude, Anthropic). I reviewed the change and tested it on the device as described above. Link: linux-surface#117 Signed-off-by: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
On the Surface Book 3, the base (keyboard and peripheral controller, KIP) has its own set of thermal sensors behind the same TMP interface as the ones on the main controller (SAM). Add a match entry for the KIP target so that the driver can bind to such a node. Devices only get a TMP node on the KIP target if the registry lists one for them, so this does not change anything for other devices. Tested on a Surface Book 3 (15", i7-1065G7) with the registry node from the next patch, registered from an out-of-tree module: the driver binds and exposes the nine base sensors (I_RTS1 to I_RTS8 and I_VTS1, names reported by the EC). The analysis, the out-of-tree test module and this changelog were prepared with the help of an AI coding assistant (Claude, Anthropic). I reviewed the change and tested it on the device as described above. Link: linux-surface#117 Signed-off-by: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
…urface Book 3 The Surface Book 3 base provides a second set of thermal sensors on the KIP target. Add the node below the base hub, like the other base devices, so that it is removed when the clipboard is detached and added again on attach, and so that surface_temp can bind to it. On Windows, the skin temperature of the base (I_VTS1 on KIP) is the input of the power management loop that limits the dGPU. Tested on a Surface Book 3 (15", i7-1065G7) by registering the same node below the base hub from an out-of-tree module, together with the surface_temp match entry from the previous patch: a second surface_thermal hwmon device appears with the nine base sensors. Both hwmon devices report the same sensor names, as provided by the EC; they can be told apart by their device path. The analysis, the out-of-tree test module and this changelog were prepared with the help of an AI coding assistant (Claude, Anthropic). I reviewed the change and tested it on the device as described above. Link: linux-surface#117 Signed-off-by: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
The Surface Book 3 base (keyboard and peripheral controller, KIP) has two fans of its own, with the same FAN interface as the fan on the main controller (SAM), on instances 1 and 2. Add match entries for them so that the driver can bind to such nodes. Devices only get FAN nodes on the KIP target if the registry lists them, so this does not change anything for other devices. Tested on a Surface Book 3 (15", i7-1065G7) with the registry nodes from the next patch, registered from an out-of-tree module: the driver binds to both base fans. They report 0 rpm at idle; under dGPU load, the raw EC readings through the SSAM cdev showed both fans at about 2700 rpm after roughly two minutes. The analysis, the out-of-tree test module and this changelog were prepared with the help of an AI coding assistant (Claude, Anthropic). I reviewed the change and tested it on the device as described above. Link: linux-surface#117 Signed-off-by: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
The Surface Book 3 base has two fans on the KIP target (instances 1 and 2), which start up under dGPU load. Add their fan speed nodes below the base hub, like the other base devices, so that surface_fan can bind to them. Tested on a Surface Book 3 (15", i7-1065G7) by registering the same nodes below the base hub from an out-of-tree module, together with the surface_fan match entries from the previous patch: two more surface_fan hwmon devices appear for the base fans. The analysis, the out-of-tree test module and this changelog were prepared with the help of an AI coding assistant (Claude, Anthropic). I reviewed the change and tested it on the device as described above. Link: linux-surface#117 Signed-off-by: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
|
Friendly ping. I re-checked the impact on other models:
Options: keep it as is and ask a 13.5" owner to test, or let |
|
Thanks!
I think that should be fine. Unless there's something that requires different names, but at the moment I'm not aware of anything.
I think let's maybe try and merge this. If we see some fallout (e.g. timeouts, zero readings) we have to check if there's any way to detect the 13.5 variant or the number of fans (similar to number of thermal sensors). But that might be easier to fix once we have it in the packages. |
The Surface Book 3 has thermal sensors and a fan speed interface on its EC, but its registry node group doesn't list them, while newer devices already do. The base has its own thermal sensors and two fans, on the KIP (keyboard and peripheral controller) target. So far
surface_tempandsurface_fanonly match SAM.This PR has five commits:
ssam:01:03:01:00:02,ssam:01:05:01:01:01), the same nodes as on the newer devices.surface_tempandsurface_fanthen bind.surface_temp: match entry for KIP (SSAM_SDEV(TMP, KIP, 0x00, 0x02)). A device only gets a TMP node on KIP if the registry lists one for it, so this changes nothing for other devices. For example, the Pro 8 type cover is on KIP too, but has no TMP node.ssam:01:03:02:00:02), below the base hub like the other base devices. They go away on detach and come back on attach.surface_fan: match entries for KIP, instances 1 and 2. Same reasoning as 2.ssam:01:05:02:01:01,ssam:01:05:02:02:01), also below the base hub.Testing (Surface Book 3 15", i7-1065G7, kernel 7.2.15-1-surface): I registered the same nodes from an out-of-tree module, the base nodes below the base hub. For commits 2 and 4, I built
surface_tempandsurface_fanfrom the 7.2 sources with the extra match entries.surface_tempexposes the nine sensors (I_RTS1–I_RTS8,I_VTS1, names reported by the EC). They match the raw EC readings through the SSAM cdev.surface_fanreports the fan speed.surface_fanbinds to both base fans. They report 0 rpm at idle. Under dGPU load (about 60 W), the raw EC readings through the SSAM cdev showed both at about 2700 rpm after roughly two minutes, at a GPU temperature of 86 °C. The NVIDIA driver itself reports 0 % fan.surface_thermaldevice appears below the base hub with the base's nine sensors. Right after a CPU and GPU load run, the values were plausible: mainI_VTS142.7 °C, baseI_VTS130.7 °C.checkpatch.pl --strictreports no errors, warnings or checks for any of the five commits.Something to be aware of: both thermal hwmon devices are called
surface_thermaland report the same sensor names, because the EC provides those names. The three fans are allsurface_fan. They can be told apart by the device path (…/01:03:01:00:02vs.…/00:00:01:11:00/01:03:02:00:02). If you'd prefer different hwmon names or labels for the base, I can change that.The fan maximum already follows the platform profile on this device (about 6000–8000 rpm from low-power to performance), so the platform profile node stays without
has_fan. I also sent the fan profile command thathas_fanadds (FAN cid 0x0e, values 1–4) under load. The EC accepts it, but neither the fan maximum nor the ramp changes.Why the base sensors matter: on Windows, the Surface power management (SMF) regulates on the skin sensors. The main
I_VTS1limits the CPU, and the baseI_VTS1limits the dGPU. A user-space implementation of the same behaviour is in progress (linux-surface/linux-surface#2383), and on the SB3 it now reproduces the Windows CPU limits under load. Background and measurements: #117.Once this is accepted here, I'd be glad to help get it upstream as well. Mainline's SB3 node group has the same gap.
The analysis, the test modules and the changelogs were prepared with the help of an AI coding assistant (Claude, Anthropic). I reviewed the changes and tested them on the device as described.