-
Notifications
You must be signed in to change notification settings - Fork 139
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
Add support for alternate applesmc module device path. #236
Conversation
Could we get this merged? This fixes |
@gaul The debian/ubuntu packages are broken on newer kernels w/o this fix. |
@@ -52,6 +53,7 @@ | |||
|
|||
#define CORETEMP_PATH "/sys/devices/platform/coretemp.0" | |||
#define APPLESMC_PATH "/sys/devices/platform/applesmc.768" | |||
#define ALT_APPLESMC_PATH "/sys/bus/acpi/drivers/applesmc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the new, preferred path, or just some weird quirk of Debian/Ubuntu?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the MacBookPro11,3, /sys/devices/platform/applesmc.768
is still being used, and /sys/bus/acpi/drivers/applesmc
is empty, but since that is a mid-2014 machine, things may be different for newer macs.
(I will say that the stock mbpfan
package available in ubuntu 22.04 was not working to set the fan speed on my MacBookPro11,3 though, whereas building with this patch does set the fan speeds according to my settings in the mbpfan.conf
file.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(so maybe one of the other changes... or doing a rebuild for 22.04 made the package work.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested my MacBook Air 2014 with 5.16.8-200.fc35.x86_64 and /sys/devices/platform/applesmc.768
has the files that mbpfan
needs. Does kernel 5.17 change this path? Can you point me to the Linux commit that changes this? The original PR talks about kernel 5.13 -- what am I missing here?
This is what I see on my ubuntu system:
And using the binary from this PR:
|
my
The fan does seem to be increasing with increased CPU temps though using the packaged |
Please do not use the tests to inform yourself about any successful operation of mbpfan. These were written long ago for a single device and do not work reliably for others. These were removed in 52d8973 almost 2 years ago to reduce user confusion. I am not clear how you are even running them on this PR as you suggest. I am happy to merge PRs that address real issues. But I cannot merge what I don't understand. I don't understand the symptom you are trying to report here but it appears that mbpfan successfully found the applesmc path in both instances. |
@robabram I like this pull request, but just to check, is "5.13.12-200.mbp15.fc33.x86_64" a stock kernel and applesmc module or a modified one? If stock, the path "/sys/devices/platform/applesmc.768" no longer exists? |
Currently we get people on T2 macs to use this fork https://github.com/networkException/mbpfan, but if you can support both paths then we can just tell people to use this repo instead of the fork, which makes it much simpler. |
Thank you for your contribution @robabram and for your explanation @Redecorating! 2.4.0 includes this commit. |
In newer versions of Linux and/or Apple devices, the applesmc module uses a different "/sys/devices" path to map the fan controller to. This seems to be due to changes in how ACPI devices are mapped to the "/sys/devices" directory.
changes
If the original hardcoded "applesmc" device path is not found, dynamically look for the device path to the "applesmc" device root by searching sub-directories of "/sys/bus/acpi/drivers/applesmc". Once the device path has been found, setup the fan device path root.
testing
Tested on Macbook Pro 2019 (16,1), Fedora 33, Kernel: 5.13.12-200.mbp15.fc33.x86_64