Summary: | Add asmc support for MacBookPro10,1, MacMini6,2, and MacBookPro8,3 | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | ed crowe <fbsdbug> | ||||
Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
Status: | Open --- | ||||||
Severity: | Affects Some People | CC: | jwb, mondo.debater_0q | ||||
Priority: | --- | ||||||
Version: | 13.2-RELEASE | ||||||
Hardware: | amd64 | ||||||
OS: | Any | ||||||
Attachments: |
|
Used this patch on a mid-2012 MBP Retina running 14-STABLE to adjust the fan speeds. Quite pleased to find it as the unit runs a bit too warm without the battery. Comment on attachment 243679 [details]
asmc patch for macmini6, macbookpro10,1, and macbookpro8,3
Attempting to extend this to the MacBook Pro 8,3, I added the following to asmc.c:
{
"MacBookPro8,3", "Apple SMC MacBook Pro (2011, 17 inch)",
ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS,
ASMC_MBP82_TEMPS, ASMC_MBP82_TEMPNAMES, ASMC_MBP82_TEMPDESCS
},
I'm not sure how to determine the features in order to create ASMC_MBP83TEMP*, but using the 8,2 features, it seems to mostly work:
FreeBSD marlin.acadix bacon ~ 1001: sysctl dev.asmc.0.temp
dev.asmc.0.temp.Ts0S: 38
dev.asmc.0.temp.Ts0P: 26
dev.asmc.0.temp.memory: 40
dev.asmc.0.temp.Th2H: 42
dev.asmc.0.temp.Th1H: 44
dev.asmc.0.temp.wireless: 129
dev.asmc.0.temp.TPCD: 55
dev.asmc.0.temp.TP0P: 50
dev.asmc.0.temp.TMBS: 0
dev.asmc.0.temp.TM0S: 55
dev.asmc.0.temp.THSP: 37
dev.asmc.0.temp.TG0P: 46
dev.asmc.0.temp.graphics: 51
dev.asmc.0.temp.TCTD: 255
dev.asmc.0.temp.TCSA: 51
dev.asmc.0.temp.TCGC: 56
dev.asmc.0.temp.TCFC: 0
dev.asmc.0.temp.TC4C: 54
dev.asmc.0.temp.TC3C: 55
dev.asmc.0.temp.TC2C: 56
dev.asmc.0.temp.TC1C: 53
dev.asmc.0.temp.TC0P: 49
dev.asmc.0.temp.TC0F: 57
dev.asmc.0.temp.TC0E: 56
dev.asmc.0.temp.TC0D: 51
dev.asmc.0.temp.TC0C: 56
dev.asmc.0.temp.TB2T: 27
dev.asmc.0.temp.TB1T: 29
dev.asmc.0.temp.enclosure: 29
FreeBSD marlin.acadix bacon ~ 1001: sysctl dev.asmc
dev.asmc.0.sms.z: 255
dev.asmc.0.sms.y: -39
dev.asmc.0.sms.x: -6
dev.asmc.0.light.control: 0
dev.asmc.0.light.right: 0
dev.asmc.0.light.left: 0
dev.asmc.0.temp.Ts0S: 40
dev.asmc.0.temp.Ts0P: 28
dev.asmc.0.temp.memory: 42
dev.asmc.0.temp.Th2H: 44
dev.asmc.0.temp.Th1H: 46
dev.asmc.0.temp.wireless: 129
dev.asmc.0.temp.TPCD: 57
dev.asmc.0.temp.TP0P: 51
dev.asmc.0.temp.TMBS: 0
dev.asmc.0.temp.TM0S: 56
dev.asmc.0.temp.THSP: 38
dev.asmc.0.temp.TG0P: 48
dev.asmc.0.temp.graphics: 52
dev.asmc.0.temp.TCTD: 0
dev.asmc.0.temp.TCSA: 55
dev.asmc.0.temp.TCGC: 59
dev.asmc.0.temp.TCFC: 0
dev.asmc.0.temp.TC4C: 56
dev.asmc.0.temp.TC3C: 58
dev.asmc.0.temp.TC2C: 59
dev.asmc.0.temp.TC1C: 56
dev.asmc.0.temp.TC0P: 51
dev.asmc.0.temp.TC0F: 59
dev.asmc.0.temp.TC0E: 58
dev.asmc.0.temp.TC0D: 54
dev.asmc.0.temp.TC0C: 58
dev.asmc.0.temp.TB2T: 29
dev.asmc.0.temp.TB1T: 32
dev.asmc.0.temp.enclosure: 32
dev.asmc.0.fan.1.targetspeed: 2000
dev.asmc.0.fan.1.maxspeed: 5500
dev.asmc.0.fan.1.minspeed: 2000
dev.asmc.0.fan.1.safespeed: -1
dev.asmc.0.fan.1.speed: 1996
dev.asmc.0.fan.1.id: Right side
dev.asmc.0.fan.0.targetspeed: 2000
dev.asmc.0.fan.0.maxspeed: 5500
dev.asmc.0.fan.0.minspeed: 2000
dev.asmc.0.fan.0.safespeed: -1
dev.asmc.0.fan.0.speed: 2001
dev.asmc.0.fan.0.id: Left side
dev.asmc.0.%parent: acpi0
dev.asmc.0.%pnpinfo: _HID=APP0001 _UID=0 _CID=SMC-HURONRIVER
dev.asmc.0.%location: handle=\_SB_.PCI0.LPCB.SMC_
dev.asmc.0.%driver: asmc
dev.asmc.0.%desc: Apple SMC MacBook Pro (2011, 17 inch)
dev.asmc.%parent:
FYI, now that asmc is recognizing my model, I'm getting the following error repeating in dmesg: asmc0: unknown interrupt: 0x2a (In reply to Jason W. Bacon from comment #3) Hi Jason, Take a look at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265005 The final comment has a link to a previous patch that's been applied. In /sys/dev/asmc/asmc.c the MacBookPro6,2 model number is hardcoded to suppress that interrupt message. (0x2a is triggered by the light sensor). + case ASMC_ALSL_INT2A: + /* + * This suppresses console and log messages for the ambient + * light sensor for the only model known to generate this + * interrupt. + */ + if (strcmp(sc->sc_model->smc_model, "MacBookPro6,2") == 0) + break; + /* FALLTHROUGH */ Also, I don't think this site is being watched for patches anymore considering how long this bug/patch has been sitting here. You might have better luck submitting it on gitHub: https://freebsdfoundation.org/submitting-github-pull-requests-to-freebsd/ (In reply to ed crowe from comment #4) > Also, I don't think this site is being watched for patches anymore considering > how long this bug/patch has been sitting here. There is no doubt that FreeBSD has a huge backlog of bug reports. But the facts are that in the last 90 days, in Base System PRs: 95 have come in, and 354 have been closed. We are also doing better on clearing new PRs as they come in, in all the categories, and that has been our priority. The overall count of 11071 is lower than it has been in quite some time. Of course, it is substantial. Not everything is going to change overnight. (In reply to ed crowe from comment #4) Thanks, updating to case ASMC_ALSL_INT2A: /* * This suppresses console and log messages for the ambient * light sensor for models known to generate this interrupt. */ if (strcmp(sc->sc_model->smc_model, "MacBookPro5,5") == 0 || strcmp(sc->sc_model->smc_model, "MacBookPro6,2") == 0 || strcmp(sc->sc_model->smc_model, "MacBookPro8,3") == 0) break; has silenced the log messages. I'll give some thought to a pull request, but I'd like to improve on the rest of the patch first. Most of the values of dev.asmc look reasonable, but I don't even know what some of them represent, or if they're relevant to this model, e.g. dev.asmc.0.temp.TCTD: 0 dev.asmc.0.fan.1.safespeed: -1 dev.asmc.0.light.control: 0 I'll see if I can dig up some info on this. (In reply to Mark Linimon from comment #5) Hi Mark, Sorry. I did not mean for my comment to sound like a complaint. I can see how it does. The article I linked to states that this site should be for bugs, and to use gitHub for patches. I kind of assumed this patch fell through the transition. I am incredibly grateful for all the hard work that goes into creating and maintaining this amazing system - for free (which is why I donate a bit) and I really appreciate it. Thank you. <old man rambling you can ignore> I started off using 2.1, and had a website on DEC Alphas up through 5.x back at the turn of the century. Unfortunately, my day job dragged me into Solaris and Linux, and now cloud/k8s/containers and it is all incredibly boring. I've enjoyed coming home to FreeBSD over the last few years on a personal level. I moved since submitting this, and am still physically building out my lab - as in framing walls. I had planned on resubmitting this at gitHub against -CURRENT once i got the Mac Mini online again, which should be soon. </old man rambling you can ignore> (In reply to Jason W. Bacon from comment #6) Hi Jason, In the comments from this forum post, there is a zip file with a macOS binary that will dump the SMC key/values: https://forums.freebsd.org/threads/macbook7-1-asmc-support.76497/ From what I remember it is really slow, but does work. Give it time. I also just saw this, but never tried it: https://github.com/dkorunic/iSMC (In reply to ed crowe from comment #8) Thanks, but unfortunately, those tools only work on macOS, and this is a FreeBSD-only install. I'll see if I can find the SMC info for this model elsewhere. |
Created attachment 243679 [details] asmc patch for macmini6, macbookpro10,1, and macbookpro8,3 Hello, I used the macOS smcdump utility to get the T* values for a MacBookPro10,1 and a MacMini6,2. I've been running with this patch on each machine for a few weeks and have not had any issues. If you want me to split the patch out for each machine type and resubmit, please let me know.