Jump to content

USB sleep then wake "Device Removal" problem


  • Please log in to reply
150 replies to this topic

#41
ApexDE

ApexDE

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 217 posts
Anyone found a DSDT Patch Solution for the "missing" powermanagement-ability-info on the EHCI Devices?

#42
Fine Vision

Fine Vision

    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 4 posts
Hello.

I have iATKOS v7 10.5.7 on Asus P5N32-E. All works fine. All my USB devices mounting correctly, but it's only until machine go to sleep. After it's wakes up and I trying to mounting flash-drive or external USB HDD i have a kernel panic.

Anyone can halp me?

Sorry for my english.
Thanks.

#43
ApexDE

ApexDE

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 217 posts
OK guys, i managed to patch my DSDT to get the EHCI USB Ports sleeping.

Unloading the Controller during Sleep results in USB Drives being removed by force without unmounting, which might result in data-loss:

kernel	USBF:	0.392	AppleUSBEHCI[0x6838800]::CheckSleepCapability - controller will be unloaded across sleep

The Apple USB Drivers search for a device property "AAPL,clock-id", if it is found the ports are flagged built-in, if not, they will be unloaded during sleep. I renamed my EHCI Devices to EHC1 and EHC2. This is just cosmetical, search for your EHCI Devices by the adresses (e.g 0x001D0007 , 0x001A0007 for Gigabyte)


Here is my EHCI DSDT Part:


Device (EHC1)
			{
				Name (_ADR, 0x001D0007)
				Method (_S3D, 0, NotSerialized)
				{
					If (LEqual (OSFL, 0x02))
					{
						Return (0x02)
					}

					Return (0x03)
				}

				Name (_PRW, Package (0x02)
				{
					0x0D, 
					0x03
				})
						Method (_DSM, 4, NotSerialized)
						{
						   Store (Package (0x04)
							   {
								 "AAPL,clock-id",
								 Buffer (0x01)
								 {
									 0x01
								 },
								 "device_type",
								 Buffer (0x05)
								 {
									"EHCI"
								 }
								}, Local0)
							DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
							Return (Local0)
						}
			

			}

			Device (EHC2)
			{
				Name (_ADR, 0x001A0007)
				Method (_S3D, 0, NotSerialized)
				{
					If (LEqual (OSFL, 0x02))
					{
						Return (0x02)
					}

					Return (0x03)
				}

				Name (_PRW, Package (0x02)
				{
					0x0D, 
					0x03
				})
						Method (_DSM, 4, NotSerialized)
						{
						   Store (Package (0x04)
							   {
								 "AAPL,clock-id",
								 Buffer (0x01)
								 {
									 0x02
								 },
								 "device_type",
								 Buffer (0x05)
								 {
									"EHCI"
								 }
								}, Local0)
							DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
							Return (Local0)
						}

			}


#44
kizwan

kizwan

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 1,422 posts
Hi ApexDE,

Very nice finding. I don't have this message in my log file:-

kernel USBF: 0.392 AppleUSBEHCI[0x6838800]::CheckSleepCapability - controller will be unloaded across sleep

but I'm too experiencing the same problem where USB drives violently ejected without properly unmounted during sleep.

This may fix the problem. Thank you for sharing. :P

kizwan

#45
kmare

kmare

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 121 posts
  • Gender:Male
  • Location:Toronto
Apex - great patch confirmed working in 10.6 on my ep45 ud3p -- i wish i could say the same for the other guides floating around

#46
mm67

mm67

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 673 posts
  • Gender:Male
  • Location:Finland
Works for me as well. Using ep45 ud3

#47
cparm

cparm

    InsanelyMac Legend

  • Retired
  • 997 posts
  • Gender:Male
my usb2 (ehci) port are now reported as built-in, no "controller will be unloaded across sleep" error anymore, but my system refuse to sleep with this patch :)

i also noticed that my usb1 (uhci) port are still not built-in

#48
mm67

mm67

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 673 posts
  • Gender:Male
  • Location:Finland
For me this works on both Leopard and SL, now if it was only possible to wake up with keyboard or mouse or Apple remote, on my old MSI P43-Neo I was able to use all those for waking up.

#49
hernando

hernando

    InsanelyMac Protégé

  • Members
  • Pip
  • 8 posts
Guys, please help a noob. I have been looking for a solution to this problem for weeks and weeks.

How exactly do I use Apex's code in my dsdt? I know how to do the patching and all; I have partched my file for Audio, network, and video.

