Contribute
Register

[solved] USB3 _PRW 0x0D or 0x6D for instant wake

Status
Not open for further replies.
Look in ioreg as you plug the device in. You will see it populate under one of the ports under XHC.

Ahh! Got it thanks, will try it.
 
Replying to an old thread, but may still be helpful to others. I had an instant wake problem with my Socket 1156 system running both High Sierra and Mojave. If I had a USB device plugged into an external USB port, the system would wake immediately after sleep. I was able to resolve this problem by setting motherboard jumpers that enabled "+5VDC Standby" on my external USB ports. When +5VDC is disabled during standby on my external USB ports, the system wakes immediately after sleep (if a device is plugged into an external USB port). When +5VDC is enabled during standby (via motherboard jumpers), my system remains asleep (when a USB device is plugged in to an external port). Note that without a device plugged into one of the external USB ports, wake on sleep was not an issue (regardless of the motherboard +5VDC Standby jumper settings).
 
Last edited:
I'm just learning about Clover hotpatches (just in time for Clover to be replaced with OpenCore) and realized that I have been incorrectly applying Rehabman's "Instant Wake" patch to my DSDTs. I didn't realize this until reading Rehabman's Hot Patch thread here.

Specifically, if Method (_PRW) called GPRW(), I was incorrectly replacing GPRW(0x0D, 0xXX) with GPRW(0x0D, 0x00). This would have been ok if I had changed method GPRW() as Rehabman does here. What I should have done was replace GPRW(0x0D, 0x00) with Package() {0x0D, 0x00} as follows:

Replace

Code:
Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
{
    Return (GPRW (0x0D, 0x00))
}

with

Code:
Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
{
   Return (Package() { 0x0D, 0x00 })
}
 
Last edited:
I'm just learning about Clover hotpatches (just in time for Clover to be replaced with OpenCore) and realized that I have been incorrectly applying Rehabman's "Instant Wake" patch to my DSDTs. I didn't realize this until reading Rehabman's Hot Patch thread here.
or add this to your config.plist, no patching or dsdt edits required:
Comment: Change GPRW 0x6D, 0x04 to GPRW 0x6D, 0x00
Find: 47505257 0A6D0A04
Replace: 47505257 0A6D0A00
 
or add this to your config.plist, no patching or dsdt edits required:
Comment: Change GPRW 0x6D, 0x04 to GPRW 0x6D, 0x00
Find: 47505257 0A6D0A04
Replace: 47505257 0A6D0A00

@Feartech Does that hotpatch alone properly apply the full patch? From what Rehabman described, that hotpatch of the GPRW() call also requires a change to the definition of the Method (GPRW) ( which causes GPRW to return Package() {0x6D, 0x00} ). Does your suggested hotpatch change the GPRW() call and the Method (GPRW)?
 
@Feartech Does that hotpatch alone properly apply the full patch? From what Rehabman described, that hotpatch of the GPRW() call also requires a change to the definition of the Method (GPRW) ( which causes GPRW to return Package() {0x6D, 0x00} ). Does your suggested hotpatch change the GPRW() call and the Method (GPRW)?
it just works without any other hotpatch file or DSDT editing

test it
 
EDIT: After posting this, I realized that @Feartech 's suggested replacement patch was for (0x6D, 0x04) while my DSDT uses (0x0D, 0x04). I repeated my test with the corrected DSDT patch in config.plist (Find: 47505257 0A0D0A04, Replace 47505257 0A0D0A00) and confirmed that the result is the same: the simple replacement patch does NOT work for my motherboard. The revised problem reporting files (with the modified replacement patch in the DSDT) is now attached to this post.

@Feartech I think I applied your Clover patch correctly, but I must have applied it wrong because the patch does not disable USB wake on my TH55HD (socket 1156) motherboard. With the "manual" patch I mentioned in Post #23 of this thread, USB wake is disabled. Could you please check my config.plist in the attached problem reporting files to be sure I applied the Clover config.plist patch correctly? Thank you very much for your help!
 

Attachments

  • debug_19682.zip
    801.7 KB · Views: 125
Last edited:
@Feartech I think I applied your Clover patch correctly, but I must have applied it wrong because the patch does not disable USB wake on my TH55HD (socket 1156) motherboard. With the "manual" patch I mentioned in Post #23 of this thread, USB wake is disabled. Could you please check my config.plist in the attached problem reporting files to be sure I applied the Clover config.plist patch correctly? Thank you very much for your help!
what other patches are in your DSDT?
 
@Feartech I'm going to go out on a limb (a dangerously thin one) and suggest that Rehabman is inconsistent in his Hot Patch thread. At first, he claims that the wake on USB can be disabled by a simple change from:

Code:
Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
{
Return (GPRW (0x0D, 0x04))
}

to:

Code:
Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
{
Return (GPRW (0x0D, 0))
}

This simple replacement of GPRW(0x0D, 0x04) with GPRW(0x0D, 0x00) does not disable USB wake on my TH55HD motherboard. My TH55HD's Method (GPRW) does other stuff that is still executed with the simple 0x04 to 0x00 replacement patch.

Later in that same thread, Rehabman suggests changing Method (GPRW) as follows:

Code:
Method(GPRW, 2)
{
    If (0x0D == Arg0) { Return(Package() { 0x0D, 0 }) }
    External(\XPRW, MethodObj)
    Return(XPRW(Arg0, Arg1))
}

which causes GPRW to exit prematurely with a simple return of Package() {0x0D, 0} when Arg0 is 0x0D.

This GPRW() change does prevent USB Wake on my motherboard.

It appears to me that Rehabman offers two different USB Wake fixes, possibly without intending to do so. The latter (changing the behavior of Method (GPRW) when Arg0 is 0x0D) works for me. The simple replacement of GPRW(0x0D, 0x04) with GPRW(0x0D, 0x00) does not work on my motherboard.

EDIT: My DSTD's Method (GPRW) is as follows:

Code:
    Method (GPRW, 2, NotSerialized)
    {
        Store (Arg0, Index (PRWP, Zero))
        Store (ShiftLeft (SS1, One), Local0)
        Or (Local0, ShiftLeft (SS2, 0x02), Local0)
        Or (Local0, ShiftLeft (SS3, 0x03), Local0)
        Or (Local0, ShiftLeft (SS4, 0x04), Local0)
        If (And (ShiftLeft (One, Arg1), Local0))
        {
            Store (Arg1, Index (PRWP, One))
        }
        Else
        {
            ShiftRight (Local0, One, Local0)
            If (LOr (LEqual (OSFL (), One), LEqual (OSFL (), 0x02)))
            {
                FindSetLeftBit (Local0, Index (PRWP, One))
            }
            Else
            {
                FindSetRightBit (Local0, Index (PRWP, One))
            }
        }

        Return (PRWP)
    }
 
@Feartech I'm going to go out on a limb (a dangerously thin one) and suggest that Rehabman is inconsistent in his Hot Patch thread. At first, he claims that the wake on USB can be disabled by a simple change from:

Code:
Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
{
Return (GPRW (0x0D, 0x04))
}

to:

Code:
Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
{
Return (GPRW (0x0D, 0))
}

This simple replacement of GPRW(0x0D, 0x04) with GPRW(0x0D, 0x00) does not disable USB wake on my TH55HD motherboard. My TH55HD's Method (GPRW) does other stuff that is still executed with the simple 0x04 to 0x00 replacement patch.

Later in that same thread, Rehabman suggests changing Method (GPRW) as follows:

Code:
Method(GPRW, 2)
{
    If (0x0D == Arg0) { Return(Package() { 0x0D, 0 }) }
    External(\XPRW, MethodObj)
    Return(XPRW(Arg0, Arg1))
}

which causes GPRW to exit prematurely with a simple return of Package() {0x0D, 0} when Arg0 is 0x0D.

This GPRW() change does prevent USB Wake on my motherboard.

It appears to me that Rehabman offers two different USB Wake fixes, possibly without intending to do so. The latter (changing the behavior of Method (GPRW) when Arg0 is 0x0D) works for me. The simple replacement of GPRW(0x0D, 0x04) with GPRW(0x0D, 0x00) does not work on my motherboard.

EDIT: My DSTD's Method (GPRW) is as follows:

Code:
    Method (GPRW, 2, NotSerialized)
    {
        Store (Arg0, Index (PRWP, Zero))
        Store (ShiftLeft (SS1, One), Local0)
        Or (Local0, ShiftLeft (SS2, 0x02), Local0)
        Or (Local0, ShiftLeft (SS3, 0x03), Local0)
        Or (Local0, ShiftLeft (SS4, 0x04), Local0)
        If (And (ShiftLeft (One, Arg1), Local0))
        {
            Store (Arg1, Index (PRWP, One))
        }
        Else
        {
            ShiftRight (Local0, One, Local0)
            If (LOr (LEqual (OSFL (), One), LEqual (OSFL (), 0x02)))
            {
                FindSetLeftBit (Local0, Index (PRWP, One))
            }
            Else
            {
                FindSetRightBit (Local0, Index (PRWP, One))
            }
        }

        Return (PRWP)
    }
ahh ok, then maybe the hotpatch is required in your case?
 
Status
Not open for further replies.
Back
Top