Contribute
Register

[SOLVED] 4x40s not sleeping on AC adapter power

Status
Not open for further replies.
4x40s not sleeping on AC adapter power

Got programming experience?

One thing you might try doing is experiment with modifications to the _PTS method (ACPI Prepare To Sleep). If you search your DSDT for Method (_PTS), you'll see that it mostly calls HPTS. Searching for HPTS, you'll find it at the top of the DSDT.

I would try commenting out different portions of this. Keep in mind that Arg0==3 for sleep (S3). In particular, I think the calls to SSMI don't really do anything and are perhaps not necessary (you could prove me wrong... I'm just guessing).

The goal of commenting stuff out of the _PTS would be, through process of elimination, determine if there is code here that is causing the stall or, and what code it is... I did a similar thing with my desktop DSDT, eventually determining there was some code attempting to talk to a non-existent PS2 port, causing sleep to take 2-3mins to enter.

Here is the code:
Code:
    Method (HPTS, 1, NotSerialized)
    {
        Store (Arg0, SLPT) // this is probably 100% necessary
        \_SB.ODGW (Or (0x5400, Arg0)) // not sure...
        If (LEqual (Arg0, 0x05)) // this is special case for restart (will never be reached if shutdown fix is applied [see below])
        {
            \_SB.SSMI (0xEA82, Arg0, Zero, Zero, Zero) // SSMI does nothing for us, I think...
        }

        If (LGreater (Arg0, Zero))
        {
            \_SB.SSMI (0xEA83, Zero, Zero, Zero, Zero)  // I don't think these calls do anything under OSX (I think some kind of callback into Windows WMI or something)
            Acquire (\_SB.PCI0.LPCB.EC0.ECMX, 0xFFFF) // this Acquire is new in 4x40
            If (\_SB.PCI0.LPCB.EC0.ECRG) // not sure what ECRG is but it is generally tested before touching any EC register...
            {
                Store (Zero, \_SB.PCI0.LPCB.EC0.HSST)
            }

            Release (\_SB.PCI0.LPCB.EC0.ECMX) // paired Release/Acquire new in 4x40
            PPTS (Arg0) // this results in another SSMI call
            If (LNotEqual (Arg0, 0x05)) // for all cases except restart
            {
                \_SB.PCI0.LPCB.EC0.BTDR (Zero)
                Store (0xFF, \_SB.PCI0.LPCB.EC0.NGBF) // these are just variables in memory (ACPI Name)
                Store (0xFF, \_SB.PCI0.LPCB.EC0.NGBT) // but related to battery...
                Store (0x07, \_SB.PCI0.LPCB.EC0.GACP)
                Store (One, \_SB.NFBS)
                If (LEqual (Arg0, 0x03))// this is specifically for sleep (s3)
                {
                    Store (\_SB.LID._LID (), LSTA)
                    If (LNotEqual (And (PNHM, 0x000F0FF0), 0x000106E0))
                    {
                        Store (APMC, IDPM)
                    }
                }
            }
        }
    }

And here is your _PTS:
Code:
    Method (_PTS, 1, NotSerialized)
    {
        HPTS (Arg0)
        If (LEqual (Arg0, 0x03))
        {
            If (LAnd (DTSE, LGreater (TCNT, One)))
            {
                TRAP (0x02, 0x1E)
            }
        }

        If (LOr (LEqual (Arg0, 0x04), LEqual (Arg0, 0x05))) // sleep state 4 and restart(soft-off)
        {
            If (LEqual (XHCI, 0x02)) // must be doing some USB3 related stuff
            {
                Store (0xFFFFFFF0, Local0)
                And (Local0, \_SB.PCI0.XHC.PR3, \_SB.PCI0.XHC.PR3)
            }
        }
    }

Why don't you have the "shutdown fix" for _PTS method? Shutdown fix:
Code:
#  Shutdown fix
into method label _PTS code_regex_not If\s\(LEqual\s\(Arg0,\s0x05\)\) code_regex ^((?:.|\n)*)$ replace_matched
begin
        If (LEqual (Arg0, 0x05)) {}\n
        Else\n
        {\n
%1
        }
end;

In addition there is still some "other than 8-bit EC register access" in the DSDT (I think the 4x30s still has these too). Just for grins, you could try patching. I really don't think this will help as I don't think that code is being reached. But see the attachment for an updated 06_Battery.txt...


discovered the problem. turned off wifi then laptop went into sleep on ac. makes sense because i used hp probook installed 6 which installs a new wifi kext mixed with bluetooth
edit: couldnt fix the problem though
 
4x40s not sleeping on AC adapter power

when removing IONetworkingFamily.kext pc sleeps but no wifi
 
4x40s not sleeping on AC adapter power

when removing IONetworkingFamily.kext pc sleeps but no wifi

