Contribute
Register

After Sleep Shows "The disk was not ejected properly" Error

Status
Not open for further replies.
Joined
Mar 10, 2012
Messages
204
Motherboard
ASUS ROG Strix B760-I
CPU
i5-13500
Graphics
RX 6600 XT
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
It troubles me for long time.... tried many workaround but without luck......
My laptop has 3 USB ports, 2 of them are USB3, and 1 is USB2.

So here is what I did:

1. USB patched for EHC1 and XHC using Rehabman's patch. But laptop instantly wake after sleep.
2. _PRW seems to be the troublemaker. Here is the original _PRW DSDT for XHC device:
Method (_PRW, 0, NotSerialized) // _PRW: Power Resources for Wake
{
If (WUSB)
{
If (LEqual (PWRS, One))
{
Return (GPRW (0x6D, 0x04))
}
Else
{
Return (Package (0x02)
{
Zero,
Zero
})
}
}
Else
{
Return (Package (0x02)
{
Zero,
Zero
})
}
}

So I changed to:
Name (_PRW, Package (0x02) // _PRW: Power Resources for Wake
{
0x6D,
0x00
})

for both EHC and XHC to disable USB wake. Now sleep has no problem.
However, new problem arises that USB drive get ejected after sleep/wake.

3. I've noticed that only Lid Sleep will cause the above problem. If click sleep button under Apple logo and not close lid, the USB drive will not be ejected after sleep, thus no error.

One workaround I used is to change _PRW under Device (Lid0) from:
Name (_PRW, Package (0x02) // _PRW: Power Resources for Wake
{
0x18,
0x03
})

to:
Name (_PRW, Package (0x02) // _PRW: Power Resources for Wake
{
0x18,
0x00
})

or just delete it.
By doing this the USB ejection problem can be solved, but I will lose Lid wake. I wonder if I can get both Lid wake and USB ejection working properly. For now only one of them work at a time.
 
It troubles me for long time.... tried many workaround but without luck......
My laptop has 3 USB ports, 2 of them are USB3, and 1 is USB2.

So here is what I did:

1. USB patched for EHC1 and XHC using Rehabman's patch. But laptop instantly wake after sleep.
2. _PRW seems to be the troublemaker. Here is the original _PRW DSDT for XHC device:
Code:
Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
            {
                If (WUSB)
                {
                    If (LEqual (PWRS, One))
                    {
                        Return (GPRW (0x6D, 0x04))
                    }
                    Else
                    {
                        Return (Package (0x02)
                        {
                            Zero, 
                            Zero
                        })
                    }
                }
                Else
                {
                    Return (Package (0x02)
                    {
                        Zero, 
                        Zero
                    })
                }
            }
So I changed to:
Code:
Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
            {
                0x6D, 
                0x00
            })

for both EHC and XHC to disable USB wake. Now sleep has no problem.
However, new problem arises that USB drive get ejected after sleep/wake.

3. I've noticed that only Lid Sleep will cause the above problem. If click sleep button under Apple logo and not close lid, the USB drive will not be ejected after sleep, thus no error.

One workaround I used is to change _PRW under Device (Lid0) from:
Code:
Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
            {
                0x18, 
                0x03
            })
to:
Code:
Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
            {
                0x18, 
                0x00
            })

or just delete it.
By doing this the USB ejection problem can be solved, but I will lose Lid wake. I wonder if I can get both Lid wake and USB ejection working properly. For now only one of them work at a time.

This is the same method I'm using on my u430. It would be nice to get to the root of "instant wake" problem, but so far I don't understand what really causes it.

But I haven't noticed any difference between lid sleep and normal sleep. Of course, I don't use lid sleep much... so I'll try to do some testing just to see if my results mirror yours.
 
This is the same method I'm using on my u430. It would be nice to get to the root of "instant wake" problem, but so far I don't understand what really causes it.

But I haven't noticed any difference between lid sleep and normal sleep. Of course, I don't use lid sleep much... so I'll try to do some testing just to see if my results mirror yours.

