Contribute
Register

Minor annoying bugs on Miix 720

Status
Not open for further replies.
Joined
Oct 2, 2015
Messages
69
Motherboard
Yoga C930
CPU
i7- 8550U
Graphics
UHD620
Hi, I'm nearly finished my configuration of this laptop model and ready to write a tutorial, but there are still some problems which I failed to find the solutions from the Internet.

Lid detection

When start up, the laptop screen always goes black after the graphics driver is loaded and the cover should be fold up and down to let the system know the Lid is open. If I ignore that, it will sleep and after wake-up the screen is well recognized. The laptop (or tablet) have a detachable cover so it's possible that the lid status is affected by various factors, for example, if I remove the keyboard cover and re-attach it, the lid status will also be recognized. I wonder if there's something to do with DSDT, as the ACPI LID part shows errors when boot up even under linux, however linux handles it well.

Code:
ACPI Error: No handler for Region [ERAM] (ffff8802968d12d0) [EmbeddedControl] (20170119/evregion-166)
ACPI Error: Region EmbeddedControl (ID=3) has no handler (20170119/exfldio-299)
ACPI Error: Method parse/execution failed [\_SB.PCI0.LPCB.EC0.LID0._STA] (Node ffff8802968d67f8), AE_NOT_EXIST (20170119/psparse-543)
ACPI Error: Method execution failed [\_SB.PCI0.LPCB.EC0.LID0._STA] (Node ffff8802968d67f8), AE_NOT_EXIST (20170119/uteval-103)


USB connection loss

I have followed the USB Guide with USBInjectAll and a custom SSDT, and the keyboard cover is connected via a modified USB 2.0 port. Sometimes it becomes unfuntional while the blacklight is on, and re-attach it will get it working. This situation always happens when I perform check update operation from AppStore. Under Windows or Linux the loss of connection isn't presented. I'm not sure if this have something related to USB or if there were a configuration error as the Bluetooth also breaks after sleep.


Fan Detection

I have figured out the register successfully from EC section in DSDT, the temperature sensors works well but that of fan works quite unstable. It always disappears if I left only one fan in SMCD (actually there is only one fan). When I add a fake fan which returns static value, the fan speed can be read randomly(need reboot once or twice). Maybe I left something important such as the _INI structure or mutex release(not so familiar about this), but I can't find other occurrences in SSDT or DSDT rather than in EC field.

Thank you in advance.
 
Hi, I'm nearly finished my configuration of this laptop model and ready to write a tutorial, but there are still some problems which I failed to find the solutions from the Internet.

Lid detection

When start up, the laptop screen always goes black after the graphics driver is loaded and the cover should be fold up and down to let the system know the Lid is open. If I ignore that, it will sleep and after wake-up the screen is well recognized. The laptop (or tablet) have a detachable cover so it's possible that the lid status is affected by various factors, for example, if I remove the keyboard cover and re-attach it, the lid status will also be recognized. I wonder if there's something to do with DSDT, as the ACPI LID part shows errors when boot up even under linux, however linux handles it well.

Code:
ACPI Error: No handler for Region [ERAM] (ffff8802968d12d0) [EmbeddedControl] (20170119/evregion-166)
ACPI Error: Region EmbeddedControl (ID=3) has no handler (20170119/exfldio-299)
ACPI Error: Method parse/execution failed [\_SB.PCI0.LPCB.EC0.LID0._STA] (Node ffff8802968d67f8), AE_NOT_EXIST (20170119/psparse-543)
ACPI Error: Method execution failed [\_SB.PCI0.LPCB.EC0.LID0._STA] (Node ffff8802968d67f8), AE_NOT_EXIST (20170119/uteval-103)

LID0._STA is accessing the EC before EC0._REG is called indicating EC availability.
It is not compliant to the ACPI spec (EC access is not guaranteed until EC._REG has been called indicating so, read ACPI spec for more info)
Simple fix: Remove LID0._STA.

Note: Also, it could be the author of that code intended to write \EMOD instead of EMOD. Look carefully, and you'll see two different EMOD. Accessing \EMOD would be valid (which is in SystemMemory), but not EMOD (which is in EC).

USB connection loss

I have followed the USB Guide with USBInjectAll and a custom SSDT, and the keyboard cover is connected via a modified USB 2.0 port. Sometimes it becomes unfuntional while the blacklight is on, and re-attach it will get it working. This situation always happens when I perform check update operation from AppStore. Under Windows or Linux the loss of connection isn't presented. I'm not sure if this have something related to USB or if there were a configuration error as the Bluetooth also breaks after sleep.

This is on HS05? If so, mark it UsbConnector=0 (instead of UsbConnector=255).
Also, is HS01 related to SS01? If so, it should be marked UsbConnector=3.

Fan Detection

I have figured out the register successfully from EC section in DSDT, the temperature sensors works well but that of fan works quite unstable. It always disappears if I left only one fan in SMCD (actually there is only one fan). When I add a fake fan which returns static value, the fan speed can be read randomly(need reboot once or twice). Maybe I left something important such as the _INI structure or mutex release(not so familiar about this), but I can't find other occurrences in SSDT or DSDT rather than in EC field.

Thank you in advance.

I'm not sure what you mean here... what do you mean by "always disappears". What disappears? From where?
 
Thanks for your help, I will try to dig further on the connection of \EMOD and try modify the config of UIAC.

I'm not sure what you mean here... what do you mean by "always disappears". What disappears? From where?
I mean the fan didn't appear on sensor list of HWSensor or other utility, which have the same data.

Screen Shot 2017-12-03 at 11.52.57 PM.png Screen Shot 2017-12-01 at 3.16.23 PM.png
 
Your kextcache output indicates kexts are not installed correctly.
I got your ideas that all kexts should be under /L/E and that solved the issue.

Simple fix: Remove LID0._STA.
Can I modify the LID0._STA to always return 0x0F since the device is always on?

And it seems this won't fix the black screen when booting after graphics driver are loaded(since formal with 0x12345678 it won't turned off at this time) and according to ACPI Spec I should focus on _LID which return LIDS. There are several method write to LIDS.
Code:
            Method (_Q15, 0, NotSerialized)  // _Qxx: EC Query
            {
                Store (0x15, P80H)
                Store (One, LIDS)
                ^^^IGPU.GLID (LIDS)
                Notify (LID0, 0x80)
            }

            Method (_Q16, 0, NotSerialized)  // _Qxx: EC Query
            {
                Store (0x16, P80H)
                Store (Zero, LIDS)
                ^^^IGPU.GLID (LIDS)
                Notify (LID0, 0x80)
            }
_Q15 & _Q16 for keyboard function key to turn on/off (well the keyboard doesn't feature these as it's connected via USB)
Code:
    Method (ZWAK, 1, Serialized)
    {
        ShiftLeft (Arg0, 0x04, Local0)
        D8XH (Zero, Local0)
        ADBG ("_WAK")
        If (LEqual (OSYS, 0x03E8))
        {
            Store (One, Local0)
        }
        //OSYS stuffs
        Store (Local0, \_SB.PCI0.LPCB.EC.OSTY)
        If (LEqual (S0ID, One))
        {
            Store (One, \_SB.SCGE)
        }

        If (NEXP)
        {
            If (And (OSCC, 0x02))
            {
                \_SB.PCI0.NHPG ()
            }

            If (And (OSCC, 0x04))
            {
                \_SB.PCI0.NPME ()
            }
        }

        If (LOr (LEqual (Arg0, 0x03), LEqual (Arg0, 0x04)))
        {
            If (LEqual (TBTS, One))
            {
                Acquire (OSUM, 0xFFFF)
                \_GPE.TINI ()
                Release (OSUM)
            }

            If (LNotEqual (\_SB.PCI0.RP01.VDID, 0xFFFFFFFF))
            {
                Notify (\_SB.PCI0.RP01, Zero)
            }
            //RP0X stuffs
        }

        If (LOr (LEqual (Arg0, 0x03), LEqual (Arg0, 0x04)))
        {
            If (LEqual (RECM (0x74), 0x06))
            {
                If (LEqual (ECON, One))
                {
                    If (LOr (LEqual (Arg0, 0x03), LEqual (Arg0, 0x04))) {}
                }
                Else
                {
                }
            }
            Else
            {
                Store (\_SB.PCI0.LPCB.EC.LSTE, LIDS)
                If (IGDS)
                {
                    If (LEqual (LIDS, Zero))
                    {
                        Store (0x80000000, \_SB.PCI0.IGPU.CLID)
                    }

                    If (LEqual (LIDS, One))
                    {
                        Store (0x80000003, \_SB.PCI0.IGPU.CLID)
                    }
                }

                Notify (\_SB.PCI0.LPCB.EC.LID0, 0x80)
                If (LEqual (Arg0, 0x03))
                {
                    Notify (\_SB.PCI0.LPCB.EC.LID0, One)
                }
            }
        }

        If (LEqual (DPTF, One))
        {
            Notify (\_SB.IETM, 0x88)
        }

        If (LEqual (TBTS, One))
        {
            Signal (WFEV)
        }

        Return (Package (0x02)
        {
            Zero,
            Zero
        })
    }
_WAK for turn screen on once awake, which store EC.LSTE in LIDS, but this part should be fine. In fact, after the screen went black the system will soon sleep, and wake the system up simply by press a key will go through the wake process and also turned on the screen.
Code:
            Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If (LEqual (Arg0, 0x03))
                {
                    Store (Arg1, ECAV)
                }

                If (LAnd (LEqual (Arg0, 0x03), LEqual (Arg1, One)))
                {
                    If (LEqual (OSYS, 0x07D6))
                    {
                        Store (One, Local0)
                    }
                    //OSYS stuffs
                    Store (One, ECON)
                    If (LEqual (Acquire (LFCM, 0xA000), Zero))
                    {
                        Store (Local0, OSTY)
                        If (LEqual (LSTE, Zero))
                        {
                            Store (Zero, ^^^IGPU.CLID)
                        }

                        If (LEqual (LSTE, One))
                        {
                            Store (0x03, ^^^IGPU.CLID)
                        }

                        Store (LSTE, LIDS)
                        Release (LFCM)
                    }
                }
            }
