Contribute
Register

[Guide] Using Clover to "hotpatch" ACPI

Joined
Jan 25, 2017
Messages
8
Motherboard
MSI GP62 Clover
CPU
i7-6700HQ
Graphics
HD530
Mobile Phone
iOS
Could anyone teach me why _INI would be called even if it was not in the SSDT originally?

By using this SSDT,
Code:
DefinitionBlock("", "SSDT", 2, "hack", "DGPU", 0)
{
    External(_SB.PCI0.PEG0.PEGP._OFF, MethodObj)
    Method(_SB.PCI0.PEG0.PEGP._INI) { _OFF() }
}
My MSI laptop disable eGPU successfully at startup, but after it sleep and wake, the eGPU is on again.
Is there a way to fix this?
I simply add _OFF in my SSDT's _WAK and rename the origin _WAK to XWAK, and it fixes the eGPU on after wake problem.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,927
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,927
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
I simply add _OFF in my SSDT's _WAK and rename the origin _WAK to XWAK, and it fixes the eGPU on after wake problem.
Just like SSDT-PTSWAK.dsl...
 
Joined
Jul 12, 2017
Messages
2
CPU
i7-7700HQ/HM175
Graphics
GTX 1060 + HD 630
Mac
MacBook Pro
Hello Rehabman, everybody,

I've patched with luck the battery status via hotpatch but I'm still experiencing this weird issue, probably connected with my custom SSDT code:

sometimes, on discharging phase, happend like one plug and immediatly unplug the charger cable while this is not phisically happening... I have the proper sound and also brightness changing of this procedure in that quick moment.

Checked the code many and many times but my knowledge on ACPI patching is limited to your (rehabman) posts.


attatched the requested file,
Thanks really for your work
 

Attachments

Feartech

Moderator
Joined
Aug 3, 2013
Messages
10,338
Motherboard
Asus N752VX-Clover
CPU
i7-6700HQ / HM170
Graphics
HD530 + GTX 950m 1920 x 1080
Mac
iMac
Mobile Phone
Android
Hello Rehabman, everybody,

I've patched with luck the battery status via hotpatch but I'm still experiencing this weird issue, probably connected with my custom SSDT code:

sometimes, on discharging phase, happend like one plug and immediatly unplug the charger cable while this is not phisically happening... I have the proper sound and also brightness changing of this procedure in that quick moment.

Checked the code many and many times but my knowledge on ACPI patching is limited to your (rehabman) posts.


attatched the requested file,
Thanks really for your work
MacBookPro14,1 would be a better choice

FakeSMC.kext seems to be missing from /Library/Extensions for some reason?


How and where to install kexts:
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,927
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Hello Rehabman, everybody,

I've patched with luck the battery status via hotpatch but I'm still experiencing this weird issue, probably connected with my custom SSDT code:

sometimes, on discharging phase, happend like one plug and immediatly unplug the charger cable while this is not phisically happening... I have the proper sound and also brightness changing of this procedure in that quick moment.

Checked the code many and many times but my knowledge on ACPI patching is limited to your (rehabman) posts.


attatched the requested file,
Thanks really for your work
Different result with static patch?
 
Joined
Jul 12, 2017
Messages
2
CPU
i7-7700HQ/HM175
Graphics
GTX 1060 + HD 630
Mac
MacBook Pro
Different result with static patch?
Yes but maybe I kept the static patch for a too short time to observe the syntom.


MacBookPro14,1 would be a better choice

FakeSMC.kext seems to be missing from /Library/Extensions for some reason?


How and where to install kexts:
FakeSMC.kext was missing from /L/E for my ignorance, now thanks to your post and guide the overall system stability get a hugely improvement and other minor issues are also disappered. Still testing the battery status, but fingers cross, seems ok for now.

Thanks both
 
Joined
Dec 10, 2013
Messages
152
Motherboard
Huawei Matebook D 2017
CPU
i5-7200U
Graphics
HD 620
Hi,
i'm trying to create an hotpach for my brightness key. I already applied the code on my DSDT to check if it works and it's ok.

Code:
Method (_Q01, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0405) //DOWN
        }
Method (_Q02, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0406) //UP
        }
If i apply that code directly in the DSDT i can control brightness using my keyboard.
I then have created an hotpatch like this :
Code:
DefinitionBlock ("", "SSDT", 2, "hack", "BRIG", 0x00000000)
{
    External(_SB.PCI0.LPCB.EC, DeviceObj)
    External(_SB.PCI0.LPCB.PS2K, DeviceObj)
    Scope(_SB.PCI0.LPCB.EC)
    {
        Method (_Q01, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0405) //DOWN
        }
        Method (_Q02, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0406) //UP
        }
    }
}
and renamed in Clover _Q01 to XQ01 and _Q02 to XQ02 but it doesn't work.
To check if the problem was the hotpach or the renaming in clover i inserted again the DSDT leaving the hotpatch.aml too.
If the rename was working clover should have renamed _Q01 to XQ01 so the brightness should have not work even if the patched DSDT was there (right ?) but it works.
So i think is the rename not working but i don't know why.

Could someone please help me ?


EDIT : Solved. I was making a mistake in the Method. it should have been just PS2K instead of \_SB.PCI0.LPCB.PS2K
 

Attachments

Last edited:

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,927
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Hi,
i'm trying to create an hotpach for my brightness key. I already applied the code on my DSDT to check if it works and it's ok.

Code:
Method (_Q01, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0405) //DOWN
        }
Method (_Q02, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0406) //UP
        }
If i apply that code directly in the DSDT i can control brightness using my keyboard.
I then have created an hotpatch like this :
Code:
DefinitionBlock ("", "SSDT", 2, "hack", "BRIG", 0x00000000)
{
    External(_SB.PCI0.LPCB.EC, DeviceObj)
    External(_SB.PCI0.LPCB.PS2K, DeviceObj)
    Scope(_SB.PCI0.LPCB.EC)
    {
        Method (_Q01, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0405) //DOWN
        }
        Method (_Q02, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0406) //UP
        }
    }
}
and renamed in Clover _Q01 to XQ01 and _Q02 to XQ02 but it doesn't work.
To check if the problem was the hotpach or the renaming in clover i inserted again the DSDT leaving the hotpatch.aml too.
If the rename was working clover should have renamed _Q01 to XQ01 so the brightness should have not work even if the patched DSDT was there (right ?) but it works.
So i think is the rename not working but i don't know why.

Could someone please help me ?


EDIT : Solved. I was making a mistake in the Method. it should have been just PS2K instead of \_SB.PCI0.LPCB.PS2K
The problem is your config.plist has no effective rename for _Q01/_Q02.
It is quite evident in your patchmatic -extract output (DSDT.aml).
 
Top