But exactly WHERE do I put this code in my dsdt.dsl, before reassembling? Do I paste these 2 devices at the end of the file, or am I supposed to replace an existing section with these sections. I could not locate any EHC devices in my current patched dsdt.

I do have the EP45-UD3P board that you guys have, with an nVidia 9800 GTX.... I am attaching my dsdt.dsl file.

EDIT: NEVER MIND I figured it out.... I works perfectly for me in SL.


Thanks guys!! APEX :D

Attached Files



#50
stellarola

stellarola

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 682 posts
  • Gender:Male
  • Location:Lextown, KY
Apex,

Added the fix to my blog, http://stellarola.tumblr.com/

Thanks a lot for this, it's sure to help out a lot of folks. :)

-Stell

#51
MACinized

MACinized

    Addicted to InsanelyMac

  • Members
  • PipPipPipPipPipPipPip
  • 559 posts
  • Gender:Male
  • Location:OSx86 Community
here's for my dsdt:
Device (USBE)
			{
				Name (_ADR, 0x001D0007)
				Method (_S3D, 0, NotSerialized)
				{
					If (LEqual (OSFL, 0x02))
					{
						Return (0x02)
					}

					Return (0x03)
				}

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

			Name (NATA, Package (0x01)
			{
				0x001F0001
			})
will u, ApexDE &/or stell, help me how to proceed?

tia.

btw, tried to follow the aboveposted fix by ApexDE, no dsdt.aml can be compiled. i'm getting this:
Intel ACPI Component Architecture
ASL Optimizing Compiler version 20080926 [Oct  4 2008]
Copyright (C) 2000 - 2008 Intel Corporation
Supports ACPI Specification Revision 3.0a

./dsdt_fixed.txt   222:	 Method (_WAK, 1, NotSerialized)
Warning  1080 -						^ Reserved method must return a value (_WAK)

./dsdt_fixed.txt  3121:						 DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Error	4063 -			  Object does not exist ^  (DTGP)

ASL Input:  ./dsdt_fixed.txt - 4532 lines, 147797 bytes, 1624 keywords
Compilation complete. 1 Errors, 1 Warnings, 0 Remarks, 34 Optimizations



Compiling done, if it worked, you have now a patched DSDT in dsdt.aml
If the compiling went wrong, you could force to build it with ./DSDT\ Patcher -f (try this DSDT at your own risk)


#52
ApexDE

ApexDE

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 217 posts
@ kizwan
does your Applesystemprofiler show the highspeed ports as built-in? Search your logs for Sleepcapability. If your ports are unloaded at sleep then you need the fix too.


@ macinized

You need to add the DTGP Method just after the _WAK Method in your DSDT:


Method (DTGP, 5, NotSerialized)
	{
		If (LEqual (Arg0, Buffer (0x10)
				{
					/* 0000 */	0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44, 
					/* 0008 */	0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B
				}))
		{
			If (LEqual (Arg1, One))
			{
				If (LEqual (Arg2, Zero))
				{
					Store (Buffer (One)
						{
							0x03
						}, Arg4)
					Return (One)
				}

				If (LEqual (Arg2, One))
				{
					Return (One)
				}
			}
		}

		Store (Buffer (One)
			{
				0x00
			}, Arg4)
		Return (One)
	}


#53
MACinized

MACinized

    Addicted to InsanelyMac

  • Members
  • PipPipPipPipPipPipPip
  • 559 posts
  • Gender:Male
  • Location:OSx86 Community
kewl!

got it working now ApexDE. tnx a lot.

no more "The disk was not ejected properly. ..." error after waking-up from sleep.

OSx86 just gets better. tnx to people like u. :(

[update]

this patch to dsdt seems to distort my sound. using voodoohda & after booting using the newly-patched dsdt, my sounds sound broken (i.e. "krrk... krrk..." from time to time). :)

anyone got this same problem?

while at this, is there anyone who can point me to the right direction on how/what to edit in dsdt to make my alc888 work w/out any extra kext?

[update2]

it seems that the dsdt-patch is NOT the cause of distortion of my sounds. sound distortion only happens after waking-up from sleep.

when i rebooted, sounds fine again.

then my macPC still has sleep-problem. :P

#54
thorias

thorias

    InsanelyMac Protégé

  • Members
  • PipPip
  • 65 posts

OK guys, i managed to patch my DSDT to get the EHCI USB Ports sleeping.

Unloading the Controller during Sleep results in USB Drives being removed by force without unmounting, which might result in data-loss:

kernel	USBF:	0.392	AppleUSBEHCI[0x6838800]::CheckSleepCapability - controller will be unloaded across sleep

The Apple USB Drivers search for a device property "AAPL,clock-id", if it is found the ports are flagged built-in, if not, they will be unloaded during sleep. I renamed my EHCI Devices to EHC1 and EHC2. This is just cosmetical, search for your EHCI Devices by the adresses (e.g 0x001D0007 , 0x001A0007 for Gigabyte)


Here is my EHCI DSDT Part:


Device (EHC1)
			 {
				 Name (_ADR, 0x001D0007)
				 Method (_S3D, 0, NotSerialized)
				 {
					 If (LEqual (OSFL, 0x02))
					 {
						 Return (0x02)
					 }
 
					 Return (0x03)
				 }
 
				 Name (_PRW, Package (0x02)
				 {
					 0x0D, 
					 0x03
				 })
						 Method (_DSM, 4, NotSerialized)
						 {
							Store (Package (0x04)
								{
								  "AAPL,clock-id",
								  Buffer (0x01)
								  {
									  0x01
								  },
								  "device_type",
								  Buffer (0x05)
								  {
									 "EHCI"
								  }
								 }, Local0)
							 DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
							 Return (Local0)
						 }
			 
 
			 }
 
			 Device (EHC2)
			 {
				 Name (_ADR, 0x001A0007)
				 Method (_S3D, 0, NotSerialized)
				 {
					 If (LEqual (OSFL, 0x02))
					 {
						 Return (0x02)
					 }
 
					 Return (0x03)
				 }
 
				 Name (_PRW, Package (0x02)
				 {
					 0x0D, 
					 0x03
				 })
						 Method (_DSM, 4, NotSerialized)
						 {
							Store (Package (0x04)
								{
								  "AAPL,clock-id",
								  Buffer (0x01)
								  {
									  0x02
								  },
								  "device_type",
								  Buffer (0x05)
								  {
									 "EHCI"
								  }
								 }, Local0)
							 DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
							 Return (Local0)
						 }
 
			 }


Thanks man I have a Gigabyte EP45C-DS3R and worked perfectly!!! :)

