Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

(sorry not an issue) Sleep issues on a similar laptop. #5

Closed
ROCKERLIQUID opened this issue May 15, 2021 · 5 comments
Closed

(sorry not an issue) Sleep issues on a similar laptop. #5

ROCKERLIQUID opened this issue May 15, 2021 · 5 comments

Comments

@ROCKERLIQUID
Copy link

ROCKERLIQUID commented May 15, 2021

Sorry for flagging this as an issue, so i have a similar laptop as yours, a Toshiba C50 with an i3-3110M, the problem is that i have EHC2 AND XHC which is causing instant wake issues, would really be helpful as how you did your patches on that.

DSDT.aml.zip

edit: soo i tried to follow rehabman's guide on this and failed really bad lol, so it would be really helpful if you could provide the patch.

@whatnameisit
Copy link
Owner

whatnameisit commented May 16, 2021

Hi. I haven't looked at the DSDT, but you need to upload your config.plist. After you upload it and while I come up with the fix, read through the Dortania and OC-Little guides.
Minimum knowledge on ACPI patching: https://dortania.github.io/Getting-Started-With-ACPI/
How your laptop differs from mine (basically nothing similar): https://dortania.github.io/OpenCore-Install-Guide/prerequisites.html#prerequisites
More advanced hotpatching methods and examples to fix instant wakes: https://github.com/5T33Z0/OC-Little-Translated
Note: I'm only willing to help because you asked from me. Next time, please go to the forums for help.

@whatnameisit
Copy link
Owner

Okay, I looked at your DSDT, and why is it only just the unedited DSDT binary, instead of the whole ACPI tables? If you actually gave it a try following RehabMan's guide, you would at least give me decompiled dsl files. And I still need your config.plist.

@ROCKERLIQUID
Copy link
Author

Sorry for that, and tbh I did the lazy approach, got stuck at the hexfiend part, anyways heres my config.plist and thanks really for the help. I have read the OC little transalated, looks like I have a lot more to learn.
Here's my config.plist
config.plist.zip
Here's my decompiled DSDT with no edits
DSDT.dsl.zip
Thanks again, really appreciate it.

@whatnameisit
Copy link
Owner

whatnameisit commented May 16, 2021

I asked for the whole ACPI able, yet you supplied me with only DSDT. Well, I only asked that to see if you read or did any work yourself, but you didn't, and you said it yourself that you were being lazy.
RehabMan insists that DSDT be decompiled with SSDT, and you seem to be ignoring things in his great guides. He says you can look at the hex codes if you use iasl to decompiled it with the argument -l.

OKay, enough nagging. Here's what I came up with.

RehabMan's ACPI static patching guide

The _PRW patches can be used to fix "instant wake" where the laptop will not sleep without waking up seconds after sleep begins. Use only "USB _PRW 0x6D (instant wake)" or "USB _PRW 0x0D (instant wake)" as it relates to existing code in your DSDT (also note specific versions of these patches for Skylake and later). You should examine your DSDT to determine what the relevant _PRW methods return to be certain the patch is appropriate for your DSDT.

Read the above to understand that _PRW methods with the first argument of either 0x6D or 0x0D need to be patched.
RehabMan's ACPI hotpatching guide

In order to patch it so USB devices on EHCI#1 cannot cause wake, it would be changed:
Code:

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

Look into your DSDT and you see 0x0D, but not 0x6D, in _PRW methods:
스크린샷 2021-05-16 오후 7 18 51
스크린샷 2021-05-16 오후 7 18 58
스크린샷 2021-05-16 오후 7 19 04

RehabMan's guide has GPRW, but your DSDT doesn't, so it might be confusing, but it's simple. Read OC-Little translation:

Name (_PRW, Package (0x02)
{
    0x0D, /* possibly 0x6D */
    0x03, /* possibly 0x04 */
    ...
})
This type of 0D/6D patch is suitable for fixing 0x03 (or 0x04) to 0x00 using the binary renaming method. The documentation package provides.

Name-0D rename .plist

Name-0D-03 to 00
Name-0D-04 to 00

and

One of the Method types: GPRW(UPRW)

  Method (_PRW, 0, NotSerialized)
  {
    Return (GPRW (0x6D, 0x04)) /* or Return (UPRW (0x6D, 0x04)) */
  }
Most of the newer machines fall into this case. Just follow the usual method (rename-patch). The documentation package provides.

SSDT-GPRW (patch file with binary rename data inside)

RehabMan only mentioned how to patch _PRW methods with GPRW or UPRW in them, but it always ends up with _PRW returning two arguments like (0x0D, 0x03) whether they are passed to GPRW or not. You have the not case.

Look above again at the screenshots. The arguments are the same (0x0D, 0x03). Then you can use the first patch from OC-Little translation:

			<dict>
				<key>Comment</key>
				<string>Name0D-03 to 00</string>
				<key>Count</key>
				<integer>0</integer>
				<key>Enabled</key>
				<true/>
				<key>Find</key>
				<data>
				Cg0KAw==
				</data>
				<key>Limit</key>
				<integer>0</integer>
				<key>Mask</key>
				<data>
				</data>
				<key>OemTableId</key>
				<data>
				</data>
				<key>Replace</key>
				<data>
				Cg0KAA==
				</data>
				<key>ReplaceMask</key>
				<data>
				</data>
				<key>Skip</key>
				<integer>0</integer>
				<key>TableLength</key>
				<integer>0</integer>
				<key>TableSignature</key>
				<data>
				</data>
			</dict>

Add the ACPI patch in your config.plist and see if it fixes your instant-wake issues. If it doesn't, delete the contents of ESEL, XSEL, and XWAK. Google and you will find RehabMan's ready-to-be-used SSDTS. You still need to find the corresponding hex codes to go into your config.plist. Use ./iasl -l DSDT.aml or something similar to get the codes.
Closing, as this kind of help has nothing to do with my own repo which I said from the start.

@ROCKERLIQUID
Copy link
Author

Thank you, the 0D/6D patch works like a charm and sleep works now. Really appreciate it for explaining this clearly to my lazy brain.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants