Contribute
Register

[solved] [Kaby Lake] Lenovo Y520: Slow MacOS after sleep/wake

Status
Not open for further replies.
Joined
Feb 17, 2012
Messages
156
CPU
i5-7300HQ
Graphics
HD 630 + GTX 1050 Ti
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS

Attachments

  • debug_2572.zip
    2.1 MB · Views: 55
After sleep/wake macOS is very slow and unusable. Audio sometimes distorts. The issue(s) seems similar to this thread:
https://www.tonymacx86.com/threads/sleep-issue-after-wake-lenovo-ideapad-320-kabylake-hd620.255614/

I have tried VoodooTSCSync.kext but somehow it does not load. Using kextload, it does loads but the issue remains.

I have attached PR files.
Your laptop has a guide: https://www.tonymacx86.com/threads/guide-lenovo-legion-y520-y720-using-clover-uefi.261009/
 
@braveknight I followed your guide and your repo at GitHub, this is the problem I am left with. Earlier I used to diagnose and debug problems on my own but current working environment restricts my time for the same, hence, I am no longer a tester for such things anymore. Appreciate if PR files could reveal something and obvious for me to test
 
@braveknight I followed your guide and your repo at GitHub, this is the problem I am left with. Earlier I used to diagnose and debug problems on my own but current working environment restricts my time for the same, hence, I am no longer a tester for such things anymore. Appreciate if PR files could reveal something and obvious for me to test
Slow system after sleep/wake usually indicates TSC problem. The current workaround is to install VoodooTSCSync.kext with the correct number of logical cores in Info.plist IOCPUNumber (3 for your CPU).
 
Slow system after sleep/wake usually indicates TSC problem. The current workaround is to install VoodooTSCSync.kext with the correct number of logical cores in Info.plist IOCPUNumber (3 for your CPU).

I wonder if this is something that should be added to the CPU PM guide.
 
I wonder if this is something that should be added to the CPU PM guide.
I don't think so. When I researched about the problem earlier when I got this laptop, and after some testing and debugging, I found out that it is a bug in the BIOS or the machine's firmware where it caused TSCs to be out of sync after each sleep/wake cycle. The proper solution would be to fix the BIOS by patching it. But as you know, Lenovo has a very strict BIOS. I couldn't even set the DVMT via setup_var. So I found this workaround.

However, I would love to see a different solution or a new kext (maybe a Lilu plugin?) to fix this issue without having to specify IOCPUNumber manually inside the kext's Info.plist. But unfortunately, I have no knowledge in macOS kext development.
 
Fixed! Correcting CPU number fixed the issue. Thanks @the-braveknight

I have 1 other minor issue:
Keyboard Numpad is not working instead numpad keys are treated as extended or Mac specific keys. I have 2 set of brightness keys now. The ACPI keys and numpad 4/- for brightness +/-.

@RehabMan I am using your version of VoodooPS2Controller.kext

Also, audio jack detection is not working after sleep/wake
 

Attachments

  • debug_32374.zip
    2.2 MB · Views: 55
I don't think so. When I researched about the problem earlier when I got this laptop, and after some testing and debugging, I found out that it is a bug in the BIOS or the machine's firmware where it caused TSCs to be out of sync after each sleep/wake cycle. The proper solution would be to fix the BIOS by patching it. But as you know, Lenovo has a very strict BIOS. I couldn't even set the DVMT via setup_var. So I found this workaround.

However, I would love to see a different solution or a new kext (maybe a Lilu plugin?) to fix this issue without having to specify IOCPUNumber manually inside the kext's Info.plist. But unfortunately, I have no knowledge in macOS kext development.

It was not difficult to automatically detect the last CPU and attach only to that node.
Work is here: https://github.com/RehabMan/VoodooTSCSync
(I did a bit of cleanup to the code as well)

No built binary on bitbucket, but I suppose I could do that if there was demand for it.
Perhaps you can test to see if it still does what you need... (I have no hardware that needs VoodooTSCSync).
 
It was not difficult to automatically detect the last CPU and attach only to that node.
Work is here: https://github.com/RehabMan/VoodooTSCSync
(I did a bit of cleanup to the code as well)

No built binary on bitbucket, but I suppose I could do that if there was demand for it.
Perhaps you can test to see if it still does what you need... (I have no hardware that needs VoodooTSCSync).
That is great. Thanks!
I am on holiday now, I will test it when I get back tomorrow and report back.

Also, perhaps you could remove AMD related code (it was added by the modded fork that you used as your base). This will clean the code furthermore.
 
@RehabMan Is there anywhere where I can read more about the TSC issue?

edit*

I decided to build and compile the VoodooTSCSync kext, as I had similar issues, the new kext seems to have fixed them.
 
Last edited:
Status
Not open for further replies.
Back
Top