Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fan speed is slower than it should be after suspend (inconsistent, hard to reproduce) #243

Open
hamishmb opened this issue Dec 24, 2021 · 6 comments
Labels
needinfo Waiting for reporter feedback

Comments

@hamishmb
Copy link

Hi there,

Thanks for the great tool.

I have found that sometimes after suspend/hibernate on my Late 2013 Macbook Pro that the fans spin at a reduced rate or not at all when the CPU heats up. This only happens sometimes though, so I'm not sure how to debug it. I suspect that maybe there's a calculation error if the CPU is very hot when it suspends and then cool again once it wakes up after a while?

I did see the following after this when running systemctl status mbpfan:
mbpfan[1082]: Could not set fan speed: Input/output error

It looks like the error happened during the middle of going to sleep/resuming.

I'm happy to spend some time trying to debug this if you can give me some tips.

@gaul
Copy link
Member

gaul commented Dec 24, 2021

Are there any other dmesg or other errors? You can see what mbpfan is doing if you launch it without systemd and use mbpfan -v -f. One possibility is that something has changed with the underlying sysfs pseudo-files that confuses the fd caching that mbpfan does. Instead you can try to close and reopen the fds every time. Another possibility is that something happens with the time jumping forward or backward that confuses mbpfan. We could change the code to detect these situations and reset itself.

@hamishmb
Copy link
Author

I'll have a go at making it do it again and see :)

Is changing the fd behaviour possible through an option or something? I don't really know anything about fd caching.

@gaul
Copy link
Member

gaul commented Dec 25, 2021

The code is really simple: it opens a FILE* during startup and uses the same one over and over, calling pread on the fd to avoid reopening. EIO is a generic error code so this caching might obscure a more precise errno if you try reopening it instead.

@hamishmb
Copy link
Author

I'll try running it with debug and then suspending/resuming several times and see if anything interesting happens.

Will also send you dmesg output once I do that.

@gaul gaul added the needinfo Waiting for reporter feedback label Dec 28, 2021
@hamishmb
Copy link
Author

Apologies for the large delay, I'll try and get this reproduced soon.

@hamishmb
Copy link
Author

I no longer have the mac I was seeing this issue on, but I'll see if I can reproduce on an older Mac Mini (Late 2007) once I have repaired it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo Waiting for reporter feedback
Projects
None yet
Development

No branches or pull requests

2 participants