Contribute
Register

Laptop won't sleep/shutdown after a few hours of uptime

Status
Not open for further replies.

vbo

Joined
Jul 13, 2014
Messages
284
I've had some more time to look into this, and try to understand how it actually works. The info below is how I currently understand it. If you skip it, patches are at the bottom. First one is required, second one fixes some issues while creating others (details below).

2 components involved: MEI driver (AppleIntelMEIDriver) and ME controller (AppleMEClientController), both packaged within the framebuffer kext.

As long as the driver can't write to the ME, sleep/shutdown after 3+ hours running is fixed. 2 ways to do that:
- Prevent the driver from starting by following 'disabled by plist' in AppleIntelMEIDriver::start()
- Prevent the driver from writing to ME by jumping over AppleIntelMEIDriver::writeMessageToME(). Note: make sure the call returns 0 or it creates load in the kernel, breaking speedstep (symptom: kernel_task stuck at ~7% cpu constantly).

At this point, some issues:
- Slow boot (adds ~15 seconds to boot)
- Coming back from sleep, screen is stuck at min brightness for a couple minutes.

The above issues disappear if the ME controller is disabled (i.e. prevented from starting). But that creates yet some other issues (hang with quicktime, slow opening of vlc). This is the current compromise I'm running (i.e., this is what the 2nd patch below does).

However, this means the issues of slow boot/low brightness are triggered in the controller (makes sense.. driver is probably called through the controller from the kernel/rest of the OS). Next step is to find a clean fix for these issues in the controller. So far:
- Patch AppleMEClientController::sendMessage --> no change
- Patch AppleMEClientController::sendCommon --> no change
More experimentation to be done, hopefully a clean fix can be found.

Patches for 10.10.3:
Code:
<dict>
	<key>Name</key>
	<string>AppleIntelFramebufferAzul</string>
	<key>Comment</key>
	<string>AppleIntelMEIDriver::writeMessageToME</string>
	<key>Find</key>
	<string>4883EC1844894DD04589C589CB</string>
	<key>Replace</key>
	<string>4883EC18E9E5010000909089CB</string>
</dict>
<dict>
	<key>Name</key>
	<string>AppleIntelFramebufferAzul</string>
	<key>Comment</key>
	<string>AppleMEClientController::start</string>
	<key>Find</key>
	<string>4885C00F8405030000488B05E50D0100488945D0</string>
	<key>Replace</key>
	<string>4885C0E90603000090488B05E50D0100488945D0</string>
</dict>
 
Joined
Feb 27, 2014
Messages
31
Motherboard
Acer Aspire E1-572-6870
CPU
Intel i5 5200U
Graphics
Intel HD 4400
Mobile Phone
  1. Android
Problem solved!

I had some more time to look into this problem the other day and I finally came up with a solution. I'm not sure why I didn't look into this before because it seems obvious, but nonetheless here it is:

Update your ME Firmware

We knew the issue resides in the ME itself, not OS X. While some people would rather look for a software solution than a firmware one because of the fear of bricking their computer, it is usually better to treat the disease and not the symptom. Also, updating the ME is one of the safer things you can do as long as you are careful. Of course, it is not without risk so make sure you know what you're doing. This page has everything you need: http://www.win-raid.com/t596f39-Intel-Management-Engine-Drivers-Firmware-amp-System-Tools.html.

The real beauty of it is that you don't need windows installed. I used FWUpdLcl for everything from version verification to flashing the new firmware. While I used a WinPE environment, you can use a DOS flash drive or possibly even clover itself as there is an efi version of the tool (I didn't test it!).

Hopefully this helps some people!
 

vbo

Joined
Jul 13, 2014
Messages
284
I had some more time to look into this problem the other day and I finally came up with a solution. I'm not sure why I didn't look into this before because it seems obvious, but nonetheless here it is:

Update your ME Firmware

We knew the issue resides in the ME itself, not OS X. While some people would rather look for a software solution than a firmware one because of the fear of bricking their computer, it is usually better to treat the disease and not the symptom. Also, updating the ME is one of the safer things you can do as long as you are careful. Of course, it is not without risk so make sure you know what you're doing. This page has everything you need: http://www.win-raid.com/t596f39-Intel-Management-Engine-Drivers-Firmware-amp-System-Tools.html.

The real beauty of it is that you don't need windows installed. I used FWUpdLcl for everything from version verification to flashing the new firmware. While I used a WinPE environment, you can use a DOS flash drive or possibly even clover itself as there is an efi version of the tool (I didn't test it!).

Hopefully this helps some people!

Thanks a lot for posting this! I didn't know it was possible to update the ME firmware. I just updated mine from the stock 9.5.20.1742 to the latest available 9.5.45.1922, removed all ME patches in Clover and will update after letting the laptop run for a few hours
The paranoid in me isn't too hot with the idea of flashing a binary firmware floating on the internet, but Intel is so secretive about the entire ME subsystem that it seems to be the only way to get the firmwares and required tools.

Update: Works perfect!
 
Joined
Feb 27, 2014
Messages
31
Motherboard
Acer Aspire E1-572-6870
CPU
Intel i5 5200U
Graphics
Intel HD 4400
Mobile Phone
  1. Android
