Patching the kernel to work around the issue
I do not recommend you do this. You're editing the binary of a very important file. If it gets messed up, well, ya. But this is the only solution.
This is likely 10.9.4 specific.
Location 0x00016942
of /System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBXHCI.kext/Contents/MacOS/AppleUSBXHCI
should contain 66 B9 60 00.
That translates to mov cx, 60h
I edited it to 66 B9 *80* 00
and all of my devices come online now. I assume going even higher, or removing the "errata" check altogether, is also safe. If you run into trouble you can just unplug devices and reboot.
Research
It appears to be breaking inside of the function AppleUSBXHCI::TestConfiguredEpCount
in AppleUSBXHCIUIM.cpp.
Which is using a max value, which is set from:
// default max number of endpoints we allow to be configured
_maxControllerEndpoints = kMaxXHCIControllerEndpoints;
// this will switch the mux for panther point
EnableXHCIPorts();
if( (_errataBits & kXHCIErrataPPT) != 0)
{
// Panther Point - limit endpoints to 64 <rdar://problem/10385765>
// does this need a separate errata bit?
_maxControllerEndpoints = 64;
}
The flags are being set by this code
static ErrataListEntry errataList[] = {
{0x1033, 0x0194, 0, 0xffff, kXHCIErrata_NEC}, // NEC XHCI, check firmware
{0x1b73, 0x1000, 0, 0xffff, kXHCIErrata_NoMSI}, // Fresco Logic XHCI
{0x8086, 0x1e31, 0, 0xffff, kXHCIErrataPPT | kXHCIErrataPPTMux | kXHCIErrata_EnableAutoCompliance | kErrataSWAssistXHCIIdle | kXHCIErrata_ParkRing}, // Intel Panther Point
{0x1b21, 0, 0, 0xffff, kXHCIErrata_ASMedia}, // ASMedia XHCI
{0x1b73, 0, 0, 0xffff, kXHCIErrata_FrescoLogic},// Fresco Logic
{0x1b73, 0x1100, 0, 16, kXHCIErrata_FL1100_Ax}, // Fresco Logic FL1100-Ax
{0x1b6f, 0x7052, 1, 0xffff, kXHCIErrata_Etron7052}
};
0x1e31 is the Device ID of my MacBook Pro's built in USB controller!
The logging shows my max limit is set to 96 (it hits 97 and sets the err value causing it to revert). This source is old as Apple has closed the source to IOUSBFamily a while ago, so there's no real way to tell where the 96 is coming from, but the conclusion appears to be my hub is black listed by the OSX kernel for reasons unknown.
Apple increased the limit by 50% in 10.8, where it was 64, to 96 in 10.9. This shows that the number is arbitrary. The hardware did not change but there was a 50% increase allowed in the software, that's a significant change. But why not 128? Why not 95, or 96? The units of power of two are likely also meaningless here.
Why 96 end points is a very low limit
Each one of my USB hubs has 3 USB controllers inside of it. Each one supports "Full/Low Speed" and "SuperSpeed." Each one of those has an endpoint for input, and one for output. 3 hubs * 3 controllers each * 2 protocols each controller * 2 for IO = 36 end points... just on hubs!
The bluetooth built into the laptop uses 8, the HD FaceTime Camera uses 6, a Nexus 4 uses 6.
96 is a very low amount of end points.
The typical process of charging a battery:
First the system detects the power plug.
Now the Battery status is evaluated and and the battery circuit determines the amount of current to draw.
It is not like a hose, it is a calculated current amount. In other words the battery is the boss and only takes what it needs without overheating or damage.
If you look at you battery Icon in the menu bar you will see it takes a moment or two to determine how long it will take to charge to 100%.
Once that process is completed and the charging is on the way, you are given a visual indication (LED) of activity.
Best Answer
I had this same thing happen to me around July 2018 on a MBP 2017 15", this happened when I connected an AmazonBasics AV adaptor, I only own a couple of dongles, that one and the usb c to ethernet one from Amazon too, it has never happened again.
After it happened, I noticed that when using the internal speakers as soon (could be a few seconds) the audio reached a certain level, high sounds would be lost and audio would sound muffled.
It's on service now, they are replacing the top cover which houses the keyboard, battery, speakers and other components.