I just added ACPIdebug.kext and some outputs for debug, but I did not see any difference between normal sleep and lid sleep. But USB port did behave differently. More specifically, under normal sleep, the mouse's light will be turned off during sleep, but can turn on if I click a button of the mouse. But the light will not turn on in lid sleep. It appears that Lid sleep will totally shut down the USB port, instead of put into sleep mode.

Here are the ACPIDebug logs FYI, I have put notes about the normal sleep and lid part:

First boot:
May 6 13:21:41 Peters-MacBook-Pro.local com.apple.kextcache[749]: kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext ACPIDebug.kext
May 6 13:36:35 localhost kernel[0]: ACPIDebug: Version 0.1.2 starting
May 6 13:36:35 localhost kernel[0]: ACPIDebug: { "EHC1._PRW enter", 0x1, }
May 6 13:36:35 localhost kernel[0]: ACPIDebug: "XHC._PRW enter"
May 6 13:36:35 localhost kernel[0]: ACPIDebug: "XHC._PS0 enter"
May 6 13:36:35 localhost kernel[0]: ACPIDebug: "XHC._PS0 exit"
May 6 13:36:35 localhost kernel[0]: ACPIDebug: { "LID0._PSW enter", 0x0, }
May 6 13:36:35 localhost kernel[0]: ACPIDebug: "LID0._LID enter"
May 6 13:36:35 localhost kernel[0]: ACPIDebug: { "LID0._LID exit", 0x1, }
May 6 13:36:36 Peters-MacBook-Pro kernel[0]: ACPIDebug: "LID0._LID enter"
May 6 13:36:36 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "LID0._LID exit", 0x1, }
May 6 13:36:36 Peters-MacBook-Pro kernel[0]: ACPIDebug: "LID0._LID enter"
May 6 13:36:36 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "LID0._LID exit", 0x1, }
May 6 13:36:36 Peters-MacBook-Pro kernel[0]: ACPIDebug: 0x0
May 6 13:36:36 Peters-MacBook-Pro kernel[0]: ACPIDebug: "LID0._LID enter"
May 6 13:36:36 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "LID0._LID exit", 0x1, }


Normal Sleep:
May 6 13:45:19 Peters-MacBook-Pro kernel[0]: ACPIDebug: "XHC._PS3 enter"
May 6 13:45:19 Peters-MacBook-Pro kernel[0]: ACPIDebug: "XHC._PS3 exit"
May 6 13:45:20 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "LID0._PSW enter", 0x1, }
May 6 13:45:20 Peters-MacBook-Pro kernel[0]: ACPIDebug: "LID0._PSW exit"
May 6 13:45:20 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "_PTS enter", 0x3, }
May 6 13:45:37 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "_WAK enter", 0x3, }
May 6 13:45:37 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "LID0._PSW enter", 0x0, }
May 6 13:45:37 Peters-MacBook-Pro kernel[0]: ACPIDebug: "LID0._PSW exit"
May 6 13:45:37 Peters-MacBook-Pro kernel[0]: ACPIDebug: "LID0._LID enter"
May 6 13:45:37 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "LID0._LID exit", 0x1, }
May 6 13:45:37 Peters-MacBook-Pro kernel[0]: ACPIDebug: "LID0._LID enter"
May 6 13:45:37 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "LID0._LID exit", 0x1, }
May 6 13:45:37 Peters-MacBook-Pro kernel[0]: ACPIDebug: 0x0
May 6 13:45:37 Peters-MacBook-Pro kernel[0]: ACPIDebug: "XHC._PS0 enter"
May 6 13:45:37 Peters-MacBook-Pro kernel[0]: ACPIDebug: "XHC._PS0 exit"


