Kext Helper B7 !!!!!
![]()
Best app ever... at least for us old guys who have been around for a long time.
I'm getting nothing, finally got around to trying this, but not on 10.8.2. Rather the 10.8.3 that just got released
The only thing unusual I see in the dump is that the Asmedia 0x1042 does not support 64-bit physical addressing. I haven't really tested that condition. So what I'll do is simulate it with the xhci chip I have, and see if it screwes things up., I dumped Caps/Running to a file if that helps but it's not recognizing anything and NOTHING in Console.app. It shows up in system profiler but no devices when plugged in...
The only thing unusual I see in the dump is that the Asmedia 0x1042 does not support 64-bit physical addressing. I haven't really tested that condition. So what I'll do is simulate it with the xhci chip I have, and see if it screwes things up.
Well, if they do it means it can be done... I'll try to figure out what PXHCD is doing to accomplish that. I assume by "modified" you're referring to modbin's patch?modified PXHCD and oyen's MXHCD kexts do resume after sleep
Just to clear that part up...I find pxhcd prone to disconnects, and while they both mount drives under 'superspeed' in system information, they list the max speed as 480mbps instead of 5gbps like your driver or apple's kext when patched.
I don't know, looks like this is a common problem. Do a search for "eject drives before sleep mac" and you'll find some scripts that automate external drive ejection b4 sleep.I'm really only concerned with the error message if it means it's possible to lose date - i.e. if the caches don't get written before sleep.
Not by bin-patching, it's a ton of code that needs to be added. But if you get peak-performance with it, it makes no difference. It's just one driver cheating another driver to get things working right.Is there any way to hack mxhcd to present the device as superspeed to iousbfamily?
That's no big mystery. They all (GenericUSBXHCI too) enable PME and mark the card as "built-in". It's just AppleUSBXHCI that's got issues with this, because it checks some Apple device-properties before doing so. There's no need for that.Thanks - a couple of things I noticed about mxhcd when I did an ioreg -xrc - it shows all cards as 'built in' when other drivers do not.
It doesn't. There are 2 root hubs - superspeed and highspeed, and they're call "simulated" because they're not external USB hubs which are "real" hubs. It's just a name the kext itself chooses.Also generic or apple or both (can't remember) list the superspeed port as simulated, and mxhcd doesn't. Don't know whether that means anything.
I think PXHCD's method does add integrity as long as you don't swap the drive during sleep. It reenumerates the drive silently - the disk-cache handler doesn't know about the power loss - and continues to use the cache as if nothing happened.Considering the amount of work involved in the pxhcd method I would pick data integrity over silent reenumeration, or at least being told that the disks got ejected. Not knowing what's happening is worse.
No, no it's got nothing to do with flushing the caches. The caches are managed by a completely different part of the system (higher-layered drivers), and it's up to them to decide if to flush the caches.If it performs xhci suspend-resume presumably that means it flushes the caches before sleeping?
Why? That's the only reason it succeeds in continuing to function after resume. Your expresscards lose power, and AppleUSBXHCI gets hosed precisely because it doesn't reset the chip.Could you block it from resetting the chip after it's suspend-resume?
hibernate image path: /var/vm/sleepimage
hibernate_alloc_pages act 68005, inact 5446, anon 342, throt 0, spec 126162, wire 265599, wireinit 73045
hibernate_setup(0) took 0 ms
sizeof(IOHibernateImageHeader) == 512
kern_open_file_for_direct_io(0) took 264 ms
Opened file /var/vm/sleepimage, size 8589934592, partition base 0x0, maxio 400000 ssd 0
hibernate image major 1, minor 0, blocksize 512, pollers 5
(Re-)enabled Turbo Boost: 4000850089 -> 850089
SaveControllerStateForSleep: xHC Save Error
0 [Time 1363832035] [Message hibernate_page_list_setall(preflight 0) start 0xffffff80d12b8000, 0xffffff80d12f8000
hibernate_page_list_setall time: 302 ms
pages 435895, wire 236247, act 42947, inact 1, cleaned 0 spec 17, zf 297, throt 0, could discard act 22875 inact 5205 purgeable 1496 spec 126810 cleaned 0
hibernate_page_list_setall found pageCount 279509
IOHibernatePollerOpen, ml_get_interrupts_enabled 0
IOHibernatePollerOpen(0)
encryptStart 13290
bitmap_size 0x3f4c0, previewSize 0x57fbe8, writing 277953 pages @ 0x5d2338
encryptEnd 73a8a00
image1Size 0xb4a5c00, encryptStart1 0x13290, End1 0x73a8a00
encryptStart b4a5c00
encryptEnd ee0fe00
PMStats: Hibernate write took 4052 ms
all time: 4052 ms, comp bytes: 1138495488 time: 608 ms 1783 Mb/s, crypt bytes: 181401968 time: 333 ms 519 Mb/s,
image 249626112 (2%), uncompressed 1138495488 (277953), compressed 241989824 (21%), sum1 441f7f05, sum2 fde1a6ea
wired_pages_encrypted 172324, wired_pages_clear 62367, dirty_pages_encrypted 43262
hibernate_write_image done(0)
sleep
Disabled Turbo Boost: 850089 -> 4000850089
Wake reason = XHCI
No interval found for . Using 8000000
RTC: PowerByCalendarDate setting ignored
Previous Sleep Cause: 5
RestoreControllerStateFromSleep: xHC Restore ErrorMinitrue:GenericUSBXHCI_1.1 $./xhcdump caps
Found a device of class GenericUSBXHCI: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/RP04@1C,3/IOPCI2PCIBridge/XHCI@0/GenericUSBXHCI
Vendor 0x1b21, Device 0x1042, Revision 0
CapLength 32
HCIVersion 0x96
MaxSlots 32, MaxIntrs 8, Rsvd(1) 0, MaxPorts 4
IST 1 microframes, ERST Max 32768, Rsvd(2) 0x17, SPR N, Max Scratchpad Bufs 0
U1 Device Exit Latency 0, Rsvd(3) 0, U2 Device Exit Latency 0
AC64 N, BNC N, CSZ N, PPC N, PIND N, LHRC N, LTC N, NSS Y, Rsvd(4) 0x1, MaxPSASize 65536
xHC Extended Cap ID 1, Specific 0
Legacy CTLSTS 0x10000
xHC Extended Cap ID 2, Specific 0x300
Supported Protocol Name 0x20425355 PortOffset 1 PortCount 2 ProtocolDefined 0
xHC Extended Cap ID 2, Specific 0x200
Supported Protocol Name 0x20425355 PortOffset 3 PortCount 2 ProtocolDefined 0x1
DBOff 0x1800
RTSOff 0x1000
PageSize 4096
Using MSI
Minitrue:GenericUSBXHCI_1.1 $./xhcdump running
Found a device of class GenericUSBXHCI: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/RP04@1C,3/IOPCI2PCIBridge/XHCI@0/GenericUSBXHCI
USBCmd RS Y HCRST N INTE Y HSEE N LHCRST N CSS N CRS N EWE Y EU3S N
USBSts HCH N HSE N EINT Y PCD N SSS N RSS N SRE N CNR N HCE N
DNCtrl 0xffff
CRCr CRR Y
Config 32
MFIndex 234
Last Time Sync xHC 272384 milliseconds <-> CPU 328512475030 nanoseconds
# Configured Endpoints 0
# Interrupts: Total 137, Serviced 137, Inactive 0, Offline 0
# Save Errors 1
# Restore Errors 1
Port 1 PortSC CCS N PED N OCA N PR N
PLS RxDetect PP Y Speed Unknown PIC Off LWS N
CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N
WCE Y WDE Y WOE Y DR N WPR N
PortPmsc U1 0 U2 0 FLA N PortLi LEC 0
Port 2 PortSC CCS N PED N OCA N PR N
PLS RxDetect PP Y Speed Unknown PIC Off LWS N
CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N
WCE Y WDE Y WOE Y DR N WPR N
PortPmsc U1 0 U2 0 FLA N PortLi LEC 0
Port 3 PortSC CCS N PED N OCA N PR N
PLS RxDetect PP Y Speed Unknown PIC Off LWS N
CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N
WCE Y WDE Y WOE Y DR N WPR N
PortPmsc L1S Invalid RWE N HIRD 50 us L1Slot 0 HLE N TestMode Disabled
Port 4 PortSC CCS N PED N OCA N PR N
PLS RxDetect PP Y Speed Unknown PIC Off LWS N
CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N
WCE Y WDE Y WOE Y DR N WPR N
PortPmsc L1S Invalid RWE N HIRD 50 us L1Slot 0 HLE N TestMode Disabled
Interrupter 0 iman IP N imod I 40000 ns C 0 ns erstsz 1 erdp DESI 0 EHB N
Minitrue:GenericUSBXHCI_1.1 $./xhcdump bandwidth
Found a device of class GenericUSBXHCI: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/RP04@1C,3/IOPCI2PCIBridge/XHCI@0/GenericUSBXHCI
Bandwidth for RootHub, Speed 0
0 0 90 90
Bandwidth for RootHub, Speed 1
0 0 90 90
Bandwidth for RootHub, Speed 2
0 0 80 80
Bandwidth for RootHub, Speed 3
90 90 0 0
For Intel Series 7, when the xhci driver initializes, it yanks control of the USB 2.0 ports away from the ehci driver (assuming the ehci driver initialized earlier). This may cause problems for some devices. I'm not sure what to do about this. For the time being, if this gives you trouble, go ahead and leave the ports with the ehci driver by "-gux_defer_usb2".If i try and sleep now i just get a black screen though and cant wake up.
Also, if i bootup with my sdcard reader plugged . Once it gets to the desktop, a message appears saying 'Disk unreadable'
If i unplug, re-plug its ok. Could be a power issue? I notice the reader felt very hot which is not normal.
EDIT: it appears if i add the boot flag ' -gux_defer_usb2 ' it solves all my problems!
What is the correct way to add this to chameleon boot?
For Intel Series 7, when the xhci driver initializes, it yanks control of the USB 2.0 ports away from the ehci driver (assuming the ehci driver initialized earlier). This may cause problems for some devices. I'm not sure what to do about this. For the time being, if this gives you trouble, go ahead and leave the ports with the ehci driver by "-gux_defer_usb2".
You can add permanent kernel flags in /Extra/org.chameleon.Boot.plist in the "Kernel Flags" entry.
Edit: Try looking in your bios settings if it's possible to route the ports to xhci from boot-time, that may also solve the problem (instead of "-gux_defer_usb2").
I uploaded v1.1.3 (see post #1). Anyone that's being having trouble with not-coming-back-from-sleep, or spontaneous-reboot-on-shutdown, I suggest you try it, as I made code for those things more robust.
I've been working on an open source USB 3.0 driver for OS X for a while, and decided it's stable enough to be published.
...
Binaries contain
- build for OS 10.8.
- build for OS 10.7.
- xhcdump utility..
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1072
if (getProperty("IOPCITunnelled", gIOServicePlane) == kOSBooleanTrue) {
_v3ExpansionData->_onThunderbolt = true;
requireMaxBusStall(25000U);
}
#endif
// 10.8.2 IOUSBControllerV3::V3ExpansionData
struct V3ExpansionData {
uint32_t _rootHubPollingRate32;
bool _rootHubTransactionWasAborted;
IOPMDriverAssertionID _externalUSBDeviceAssertionID;
SInt32 _externalDeviceCount;
UInt32 _inCheckPowerModeSleeping;
bool _onThunderbolt;
// added 10.7.2
uint32_t _thunderboltModelID;
uint32_t _thunderboltVendorID;
// added 10.7.5 (#ifdef SUPPORTS_SS_USB)
UInt8 _rootHubNumPortsSS;
UInt8 _rootHubNumPortsHS;
UInt8 _rootHubPortsHSStartRange;
UInt8 _rootHubPortsSSStartRange;
IOUSBRootHubInterruptTransaction _outstandingSSRHTrans[4];
// added 10.8.2
bool _wakingFromStandby; // t when waking from S4 stanby
};
0 members, 3 guests, 0 anonymous users