Re: [PATCH v3 2/2] usb:dwc3: pass arch data to xhci-hcd child

From: santosh shilimkar
Date: Fri Apr 01 2016 - 14:16:37 EST


+Arnd, RMK,

On 4/1/2016 4:57 AM, Felipe Balbi wrote:

Hi,

Grygorii Strashko <grygorii.strashko@xxxxxx> writes:
On 04/01/2016 01:20 PM, Felipe Balbi wrote:

[...]

commit 7ace8fc8219e4cbbfd5b4790390d9a01a2541cdf
Author: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>
Date: Mon Jul 13 18:10:05 2015 +0900

usb: gadget: udc: core: Fix argument of dma_map_single for IOMMU

The dma_map_single and dma_unmap_single should set "gadget->dev.parent"
instead of "&gadget->dev" in the first argument because the parent has
a udc controller's device pointer.
Otherwise, iommu functions are not called in ARM environment.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>
Signed-off-by: Felipe Balbi <balbi@xxxxxx>

Above actually means that DMA configuration code can be dropped from
usb_add_gadget_udc_release() completely. Right?:

true, but now I'm not sure what's better: copy all necessary bits from
parent or just pass the parent device to all DMA API.

Anybody to shed a light here ?

The expectation is drivers should pass the proper dev pointers and let core DMA code deal with it since it knows the per device dma properties.
RMK did massive series of patches to fix many drivers which were not
adhering to dma APIs.

Regrds,
Santosh