[U-Boot] [PATCH V2] usb: ci_udc: Allocate the qTD list directly

Stephen Warren swarren at wwwdotorg.org
Tue Jul 1 17:03:17 CEST 2014


On 06/30/2014 06:04 PM, Marek Vasut wrote:
> Instead of weird allocation of ci_drv->items_mem and then even weirder
> distribution of offsets in this memory area into ci_drv->items array,
> just allocate ci_drv->items as a big slab of aligned memory (replaces
> ci_drv->items_mem) and let ci_get_qtd() do the distribution of offsets
> in this memory area.

As I mentioned on IRC, this patch isn't correct.

The existing code ensures that each pair of QTDs are correctly aligned,
hence the slight complexity. The new code only actively ensures that the
first QTD is correctly aligned; the subsequent QTDs will only be
correctly aligned if the sizeof the QTD structure is an exact multiple
of the alignment requirements. In practice, it is on my system at least,
but that may not be generally true.


More information about the U-Boot mailing list