Thanks a lot for posting this! I didn't know it was possible to update the ME firmware. I just updated mine from the stock 9.5.20.1742 to the latest available 9.5.45.1922, removed all ME patches in Clover and will update after letting the laptop run for a few hours
The paranoid in me isn't too hot with the idea of flashing a binary firmware floating on the internet, but Intel is so secretive about the entire ME subsystem that it seems to be the only way to get the firmwares and required tools.

Update: Works perfect!

Awesome, glad to hear it worked for you! I was on 9.5.13.I-Don't-Remember (go Acer! You're only 32 revisions behind). I'm kinda curious at what point Intel fixed the bug, but like you said, Intel is really secretive about the whole thing.

I'm just glad we finally solved this problem. Only took me 7 months, but persistence pays off :headbang:

Edit: What version of FwUpdLcl did you use (DOS/Windows/EFI)?
 

vbo

Joined
Jul 13, 2014
Messages
284
Awesome, glad to hear it worked for you! I was on 9.5.13.I-Don't-Remember (go Acer! You're only 32 revisions behind). I'm kinda curious at what point Intel fixed the bug, but like you said, Intel is really secretive about the whole thing.

I'm just glad we finally solved this problem. Only took me 7 months, but persistence pays off :headbang:

Edit: What version of FwUpdLcl did you use (DOS/Windows/EFI)?

I used the DOS version of the tools from a USB stick running FreeDOS.
 

vbo

Joined
Jul 13, 2014
Messages
284
It's pretty well explained on that website, but I'll paraphrase in a shorter form:
Start with section C1, and get Intel FWUpdate Tool for ME 9.5 Firmware v9.5.14.1724. Assuming you'll be using windows (adapt accordingly for DOS/EFI), open a command prompt as admin and run
Code:
FWUpdLcl -fwver
to confirm that you're running a 9.5 series firmware. If this checks out, get Intel ME 9.5 Consumer 1.5MB Firmware v9.5.45.1922 from section B1, and perform the update in the elevated command prompt by typing
Code:
FWUpdLcl -f WHEREVER_YOU_UNPACKED_THE_FIRMWARE\FIRMWARE_FILENAME.BIN
Reboot, and run FWUpdLcl -fwver again to check that the update was successful.
Note: No guarantee expressed or implied yada yada.. flashing a firmware carries inherent risks, and I am not responsible for any issue that may occur.
 
Joined
Jan 3, 2015
Messages
39
Motherboard
El Captain 10.11.1 (Clover r3320)
CPU
Intel Core i5 4200U
Graphics
Intel HD 4400
Mac
  1. MacBook Pro
Classic Mac
Mobile Phone
  1. Android
  2. iOS
Yes. A major one.

Your problem is fixed ;)

Yep, I can confirm that :)

Old FW ver. : 9.5.15.1730
New FW ver. : 9.5.45.1922

Untitled%20copy.png


Using FWUpdLcl64 Windows method

After upgrading my FW everything back to work as normal as it should be, Finally i have a normal behaviour OS X once again :)


Thnx @Vbo, @JVital2013
 
Joined
Nov 30, 2010
Messages
156
Motherboard
Alienware 17 M1
CPU
i7-8750H
Graphics
GTX 2070
Mac
  1. MacBook Pro
Classic Mac
  1. iMac
Mobile Phone
  1. iOS
It's pretty well explained on that website, but I'll paraphrase in a shorter form:
Start with section C1, and get Intel FWUpdate Tool for ME 9.5 Firmware v9.5.14.1724. Assuming you'll be using windows (adapt accordingly for DOS/EFI), open a command prompt as admin and run
Code:
FWUpdLcl -fwver
to confirm that you're running a 9.5 series firmware. If this checks out, get Intel ME 9.5 Consumer 1.5MB Firmware v9.5.45.1922 from section B1, and perform the update in the elevated command prompt by typing
Code:
FWUpdLcl -f WHEREVER_YOU_UNPACKED_THE_FIRMWARE\FIRMWARE_FILENAME.BIN
Reboot, and run FWUpdLcl -fwver again to check that the update was successful.
Note: No guarantee expressed or implied yada yada.. flashing a firmware carries inherent risks, and I am not responsible for any issue that may occur.

update worked for me - thanks for the info! will let it run for a few hours, and see if the shutdown issue exists.
 
Joined
Feb 27, 2014
Messages
31
Motherboard
Acer Aspire E1-572-6870
CPU
Intel i5 5200U
Graphics
Intel HD 4400
Mobile Phone
  1. Android
Guick note for those that don't have windows installed and aren't familiar with creating a DOS boot device: I just tested the EFI FwUpdLcl tool and it works like a charm through the Clover EFI shell. To use it:
  1. Drop FwUpdLcl.efi somewhere on your EFI partition
  2. Reboot and select Shell in Clover
  3. Navigate to FwUpdLcl.efi in the EFI shell (it works similar to DOS)
  4. Type "FwUpdLcl.efi <parameters>"


IMG_20150522_232802.jpg
 
Status
Not open for further replies.
Top