#55
tuxianer

tuxianer

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 155 posts
Hi,
I have the same problem with my EP35-DS3 here ist my DSDT: http://pastebin.com/fa6c132a.

Is it possible to fix the error on my board?

#56
Innerz

Innerz

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 280 posts
Thank you so much, it's working great also on GA-965p-DS4 :(

#57
tuxianer

tuxianer

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 155 posts
I try this fixes without any success: http://pastebin.com/f72848271

#58
Dalton63841

Dalton63841

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 295 posts
  • Gender:Male
I have an MSI Wind U100 that got the Device Removal Error. After performing that patch it made it worse. This is what I got: Attached File  Picture_1.png   84.52KB   79 downloads

#59
suri2001

suri2001

    InsanelyMac Protégé

  • Members
  • Pip
  • 44 posts

when i compile i get always these two errors:



/Users/mash/Desktop/SL Pack/DSDTs/dsdt.dsl 4182: DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Error 4067 - Object is not accessible from this scope ^ (DTGP)


Users/mash/Desktop/SL Pack/DSDTs/dsdt.dsl 4222: DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Error 4067 - Object is not accessible from this scope ^ (DTGP)


any idea?

this is what it looks like:

Device (USBE)
{
Name (_ADR, 0x001D0007)
Method (_S3D, 0, NotSerialized)
{
If (LEqual (OSFL, 0x02))
{
Return (0x02)
}

Return (0x03)
}

Name (_PRW, Package (0x02)
{
0x0D,
0x03
})
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x04)
{
"AAPL,clock-id",
Buffer (0x01)
{
0x01
},
"device_type",
Buffer (0x05)
{
"EHCI"
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}


}

Device (USE2)
{
Name (_ADR, 0x001A0007)
Method (_S3D, 0, NotSerialized)
{
If (LEqual (OSFL, 0x02))
{
Return (0x02)
}

Return (0x03)
}

Name (_PRW, Package (0x02)
{
0x0D,
0x03
})
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x04)
{
"AAPL,clock-id",
Buffer (0x01)
{
0x02
},
"device_type",
Buffer (0x05)
{
"EHCI"
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}

}


#60
ApexDE

ApexDE

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 217 posts
look at post #52





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy