The EC, or more specifically the EC firmware, is the bane of my existence when it comes to shitty laptops I had to deal with in the past.
On some laptops you have zero fan control exposed to the OS like on the PC motherboards, so you need to pray the manufacturer implemented some sane fan curves that makes the fans silent when idling but keeps the CPU cool under load and has some hysteresis to prevent the fans from ramping up/down (pulsating) too often or it gets annoying.
Spoiler alert, most laptop makers got their fan curves totally wrong, and you had no way to manually adjust them. I ended up returning about half a dozen otherwise good laptops in my life due to shitty fan curves with no manual override that would just pulse their fans up and down with every JS heavy browser tab opened and closed.
I wish Microsoft had forced the laptop makers to expose EC fan control to the OS so that the OS can control the fans (like how MacOS does) through a standardized and documented API that would also work in Linux. If you think about it, it totally make sense for the OS to control the fans, instead of the EC, as the OS knows far more about the system usage and patterns, vs the EC which knows just the current temperature and CPU power/load.
I feel it's better nowadays than it used to be, newer laptops from reputable makers like Dell and Lenovo from 2020 upwards seem to have some effort put into the tuning of their fan curves and have less jarring transitions.
Also, another pain point, AFAIK, the interaction with the EC is the reason why most modern laptops' sleep is broken and they don't really sleep and start burning in your backpack.
The EC retains control of the fans because an OS process could crash, starve, or otherwise fail to do its job in a timer manner. Without that code running, the hardware cooks itself.
That said, the OS could have been allowed to give its input into the situation, and that might have solved a lot of these problems.
Moreover, I think this serves as example of why we collectively need to advocate for rights to repair/tinker, as some of these EC firmwares could be updated. Sadly, many are burned into ROM, so the only sane choice there would be to avoid the purchase in the first place.
>The EC retains control of the fans because an OS process could crash, starve, or otherwise fail to do its job in a timer manner. Without that code running, the hardware cooks itself.
I mean, there's no reason why the EC can't be the default and the emergency fallback for fan control and the OS takes over after boot. Apple got this working on Intel MacBooks, I'm sure Windows and Dell/Lenovo could too if they wanted to.
This reminded me of a recent talk: USENIX ATC '21/OSDI '21 Joint Keynote Address-It's Time for Operating Systems to Rediscover Hardware:
https://www.youtube.com/watch?v=36myc8wQhLo
At 9:00 the speaker lays out some pretty conventional criteria for an operating system (multiplex hardware resources, abstract the hardware platform, protect software principals from each other), and points out that these things are increasingly outside the scope of what people call "the OS". https://imgur.com/dODDwnQ
This talk is fantastic and terrifying. I was aware that there were other processors running firmwares but I had no idea it was this bad. I really don't like knowing that I'm not really in control of the machine.
I suppose the best we can do now is to somehow load free software onto these hidden chips and completely replace the proprietary firmware. That won't be possible if they start locking the chips down so they only accept signed code...
I too had major problems with my laptop due to the embedded controller. I managed to reverse engineer some USB features but the EC and ACPI stuff stopped me from achieving fan control. The default curves are bad but customizable through a horrible manufacturer application that only runs on Windows. To this day I wonder how that application communicates with this thing.
>a horrible manufacturer application that only runs on Windows
Shit like this plus the lack of S3 sleep, is why my laptop is still on Windows 11 instead of Linux. As horrible as the Lenovo vantage app is, it allows me to configure the TDP of the Ryzen CPU and fan profile of the device plus enable battery conservation mode where it keeps the battery charged to 50-60% while plugged in to reduce wear. On Linux I have no easy way to control these features my Laptop has except some obscure scripts from various reddit and forum posts and github repos that were written to work on some Lenovo machines. No bueno.
Yeah, it sucks. In my case, the manufacturer program is so incredibly bloated it would take literally minutes to display a window on screen. I have no idea how that's even possible. My quality of life significantly improved after I ported what I could to Linux.
This software must be talking to this controller somehow. Apparently there is an ACPI mechanism that allows reading and writing to EC registers. I never figured out a way to intercept this I/O. Do you know a way?
> Apparently there is an ACPI mechanism that allows reading and writing to EC registers. I never figured out a way to intercept this I/O. Do you know a way?
Do you mean intercept the I/O from the OS to the EC in Windows so you can replicate the same functionality in Linux? Not sure, as Windows has drivers for these features provided by the laptop makers.
I guess you could use Process Monitor[1] or other SysInternal tools[2] to see what's going on in Windows when you play with various EC functions.
On Linux you can find various resources regarding the ACPI calls for EC functionality on the Arch Wiki for various laptops[3][4][5] (usually the most popular ThinkPads) and work your way from there.
> This suggests that there is some POST card that can be plugged into an m.2 connector to debug boot issues. Since I know the protocol, i tried making my own version (basically two daisy-chained shift registers connected to the 7-segment displays).
What a pity that didn't work the first try. Im glad they included the picture of the thing tho.
On some laptops you have zero fan control exposed to the OS like on the PC motherboards, so you need to pray the manufacturer implemented some sane fan curves that makes the fans silent when idling but keeps the CPU cool under load and has some hysteresis to prevent the fans from ramping up/down (pulsating) too often or it gets annoying.
Spoiler alert, most laptop makers got their fan curves totally wrong, and you had no way to manually adjust them. I ended up returning about half a dozen otherwise good laptops in my life due to shitty fan curves with no manual override that would just pulse their fans up and down with every JS heavy browser tab opened and closed.
I wish Microsoft had forced the laptop makers to expose EC fan control to the OS so that the OS can control the fans (like how MacOS does) through a standardized and documented API that would also work in Linux. If you think about it, it totally make sense for the OS to control the fans, instead of the EC, as the OS knows far more about the system usage and patterns, vs the EC which knows just the current temperature and CPU power/load.
I feel it's better nowadays than it used to be, newer laptops from reputable makers like Dell and Lenovo from 2020 upwards seem to have some effort put into the tuning of their fan curves and have less jarring transitions.
Also, another pain point, AFAIK, the interaction with the EC is the reason why most modern laptops' sleep is broken and they don't really sleep and start burning in your backpack.