Jump to content
Sign in to follow this  
Followers 0
frankiee

How to disable wake from USB?

16 posts in this topic

Recommended Posts

Hi,

 

I always had aapl-clock-id set to disable wake from USB, i.e. my computer only woke up when pressing the power button.

 

Now with all that changed USB handling in El Capitan, this does not seem to work anymore. Strangely, I also have wakereason "?" when waking from keyboard or mouse.

 

Is there any other way to explicitly prohibit wake from sleep caused by USB devices (esp. keyboard and mouse, which are connected to USB 2 ports) using DSDT / SSDT?

 

This is how my current USB related SSDT settings look like:

    Name (_SB.PCI0.EUSB._STA, Zero)
    Name (_SB.PCI0.USBE._STA, Zero)
    Device (_SB.PCI0.EH01)
    {
        Name (_ADR, 0x001D0000)
        Name (_S4D, 0x02)
        Name (_S3D, 0x02)
        Name (_S2D, 0x02)
        Name (_S1D, 0x02)
        Name (MBSD, One)
    }

    Device (_SB.PCI0.EH02)
    {
        Name (_ADR, 0x001A0000)
        Name (_S4D, 0x02)
        Name (_S3D, 0x02)
        Name (_S2D, 0x02)
        Name (_S1D, 0x02)
        Name (MBSD, One)
    }

Any hints would be greatly appreciated!

Share this post


Link to post
Share on other sites
Advertisement

ClockId seems to not work anymore, no matter if I set it from clover or using a DSDT / SSDT patch. And you had to add a clock id to disable wake from USB, not disable it.

 

Again, my goal is to disable wake from USB, so the system only wakes when pressing the power button.

Share this post


Link to post
Share on other sites

Hi Allan, thanks for the hint!

 

But actually I already have tried that. I.e. deleted these methods with both the "USBE" and "EUSB" devices in my original DSDT.

 

I also tried this:

Name(_PRW, Package() { 0x0D, 0 })

... and added this name to my "EH01" and "EH02" devices in my SSDT as well.

 

No dice, still wakes when pressing a key or moving my mouse :(

 

Any other ideas?

Share this post


Link to post
Share on other sites

Hibernate mode is "0". And I want to wake my hack as I always did before it stopped working, i.e. using the power button only.

 

Ah and I dont want to have KPs anymore when I restart my machine after waking, but think this is another topic ...

Share this post


Link to post
Share on other sites

You always use Hibernate mode '0'?

 

Maybe you can try another value, like 21 or 29.

 

I know that you want Sleep mode, not Hibernation, but it's all i can think at moment...1f615.png

 

I recommend use Hibernation, because i have 90% sure that you can wake your Hack using power button. 1f60e.png

Share this post


Link to post
Share on other sites

No I do not want hibernation. This is a desktop with lots of RAM, so I would needlessly thrash my SSD. And I can wake with Powerbutton right now. The point is, I want to wake with Poweerbutton only.

Share this post


Link to post
Share on other sites

Truth, i forgot that you use SSD, it's a bad idea. 1f615.png?v5

 

Well, i have no more ideas for wake only via PWB, sorry bro....1f44b.png?v5

Share this post


Link to post
Share on other sites

FYI: I at least have found a way to achieve the desired functionality again, but it feels like its not the best way to do so (but I know no other ...)

 

So what works is just doing this in my SSDT:

Name (_SB.PCI0.EUSB._STA, Zero)
Name (_SB.PCI0.USBE._STA, Zero)

I.e. I do not add Device (_SB.PCI0.EH01) and Device (_SB.PCI0.EH01) after that, like I did before. Apparently USB still seems to work OK, and finally wake on USB is disabled as well - but it still feels a bit strange to do it this way ...

Share this post


Link to post
Share on other sites

Like this. 

Device (USB1)
{
Name(_ADR, 0x001d0000)
   29 
   30 	OperationRegion(U01P, PCI_Config, 0, 256)
   31 	Field(U01P, DWordAcc, NoLock, Preserve)
   32 	{
   33 		Offset(0xc4),
   34 		U1WE, 2		// USB Wake Enable
   35 	}
   36 
   37 	Name (_PRW, Package(){ 3, 4 }) // Power Resources for Wake
   38 
   39 	Method (_PSW, 1)	// Power State Wake method
   40 	{
   41 		// USB Controller can wake OS from Sleep State
   42 		If (Arg0) {
   43 			Store (3, U1WE)
   44 		} Else {
   45 			Store (0, U1WE)
   46 		}
   47 	}
   48 
   49 	// Leave USB ports on for to allow Wake from USB
   50 
   51 	Method(_S3D,0)	// Highest D State in S3 State
   52 	{
   53 		Return (2)
   54 	}
   55 
   56 	Method(_S4D,0)	// Highest D State in S4 State
   57 	{
   58 		Return (2)
   59 	}
   60 }
   61 
   62 
   63 // USB Controller 0:1d.1
   64 
  185 Device (EHC1)
  186 {
  187 	Name(_ADR, 0x001d0007)
  188 
  189 	Name (_PRW, Package(){ 13, 4 }) // Power Resources for Wake
  190 
  191 	// Leave USB ports on for to allow Wake from USB
  192 
  193 	Method(_S3D,0)	// Highest D State in S3 State
  194 	{
  195 		Return (2)
  196 	}
  197 
  198 	Method(_S4D,0)	// Highest D State in S4 State
  199 	{
  200 		Return (2)
  201 	}

in chipset manual

 

USB EHCI PCI Register Address Map 

62h–63h

PWAKE_CAP

Port Wake Capabilities

01FFh

R/W

         

 

Share this post


Link to post
Share on other sites

Hi Duffs, looks interesting, not sure if that works with my config tough.

 

So this also disables USB wake from sleep? Am a bit confused since the comments in the code suggest it does the opposite?

Share this post


Link to post
Share on other sites

And when i knew exactly what USB-port caused wake problem, how can i disable it from wake my Hack ?

Share this post


Link to post
Share on other sites

Look at this post, this is how I do it right now: http://www.insanelymac.com/forum/topic/311678-how-to-disable-wake-from-usb/?p=2237748

 

Havent tried duffs suggestion though, and frankly I doubt this will work anyways.

 

But be aware that you might have to adapt the SSDT to your config, won't work as it is for different hardware. My "solution" also disables wake on USB for the whole controller, not just a single port.

 

And I still would prefer a better solution but haven't found one.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

×