Contribute
Register

Unwanted wake ups in Mavericks "Wake reason: XHC"

Joined
Apr 19, 2014
Messages
139
Motherboard
GA-Z87MX-D3H
CPU
Xeon E3-1230 v3
Graphics
MSI GTX 760 TF OC
Mac
  1. iMac
Classic Mac
Mobile Phone
  1. iOS
Hello,
I am experiencing an apparently common issue with Mavericks (the only OS I tested): after I put the computer to sleep, it wakes up immediately and then goes back to sleep, and again in an infinite loop.

I found that the Dell U2413 I have triggers the issue, but it is not the source of the issue: my real iMac stay correctly in stop (I checked the system.log of the old Mac, I don't have the machine ready). The iMac was connected using DVI, this time I use DisplayPort, but it should not matter because I can avoid the issue by disconnecting the monitor-to-hackintosh USB cable. Also, the iMac was using USB2, the hackintosh has USB3.
As additional information, I disconnected every USB device from the hub in the monitor, it's only the monitor.

I had GenericUSBXHCI.kext version 1.2.7 from MultiBeast 6.2.1 and I had already found out some kexts are quite old (PS" kext for example), so I updated to the most up-to-date 1.2.8 from https://github.com/RehabMan/OS-X-Generic-USB3 but this didn't help.

My configuration is GA-Z87MX-D3H DSTD-free, Mavericks 10.9.2, MultiBeast 6.2.1 (except for VoodooPS2 kext from Rehab).

When the computer wakes up, I get this in the system.log:
Code:
03/05/14 13:11:40,000 kernel[0]: CommandStop: Timeout waiting for command ring to stop, 100ms
03/05/14 13:11:40,000 kernel[0]: Wake reason: XHC
03/05/14 13:11:45,000 kernel[0]: RTC: PowerByCalendarDate setting ignored
03/05/14 13:11:45,000 kernel[0]: RTC: PowerByCalendarDate setting ignored
03/05/14 13:11:45,000 kernel[0]: Previous Sleep Cause: 5
03/05/14 13:11:45,000 kernel[0]: The USB device HubDevice (Port 4 of Hub at 0x14000000) may have caused a wake by issuing a remote wakeup (2)
03/05/14 13:11:45,000 kernel[0]: The USB device HubDevice (Port 3 of Hub at 0x14400000) may have caused a wake by issuing a remote wakeup (3)
03/05/14 13:11:45,000 kernel[0]: An Unknown USB Device (Port 3 of Hub at 0x14430000), may have caused a wake by being connected

then it goes by itself to sleep again, and it wakes up by itself immediately:
Code:
03/05/14 13:12:37,000 kernel[0]: Wake reason: XHC
03/05/14 13:12:37,000 kernel[0]: RTC: PowerByCalendarDate setting ignored
03/05/14 13:12:37,000 kernel[0]: RTC: PowerByCalendarDate setting ignored
03/05/14 13:12:37,000 kernel[0]: Previous Sleep Cause: 5
03/05/14 13:12:37,000 kernel[0]: The USB device HubDevice (Port 4 of Hub at 0x14000000) may have caused a wake by issuing a remote wakeup (2)
03/05/14 13:12:37,000 kernel[0]: The USB device HubDevice (Port 3 of Hub at 0x14400000) may have caused a wake by issuing a remote wakeup (3)

Notice that the "Unknown USB Device (Port 3 of Hub at 0x14430000)" this time is not listed.

This time I turned off the monitor, without disconnecting the cable, and it stayed in sleep, until I pressed a key on the mouse:

Code:
03/05/14 13:13:31,000 kernel[0]: Wake reason: XHC
03/05/14 13:14:07,000 kernel[0]: RTC: PowerByCalendarDate setting ignored
03/05/14 13:14:07,000 kernel[0]: RTC: PowerByCalendarDate setting ignored
03/05/14 13:14:07,000 kernel[0]: Previous Sleep Cause: 5
03/05/14 13:14:07,000 kernel[0]: RestoreControllerStateFromSleep(XHCI Root Hub USB 2.0 Simulation): Port 4 on bus 0xa connected: portSC(0xe0206e1)
03/05/14 13:14:07,000 kernel[0]: The USB device USB Optical Mouse (Port 5 of Hub at 0x14000000) may have caused a wake by issuing a remote wakeup (2)
03/05/14 13:14:07,000 kernel[0]: RestoreControllerStateFromSleep: Port 18 on bus 0xa - connect status changed but still enabled. clearing enable bit: portSC(0xe021203)
03/05/14 13:14:07,000 kernel[0]: full wake (reason 1) 22 ms

I will just turn off the monitor in the future, but still I find this strange. Any idea or possible solution? This is the only issue left for my hackintosh to perform perfectly like a real Mac!! (for the time being)

Some other posts with the same issue:
Gigabyte Z87N-Wifi instantly wakes after going to sleep
#51 (different thread)
#85 (different thread)
Sleep but wakes up after a few seconds
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
188,867
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Hello,
I am experiencing an apparently common issue with Mavericks (the only OS I tested): after I put the computer to sleep, it wakes up immediately and then goes back to sleep, and again in an infinite loop.
...

Try using kernel flag -gux_defer_usb2.
 
Joined
Apr 19, 2014
Messages
139
Motherboard
GA-Z87MX-D3H
CPU
Xeon E3-1230 v3
Graphics
MSI GTX 760 TF OC
Mac
  1. iMac
Classic Mac
Mobile Phone
  1. iOS
I added it and I will test a reboot later.

Just to know: I read "-gux_defer_usb2 kernel flag causes the xHC to defer the management of USB2 ports and their devices to one of the EHC controllers on the PCH".

Are there downsides? since I can avoid the issue by turning off the monitor, it is good to do a costs/advantages evaluation.

Thanks
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
188,867
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
I added it and I will test a reboot later.

Just to know: I read "-gux_defer_usb2 kernel flag causes the xHC to defer the management of USB2 ports and their devices to one of the EHC controllers on the PCH".

Are there downsides? since I can avoid the issue by turning off the monitor, it is good to do a costs/advantages evaluation.

Thanks

Try it. Test for "downsides"...
 
Joined
Apr 19, 2014
Messages
139
Motherboard
GA-Z87MX-D3H
CPU
Xeon E3-1230 v3
Graphics
MSI GTX 760 TF OC
Mac
  1. iMac
Classic Mac
Mobile Phone
  1. iOS
You are right, testing first.
It doesn't solve the issue.

Now I get:
Code:
03/05/14 17:28:11,000 kernel[0]: Wake reason: GLAN EHC1 EHC2 XHC HDEF (Network)03/05/14 17:28:20,000 kernel[0]: RTC: PowerByCalendarDate setting ignored
03/05/14 17:28:20,000 kernel[0]: RTC: PowerByCalendarDate setting ignored
03/05/14 17:28:20,000 kernel[0]: Previous Sleep Cause: 5
03/05/14 17:28:20,000 kernel[0]: The USB device HubDevice (Port 1 of Hub at 0x1d000000) may have caused a wake by issuing a remote wakeup (2)
03/05/14 17:28:20,000 kernel[0]: The USB device HubDevice (Port 4 of Hub at 0x1d100000) may have caused a wake by issuing a remote wakeup (3)
03/05/14 17:28:20,000 kernel[0]: The USB device HubDevice (Port 3 of Hub at 0x1d140000) may have caused a wake by issuing a remote wakeup (3)
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
188,867
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
You are right, testing first.
It doesn't solve the issue.

Now I get:
Code:
03/05/14 17:28:11,000 kernel[0]: Wake reason: GLAN EHC1 EHC2 XHC HDEF (Network)03/05/14 17:28:20,000 kernel[0]: RTC: PowerByCalendarDate setting ignored
03/05/14 17:28:20,000 kernel[0]: RTC: PowerByCalendarDate setting ignored
03/05/14 17:28:20,000 kernel[0]: Previous Sleep Cause: 5
03/05/14 17:28:20,000 kernel[0]: The USB device HubDevice (Port 1 of Hub at 0x1d000000) may have caused a wake by issuing a remote wakeup (2)
03/05/14 17:28:20,000 kernel[0]: The USB device HubDevice (Port 4 of Hub at 0x1d100000) may have caused a wake by issuing a remote wakeup (3)
03/05/14 17:28:20,000 kernel[0]: The USB device HubDevice (Port 3 of Hub at 0x1d140000) may have caused a wake by issuing a remote wakeup (3)

I don't know much about your specific board, but on laptops we solve with DSDT patches usually...

https://github.com/RehabMan/Laptop-DSDT-Patch
Apply: "7-series USB" (I'm aware you have 8-series board).
 
Joined
Apr 19, 2014
Messages
139
Motherboard
GA-Z87MX-D3H
CPU
Xeon E3-1230 v3
Graphics
MSI GTX 760 TF OC
Mac
  1. iMac
Classic Mac
Mobile Phone
  1. iOS
Well, since I am avoiding DSTD completely (I haven't read about it, what it does, how to apply it, disadvantages, ...), I will just turn the monitor off.

Funny is that if I search "dell monitor usb wakeup" I get the opposite problem, people with Dell monitors not waking up after sleep :)
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
188,867
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Using the kernel flag you suggested I cannot get proper sleep even with monitor turned off!
I will remove the flag.

It needs to be used in conjunction with the DSDT patches mentioned in post #6.
 
Joined
Apr 19, 2014
Messages
139
Motherboard
GA-Z87MX-D3H
CPU
Xeon E3-1230 v3
Graphics
MSI GTX 760 TF OC
Mac
  1. iMac
Classic Mac
Mobile Phone
  1. iOS
The issue was related to the Dell U2413 monitor and more precisely to its USB hub. It was somehow damaged and it caused maybe too high current draw, even without devices, therefore the hub on the motherboard was shutting the USB system on and off continuously.
This was almost completely transparent under OS X, I only noticed (but I did not associate it to the monitor) that sometimes USB sticks were unmounting by themselves and that the magic touchpad was extremely jumpy.
As soon as I tried to install Win 8, I noticed that the keyboard and mouse were shutting on and off continuously and when I disconnected the USB hub of the monitor the problem was gone. Funny that keyboard and mouse never gave any problem on OSX.

Now with a replacement monitor the XHC problem is gone.
 
Top