Are you using a DSDT patch for Wifi? I recall there being talk about not needing it (IDs match better?)...

But I wonder if the part about _PWR is necessary?

This is 4x30s Atheros wifi patch:
Code:
#   Airport fix works with vanilla IO80211 kext 
into device label WNIC parent_label RP04 replace_content
begin
Name (_ADR, Zero)  // _ADR: Address\n
Method (_PRW, 0, Serialized)  // _PRW: Power Resources for Wake\n
{\n
	Return (^^_PRW)\n
}\n
Method (_DSM, 4, NotSerialized)\n
{\n
    Store (Package (0x0C)\n
        {\n
            "AAPL,slot-name", \n
            Buffer (0x08)\n
            {\n
                "AirPort"\n
            }, \n
            "device-id", \n
            Unicode ("*"), \n
            "device_type", \n
            Buffer (0x08)\n
            {\n
                "AirPort"\n
            }, \n
            "model", \n
             Buffer (0x33)\n
             {\n
                "Atheros 9285 802.11 b/g/n Wireless Network Adapter"\n
             },\n
            "subsystem-id", \n
            Buffer (0x04)\n
            {\n
                0x8F, 0x00, 0x00, 0x00\n
            }, \n
            "subsystem-vendor-id", \n
            Buffer (0x04)\n
            {\n
                0x6B, 0x10, 0x00, 0x00\n
            }\n
        }, Local0)\n
    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n
    Return (Local0)\n
}
end;

into all label WNIC set_label begin ARPT end;
 
4x40s not sleeping on AC adapter power

I remember we were using this command in the past to see reasons of not going into sleep.
pmset -g assertions
 
4x40s not sleeping on AC adapter power

well same result when removing io80221family kext laptop sleeps. applied patch same result.
well i have no experience in programming, tried the _pwr:cry:
 
4x40s not sleeping on AC adapter power

I remember we were using this command in the past to see reasons of not going into sleep.
pmset -g assertions

well it gave me this:
2/10/13 11:50:28 PM GMT-
Assertion status system-wide:
PreventUserIdleDisplaySleep 0
PreventSystemSleep 0
PreventUserIdleSystemSleep 0
ExternalMedia 0
UserIsActive 0
ApplePushServiceTask 0
BackgroundTask 0


Listed by owning process:
pid 39(mds): [0x0000000c00000138] 00:09:20 BackgroundTask named: "com.apple.metadata.mds"
pid 47(InternetSharing): [0x0000000800000142] 00:09:14 DenySystemSleep named: "com.apple.InternetSharing"


Kernel Assertions: 0x0128
* Kernel Assertion ID = 500
Created At = 12/31/69 9:11:24 PM GMT-
Modified At = 12/31/69 9:00:00 PM GMT-
Owner ID = 0xffffff800c1eb000
Level = 0
Assertions Set = None (4)


* Kernel Assertion ID = 501
Created At = 12/31/69 9:11:24 PM GMT-
Modified At = 12/31/69 9:00:00 PM GMT-
Owner ID = 0xffffff800c1ec000
Level = 0
Assertions Set = None (4)


* Kernel Assertion ID = 502
Created At = 2/10/13 11:51:01 PM GMT-
Modified At = 12/31/69 9:00:00 PM GMT-
Owner ID = 0xffffff800d00c300
Level = 255
Assertions Set = None (128)
 
4x40s not sleeping on AC adapter power

I remember we were using this command in the past to see reasons of not going into sleep.
pmset -g assertions

That's more for figuring out why you don't get auto-sleep. When you force it to sleep, it should do so...
 
4x40s not sleeping on AC adapter power

That's more for figuring out why you don't get auto-sleep. When you force it to sleep, it should do so...
Perhaps, but it's not happy about Internet Sharing being enabled.
InternetSharing DenySystemSleep named: "com.apple.InternetSharing"
 
4x40s not sleeping on AC adapter power

That's more for figuring out why you don't get auto-sleep. When you force it to sleep, it should do so...
Perhaps, but it's not happy about Internet Sharing being enabled.
InternetSharing DenySystemSleep named: "com.apple.InternetSharing"

LOL... I take that back and edit: "... unless you're using your computer as a router!"
 
4x40s not sleeping on AC adapter power

Perhaps, but it's not happy about Internet Sharing being enabled.
InternetSharing DenySystemSleep named: "com.apple.InternetSharing"

Brilliant!!!

This had been bugging me and I had forgotten that since I did all the testing on the voodoo controller kext (when I was sure sleep/wake had worked under all circumstances) I had ticked that box in sharing preferences to play with some sharing.....guess what unticked it now and the problem has gone. (checked repeatedly).

I can live without Internet Sharing but I cannot live without sleep so preference now permanently unticked. Lesson learnt.
 
Status
Not open for further replies.
Back
Top