View previous topic :: View next topic |
Author |
Message |
Edweirdo Guru


Joined: 28 Jan 2003 Posts: 353 Location: Boston, Mass, USA
|
Posted: Sat Nov 28, 2015 4:45 pm Post subject: Not enough host controller resources for new device state. |
|
|
I have a brand new MacMini that I built Gentoo on from scratch. It has a keyword accepted gentoo-sources-4.3.0 kernel (config.gz). When I plug in a bunch of external USB hard drives I get the error message:
Code: |
Not enough host controller resources for new device state.
can't set config #1, error -12
|
And any drive after that, making all the other drives not available. Most everything is USB 3.0, I have all the drives connected to powered USB hubs and then connected to the computer. 14 Seems to be the magic number, when I connect the 14th one (out of 21), I start getting the message.
Google searches suggested turning off xHCI, which turns of USB completely, essentially, so that doesn't help.
I didn't find a kernel bug related to this, so I'm hoping I'm just missing something simple. _________________ Life is too short and too important to { take seriously | use Windows }. |
|
Back to top |
|
 |
khayyam Watchman


Joined: 07 Jun 2012 Posts: 6228 Location: Room 101
|
Posted: Sat Nov 28, 2015 6:33 pm Post subject: Re: Not enough host controller resources for new device stat |
|
|
Edweirdo wrote: | Code: | Not enough host controller resources for new device state. can't set config #1, error -12 |
|
Edweirdo ... is that message from kmesg/usb or some other service, ie, udev? It might be worth posting the actual error from dmesg in full.
best ... khay |
|
Back to top |
|
 |
Edweirdo Guru


Joined: 28 Jan 2003 Posts: 353 Location: Boston, Mass, USA
|
Posted: Sat Nov 28, 2015 11:08 pm Post subject: |
|
|
It is from USB. Here is the full message:
Code: |
Nov 28 11:05:00 snusnu kernel: [ 358.590742] usb 1-2.4.1: New USB device found, idVendor=1058, idProduct=1110
Nov 28 11:05:00 snusnu kernel: [ 358.590745] usb 1-2.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Nov 28 11:05:00 snusnu kernel: [ 358.590747] usb 1-2.4.1: Product: My Book 1110
Nov 28 11:05:00 snusnu kernel: [ 358.590749] usb 1-2.4.1: Manufacturer: Western Digital
Nov 28 11:05:00 snusnu kernel: [ 358.590750] usb 1-2.4.1: SerialNumber: 574D415A4131303539373236
Nov 28 11:05:00 snusnu kernel: [ 358.591478] usb 1-2.4.1: Not enough host controller resources for new device state.
Nov 28 11:05:00 snusnu kernel: [ 358.591491] usb 1-2.4.1: can't set config #1, error -12
|
_________________ Life is too short and too important to { take seriously | use Windows }. |
|
Back to top |
|
 |
khayyam Watchman


Joined: 07 Jun 2012 Posts: 6228 Location: Room 101
|
Posted: Sun Nov 29, 2015 6:05 am Post subject: Re: Not enough host controller resources for new device stat |
|
|
Edweirdo wrote: | Google searches suggested turning off xHCI, which turns of USB completely, essentially, so that doesn't help. |
Edweirdo ... my search pretty much turned up the same (ie, this). Does your kernel also have EHCI enabled, as disabling XHCI in the bios should force its use ... or is that not the case in your experience?
The analysis in the above linked post does seem likely, and the FIXME (in the code) suggests that the programmer was aware that '#define COMP_ENOMEM 7' (xhci.h) may be too low. I'd suggest a proper bug report to lkml, or contacting the author.
best ... khay |
|
Back to top |
|
 |
krinn Watchman


Joined: 02 May 2003 Posts: 7200
|
Posted: Sun Nov 29, 2015 7:53 am Post subject: |
|
|
The lack of resource might not comes from the driver lack of resources but from the host resources that are exhaust.
Like any usb version, usb3 also have a limit to power, and if your host have too many devices attach to it, you may get the error it cannot power them all.
that's better handling than usb2 driver (last time i saw it, they might have update it for better handling) that allow you to plug any, and randomly enable this or that device as it don't have enough power to handle them all.
Are all your hubs self powered?
I won't be a surprise that you have some low/bad powered hubs. See https://en.wikipedia.org/wiki/USB_hub#Power that show a real example of such bad powered hub. |
|
Back to top |
|
 |
Edweirdo Guru


Joined: 28 Jan 2003 Posts: 353 Location: Boston, Mass, USA
|
Posted: Sun Nov 29, 2015 11:39 am Post subject: |
|
|
It is a MacMini, so there is no BIOS available to turn off anything. I do have ECHI on, I haven't tried turning that off.
I do have 2 powered USB hubs, but after some experimenting, it seems that one is a USB 2.0 hub. I'm going replace that with a powered USB 3.0 hub to see if it helps.
I did have all this connected to an old MacMini with an older kernel, but I believe I was probably mostly USB 2.0 at that point, and that is why it was working. _________________ Life is too short and too important to { take seriously | use Windows }. |
|
Back to top |
|
 |
khayyam Watchman


Joined: 07 Jun 2012 Posts: 6228 Location: Room 101
|
Posted: Sun Nov 29, 2015 12:27 pm Post subject: |
|
|
Edweirdo wrote: | It is a MacMini, so there is no BIOS available to turn off anything. I do have ECHI on, I haven't tried turning that off. |
Edweirdo ... my bad, wasn't paying attention ... every USB3 port consists of a XHCI and EHCI controller, so you should be able to disable XHCI in the kernel and have EHCI be used.
best ... khay |
|
Back to top |
|
 |
Edweirdo Guru


Joined: 28 Jan 2003 Posts: 353 Location: Boston, Mass, USA
|
Posted: Sun Nov 29, 2015 9:09 pm Post subject: |
|
|
When I exclude xHCI, I get no USB devices at all.
Code: |
# lsusb
unable to initialize libusb: -99
|
_________________ Life is too short and too important to { take seriously | use Windows }. |
|
Back to top |
|
 |
Edweirdo Guru


Joined: 28 Jan 2003 Posts: 353 Location: Boston, Mass, USA
|
Posted: Tue Dec 15, 2015 4:31 pm Post subject: |
|
|
So, just to add additional information to this for the next person searching for a solution to this:
I grep'ed the kernel source for the error message and found the following:
Code: |
static int xhci_configure_endpoint_result(struct xhci_hcd *xhci,
struct usb_device *udev, u32 *cmd_status)
{
...
case COMP_ENOMEM:
dev_warn(&udev->dev,
"Not enough host controller resources for new device state.\n");
ret = -ENOMEM;
/* FIXME: can we allocate more resources for the HC? */
break;
...
}
|
It is my guess from my 0 seconds of kernel development that UDEV has allocated a certain amount of memory/resource for the USB devices and I have reached that limit. Instead of allocating more memory/resources when needed, the programmer decided that would be better left for someone else to do. So, until someone else does, we're out of luck.
Ed _________________ Life is too short and too important to { take seriously | use Windows }. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|