Lid Sleep:
May 6 13:47:29 Peters-MacBook-Pro kernel[0]: ACPIDebug: "LID0._LID enter"
May 6 13:47:29 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "LID0._LID exit", 0x0, }
May 6 13:47:48 Peters-MacBook-Pro kernel[0]: ACPIDebug: "XHC._PS3 enter"
May 6 13:47:48 Peters-MacBook-Pro kernel[0]: ACPIDebug: "XHC._PS3 exit"
May 6 13:47:48 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "LID0._PSW enter", 0x1, }
May 6 13:48:11 Peters-MacBook-Pro kernel[0]: ACPIDebug: "LID0._PSW exit"
May 6 13:48:11 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "_PTS enter", 0x3, }
May 6 13:48:11 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "_WAK enter", 0x3, }
May 6 13:48:11 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "LID0._PSW enter", 0x0, }
May 6 13:48:11 Peters-MacBook-Pro kernel[0]: ACPIDebug: "LID0._PSW exit"
May 6 13:48:11 Peters-MacBook-Pro kernel[0]: ACPIDebug: "LID0._LID enter"
May 6 13:48:11 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "LID0._LID exit", 0x1, }
May 6 13:48:11 Peters-MacBook-Pro kernel[0]: ACPIDebug: "LID0._LID enter"
May 6 13:48:11 Peters-MacBook-Pro kernel[0]: ACPIDebug: { "LID0._LID exit", 0x1, }
May 6 13:48:11 Peters-MacBook-Pro kernel[0]: ACPIDebug: 0x0
May 6 13:48:11 Peters-MacBook-Pro kernel[0]: ACPIDebug: "XHC._PS0 enter"
May 6 13:48:11 Peters-MacBook-Pro kernel[0]: ACPIDebug: "XHC._PS0 exit"
 
This is the same method I'm using on my u430. It would be nice to get to the root of "instant wake" problem, but so far I don't understand what really causes it.

But I haven't noticed any difference between lid sleep and normal sleep. Of course, I don't use lid sleep much... so I'll try to do some testing just to see if my results mirror yours.

Another finding. It seems the USB problem is related to my BIOS setting.

There is option "USB Wake Support" under BIOS. If it is disabled, both Lid sleep and normal sleep are problematic, meaning USB get ejected after sleep/wake. Turn on "USB wake support" solves the problem for normal sleep, but not for Lid sleep....
 
Another finding. It seems the USB problem is related to my BIOS setting.

There is option "USB Wake Support" under BIOS. If it is disabled, both Lid sleep and normal sleep are problematic, meaning USB get ejected after sleep/wake. Turn on "USB wake support" solves the problem for normal sleep, but not for Lid sleep....

Download patchmatic: https://bitbucket.org/RehabMan/os-x-maciasl-patchmatic/downloads/RehabMan-patchmatic-2015-0107.zip
Extract the 'patchmatic' binary from the ZIP. Copy it to /usr/bin, such that you have the binary at /usr/bin/patchmatic.

In terminal,
Code:
rm -R ~/Downloads/RehabMan
mkdir ~/Downloads/RehabMan
cd ~/Downloads/RehabMan
patchmatic -extract

Post contents of Downloads/RehabMan directory (as ZIP).

Also, post ioreg: http://www.tonymacx86.com/audio/58368-guide-how-make-copy-ioreg.html. Please, use the IORegistryExplorer v2.1 attached to the post! DO NOT reply with an ioreg from any other version of IORegistryExplorer.app.

And output from:
Code:
kextstat|grep -y acpiplat
kextstat|grep -y appleintelcpu
 
Download patchmatic: https://bitbucket.org/RehabMan/os-x-maciasl-patchmatic/downloads/RehabMan-patchmatic-2015-0107.zip
Extract the 'patchmatic' binary from the ZIP. Copy it to /usr/bin, such that you have the binary at /usr/bin/patchmatic.

In terminal,
Code:
rm -R ~/Downloads/RehabMan
mkdir ~/Downloads/RehabMan
cd ~/Downloads/RehabMan
patchmatic -extract

Post contents of Downloads/RehabMan directory (as ZIP).

Also, post ioreg: http://www.tonymacx86.com/audio/58368-guide-how-make-copy-ioreg.html. Please, use the IORegistryExplorer v2.1 attached to the post! DO NOT reply with an ioreg from any other version of IORegistryExplorer.app.

And output from:
Code:
kextstat|grep -y acpiplat
kextstat|grep -y appleintelcpu

Before I try it, I should tell you another thing. I just found I have exactly same problem under Windows as well. It is just Windows has no warning message for USB ejection. But everything else behaves the same...
 
Status
Not open for further replies.
Back
Top