EC._REG also store LSTE in LIDS, and according to ACPI Spec this should be run (once?) during the boot process, it activates operation region and the LIDS change also happen at this stage. The status of the battery issue you analyzed before (https://www.tonymacx86.com/threads/...g-battery-status.116102/page-402#post-1545608) also have connection with this part because the important ECON is set to 1 here. I suppose maybe the parser in macOS has different sequences while processing this so behaves different with Linux or Windows.

From the _Q15 & _Q16 and _ZWAK part, CLID come with LIDS changes to tell GPU to stop render, and the 1-bit LSTE here seems actually a hardware switch. So is it proper to just get _LID return LSTE since these three parts are recursion? Or maybe other fixes can fit DSDT in to macOS's parser rules and have a more universal result?
 
Can I modify the LID0._STA to always return 0x0F since the device is always on?

Removing _STA is same effect (due to default _STA, as per ACPI spec).

And it seems this won't fix the black screen when booting after graphics driver are loaded(since formal with 0x12345678 it won't turned off at this time)

Not related to ACPI LID.
Your graphics issue is a separate one that must be solved first.
 
Your graphics issue is a separate one that must be solved first.
Sorry, maybe I failed to explain that. After expand the fb size and modify patches of IntelGraphicsDVMTFixup, even installer can boot without bogus ID and the fb driver works. What I want to express is when KBLFB can't be loaded in the past, the accel is broken but the screen wouldn't be turned off at boot time.
 
What I want to express is when KBLFB can't be loaded in the past, the accel is broken but the screen wouldn't be turned off at boot time.

No idea what you mean by that.
 
Thanks for your help and suggestions. I think I have find the reason of the lid close during open. With ACPIDebug, I can figure out the _LID method don't have stable value when boot up, just as the case of the battery. So I modified this value to direct return the hardware switch LSTE in EC, and when it's not ready (indicated just as the battery case), return 1 for lid open.

Code:
    Method (\_SB.PCI0.LPCB.EC.LID0._STA, 0, NotSerialized)  // _STA: Status
    {
        Return (0x0F)
    }

    Method (\_SB.PCI0.LPCB.EC.LID0._LID, 0, NotSerialized)  // _LID: Lid Status
    {
        If (LNot (ECON))
        {
            Return (One)
        }

        Return (LSTE)
    }

However the lid close to sleep only works for the first attempt after boot, after that it won't sleep again by the same mean (manual click on -Sleep is fine) but ACPIDebug shows the lid status now returns correct value. I found another post on HP lid sleep problem and your suggestions to that is to change property of VoodooPS2Keyboard. But the USB keyboard may not have such problems and only the volume key on the tablet is powered by VoodooPS2Keyboard, and by remove the kext have no effect. Maybe this should be reposted to the PM thread as the config doesn't enable native PM and only xnu is on but the system would never sleep with proper PM settings.

And the USB keyboard as well as touchpad(in mouse mode) have weird behavior and the 0x0 for UsbConnector didn't work. I watched ioreg while perform system updates check(from App Store, background update or direct perform systemupdate from terminal). Nothing changed but the keyboard and touchpad both stop working suddenly. It's a bit frustrated:(

Thanks for your time.
 
Thanks for your help and suggestions. I think I have find the reason of the lid close during open. With ACPIDebug, I can figure out the _LID method don't have stable value when boot up, just as the case of the battery. So I modified this value to direct return the hardware switch LSTE in EC, and when it's not ready (indicated just as the battery case), return 1 for lid open.

Code:
    Method (\_SB.PCI0.LPCB.EC.LID0._STA, 0, NotSerialized)  // _STA: Status
    {
        Return (0x0F)
    }

    Method (\_SB.PCI0.LPCB.EC.LID0._LID, 0, NotSerialized)  // _LID: Lid Status
    {
        If (LNot (ECON))
        {
            Return (One)
        }

        Return (LSTE)
    }

However the lid close to sleep only works for the first attempt after boot, after that it won't sleep again by the same mean (manual click on -Sleep is fine) but ACPIDebug shows the lid status now returns correct value. I found another post on HP lid sleep problem and your suggestions to that is to change property of VoodooPS2Keyboard. But the USB keyboard may not have such problems and only the volume key on the tablet is powered by VoodooPS2Keyboard, and by remove the kext have no effect. Maybe this should be reposted to the PM thread as the config doesn't enable native PM and only xnu is on but the system would never sleep with proper PM settings.

And the USB keyboard as well as touchpad(in mouse mode) have weird behavior and the 0x0 for UsbConnector didn't work. I watched ioreg while perform system updates check(from App Store, background update or direct perform systemupdate from terminal). Nothing changed but the keyboard and touchpad both stop working suddenly. It's a bit frustrated:(

Thanks for your time.

You really need to address the issue of ECON not being set properly.
Do some debugging of _REG in the EC (it is likely the method that sets ECON).
 
Status
Not open for further replies.
Back
Top