On 09/23/2015 10:08 PM, Steinar H. Gunderson wrote:
Hi again,

I'm trying to figure out why my xHCI controller refuses me to run two very
similar video cards at the same time. I'm not sure if this is a bug or if I'm
just misunderstanding, so let me see if I understand this right:

The interface of each card has two relevant alternates, 2 and 4. Number 2 has
bInterval=1, bMaxBurst=11, Mult=2, which from what I can see should be
11*(2+1)*1024 byte / 125µs, or 2.16 Gbit/sec. Number 4 has bInterval=1,
bMaxBurst=8, Mult=1, which should be 8*(1+1)*1024 byte / 125 µs, or 1.04 
Gbit/sec.

I can run one card in alternates 2 or 4, no problem. But if I put another
card in the other USB port (my Lenovo X240 has one on each side) and try to
activate that too, I get

   [  287.919173] usb 2-2: Not enough bandwidth for altsetting 4

I've tried on another machine and it works fine there, so my code should,
at least on the surface of it, be fine. I've verified that the error is
COMP_BW_ERR (not COMP_2ND_BW_ERR).

My xHCI controller is 8086:9c31 (I believe this is Intel). lsusb -v with both
devices plugged in is attached. I'm running 4.3-rc2. There are no external
USB hubs in the mix.

So this is my question: Why can I run one card at 2.16 Gbit/sec but not two
at 1.04 Gbit/sec each? (Shouldn't the USB3 bus be 5 Gbit/sec?) Is there any
way to debug these issues, or is the controller just deciding and unwilling
to give out any information? Is the information of the bandwidth domains/
bus instances available anywhere? Am I misunderstanding something
fundamentally?

Well it's not so simple. I'm not sure if this is exactly your problem but it may help you.

Let's start from the beginning. Your device use ISO endpoints which means that host allocates specific amount of bandwidth on the bus. More over, interfaces in your devices has many alternate settings. Probably each of them reserves different amount of bandwidth. When you connect your first device, driver selects the highest possible quality and allocate maximum bandwidth. When you connect second device driver tries to select altsetting for which there is enough bandwidth left but as you see this fail. So we get:

1st card - 2.16 bandwidth
2nd card - not enough bandwidth left even for lowest quality

what you should try is to force driver of the first card to use lower quality and allocate less bandwidth (this means choose other altsetting of interface) then you will get:

1st card - x bandwidth (x < 2.16)
2nd card - y bandwidth (I think that USB 3.0 should provide enough bandwidth for those 2 devices at lowest quality)

That's just my guess, no guarantee bud it may be worth to try.

--
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to