Sample Header Ad - 728x90

How to debug which one is causing AE_AML_NO_RETURN_VALUE?

0 votes
0 answers
16 views
I have a problem with ACPI event in Linux. rtcwake is not working because alarm was not handled by kernel. This is the snippet of dmesg output:
[    1.102322] ACPI Error: Result stack is empty! State=00000000413b8c7a (20240827/dswstate-64)
[    1.102331] ACPI Error: AE_AML_NO_RETURN_VALUE, Missing or null operand (20240827/dsutils-609)
[    1.102336] ACPI Error: AE_AML_NO_RETURN_VALUE, While creating Arg 1 (20240827/dsutils-725)

[    1.102345] 
               Initialized Local Variables for Method [_EVT]:
[    1.102347]   Local3: 00000000b30bc4f6            Integer 0000000000000000

[    1.102359] Initialized Arguments for Method [_EVT]:  (1 arguments defined for method invocation)
[    1.102361]   Arg0:   0000000030350e68            Integer 0000000000000018

[    1.102374] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_AML_NO_RETURN_VALUE) (20240827/psparse-529)
Then I dumped the ACPI table and _SB.GPIO._EVT is located somewhere in SSDT15:
DefinitionBlock ("", "SSDT", 1, "HPQOEM", "85DE    ", 0x00000001)
{
    External (_SB_.G006, FieldUnitObj)
    External (_SB_.GPIO, DeviceObj)
    External (_SB_.PCI0.GP17.AZAL, UnknownObj)
    External (_SB_.PCI0.GP17.XHC0, UnknownObj)
    External (_SB_.PCI0.GP17.XHC1, UnknownObj)
    External (_SB_.PCI0.GP17.XHC1.RHUB.PRT1.WCAM, UnknownObj)
    External (_SB_.PCI0.GPP3.DEV0, UnknownObj)
    External (_SB_.PCI0.GPP4.XPDV, UnknownObj)
    External (_SB_.PCI0.REDM, FieldUnitObj)
    External (_SB_.PWRB, UnknownObj)
    External (_SB_.WFDE.PDAT, IntObj)
    External (_SB_.WFTE.WMDE, MethodObj)    // 3 Arguments
    External (_SB_.WMID.GWET, MethodObj)    // 2 Arguments
    External (M000, MethodObj)    // 1 Arguments
    External (M014, MethodObj)    // 5 Arguments
    External (M249, MethodObj)    // 4 Arguments

    Method (MSTP, 1, Serialized)
    {
        Local0 = (Arg0 - 0x0C00)
        M000 (Local0)
    }

    Scope (\_SB.GPIO)
    {
        Method (_AEI, 0, NotSerialized)  // _AEI: ACPI Event Interrupts
        {
            Name (BUF0, ResourceTemplate ()
            {
                GpioInt (Edge, ActiveHigh, ExclusiveAndWake, PullDefault, 0x1388,
                    "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x0000
                    }
                GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone, 0x0000,
                    "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x0002
                    }
                GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone, 0x0000,
                    "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x0004
                    }
                GpioInt (Edge, ActiveBoth, Exclusive, PullNone, 0x0000,
                    "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x0006
                    }
                GpioInt (Edge, ActiveBoth, Exclusive, PullUp, 0x0000,
                    "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x0018
                    }
                GpioInt (Edge, ActiveHigh, ExclusiveAndWake, PullNone, 0x0000,
                    "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x002C
                    }
                GpioInt (Level, ActiveHigh, ExclusiveAndWake, PullNone, 0x0000,
                    "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x003A
                    }
                GpioInt (Level, ActiveHigh, ExclusiveAndWake, PullNone, 0x0000,
                    "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x003B
                    }
                GpioInt (Level, ActiveHigh, ExclusiveAndWake, PullNone, 0x0000,
                    "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x003D
                    }
            })
            Return (BUF0) /* \_SB_.GPIO._AEI.BUF0 */
        }

        // Somewhere below here
        Method (_EVT, 1, Serialized)  // _EVT: Event
        {
            Switch (ToInteger (Arg0))
            {
                Case (Zero)
                {
                    MSTP (0x3900)
                    Notify (\_SB.PWRB, 0x80) // Status Change
                }
                Case (0x02)
                {
                    MSTP (0x3902)
                    Notify (\_SB.PCI0.GPP4.XPDV, 0x02) // Device Wake
                }
                Case (0x04)
                {
                    MSTP (0x3904)
                    Notify (\_SB.PCI0.GPP3.DEV0, 0x02) // Device Wake
                }
                Case (0x06)
                {
                    MSTP (0x3906)
                    If (G006)
                    {
                        \_SB.WMID.GWET (0x1A, 0xFF)
                    }
                    Else
                    {
                        Notify (\_SB.PCI0.GP17.XHC1.RHUB.PRT1.WCAM, One) // Device Check
                        \_SB.WMID.GWET (0x1A, 0xFE)
                    }
                }
                Case (0x18)
                {
                    Name (SDAA, Zero)
                    Name (SDAB, Zero)
                    If ((Local3 >= 0x82))
                        {
                            \_SB.PCI0.REDM = One
                            SDAA = 0x03
                            SDAB = 0x03
                        } = M249 (Zero, Zero, 0x03E1051C, Local3)
                    Else
                    {
                        \_SB.PCI0.REDM = Zero
                        SDAA = 0x02
                        SDAB = 0x02
                    }

                    \_SB.WFDE.PDAT = SDAB /* \_SB_.GPIO._EVT.SDAB */
                    \_SB.WFDE.PDAT <<= 0x10
                    \_SB.WFDE.PDAT |= SDAA /* External reference */
                    \_SB.WFTE.WMDE (Zero, One, Zero)
                    M014 (0xFED80200, Zero, 0x0F, One, One)
                }
                Case (0x3A)
                {
                    MSTP (0x3958)
                    Notify (\_SB.PCI0.GP17.XHC0, 0x02) // Device Wake
                }
                Case (0x3B)
                {
                    MSTP (0x3959)
                    Notify (\_SB.PCI0.GP17.XHC1, 0x02) // Device Wake
                }
                Case (0x3D)
                {
                    MSTP (0x3961)
                    Notify (\_SB.PCI0.GP17.AZAL, 0x02) // Device Wake
                }

            }
        }
    }
}
**The question is:** How can I spot which line of code is causing AE_AML_NO_RETURN_VALUE?
Asked by Thor-x86_128 (111 rep)
May 30, 2025, 03:12 PM