Re: [RFT 2/2] USB: Free bandwidth when usb_disable_device is called.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 06, 2011 at 11:10:23AM -0400, Alan Stern wrote:
> How about just unconditionally calling usb_hcd_alloc_bandwidth() before 
> looping through the endpoint arrays?

I don't think that's a good idea, because there could be URBs pending
before the loop calling usb_disable_endpoint() completes.  The bandwidth
allocation functions assume that all URB have been canceled or completed
before an endpoint is dropped.  Otherwise the command to remove the
endpoint rings can race with transfer completion.

> Alternatively, how about making 
> xhci-hcd's endpoint_disable method responsible for releasing the 
> endpoint's bandwidth reservation?

The problem is that the USB core calls the endpoint_disable method too
often, for all endpoints, without checking whether the endpoints were
actually active.  The xHCI driver doesn't keep track of which endpoints
are added; it expects the USB core to do so.  If the USB core
unconditionally drops all endpoints, the command to drop them will be
rejected by the host controller.

Besides, I'm not too keen on re-writing the whole bandwidth checking
code just for this special case. :)  Any other thoughts?  Is there
anything technically wrong with the patch, or it just looks ugly?

Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux