Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1370382 > unrolled thread

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

Started byFelipe Balbi <felipe.balbi@linux.intel.com>
First post2016-04-04 08:40 +0200
Last post2016-04-05 07:30 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v3 2/2] usb:dwc3: pass arch data to xhci-hcd child Felipe Balbi <felipe.balbi@linux.intel.com> - 2016-04-04 08:40 +0200
    Re: [PATCH v3 2/2] usb:dwc3: pass arch data to xhci-hcd child santosh shilimkar <santosh.shilimkar@oracle.com> - 2016-04-04 18:20 +0200
      Re: [PATCH v3 2/2] usb:dwc3: pass arch data to xhci-hcd child Felipe Balbi <felipe.balbi@linux.intel.com> - 2016-04-05 07:30 +0200

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

FromFelipe Balbi <felipe.balbi@linux.intel.com>
Date2016-04-04 08:40 +0200
SubjectRe: [PATCH v3 2/2] usb:dwc3: pass arch data to xhci-hcd child
Message-ID<rk6l3-7xw-7@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

santosh shilimkar <santosh.shilimkar@oracle.com> writes:
> +Arnd, RMK,
>
> On 4/1/2016 4:57 AM, Felipe Balbi wrote:
>>
>> Hi,
>>
>> Grygorii Strashko <grygorii.strashko@ti.com> writes:
>>> On 04/01/2016 01:20 PM, Felipe Balbi wrote:
>
> [...]
>
>>> commit 7ace8fc8219e4cbbfd5b4790390d9a01a2541cdf
>>> Author: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
>>> 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@renesas.com>
>>>      Signed-off-by: Felipe Balbi <balbi@ti.com>
>>>
>>> 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.

okay, so how do you get proper DMA pointers with something like this:

	kdwc3_dma_mask = dma_get_mask(dev);
	dev->dma_mask = &kdwc3_dma_mask;

This doesn't anything.

-- 
balbi

[toc] | [next] | [standalone]


#1370731

Fromsantosh shilimkar <santosh.shilimkar@oracle.com>
Date2016-04-04 18:20 +0200
Message-ID<rkfol-5Jt-3@gated-at.bofh.it>
In reply to#1370382
On 4/3/2016 11:28 PM, Felipe Balbi wrote:
> santosh shilimkar <santosh.shilimkar@oracle.com> writes:
>> +Arnd, RMK,
>>
>> On 4/1/2016 4:57 AM, Felipe Balbi wrote:
>>>
>>> Hi,
>>>
>>> Grygorii Strashko <grygorii.strashko@ti.com> writes:
>>>> On 04/01/2016 01:20 PM, Felipe Balbi wrote:
>>
>> [...]
>>
>>>> commit 7ace8fc8219e4cbbfd5b4790390d9a01a2541cdf
>>>> Author: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
>>>> 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@renesas.com>
>>>>       Signed-off-by: Felipe Balbi <balbi@ti.com>
>>>>
>>>> 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.
>
> okay, so how do you get proper DMA pointers with something like this:
>
> 	kdwc3_dma_mask = dma_get_mask(dev);
> 	dev->dma_mask = &kdwc3_dma_mask;
>
> This doesn't anything.
>
Drivers actually needs to touch dma_mask(s) only if the core DMA
code hasn't populated it it. I see Grygorii pointed out couple
of things already.

Reagrds,
Santosh

[toc] | [prev] | [next] | [standalone]


#1371215

FromFelipe Balbi <felipe.balbi@linux.intel.com>
Date2016-04-05 07:30 +0200
Message-ID<rkrIR-6Ag-1@gated-at.bofh.it>
In reply to#1370731

[Multipart message — attachments visible in raw view] — view raw

santosh shilimkar <santosh.shilimkar@oracle.com> writes:
> On 4/3/2016 11:28 PM, Felipe Balbi wrote:
>> santosh shilimkar <santosh.shilimkar@oracle.com> writes:
>>> +Arnd, RMK,
>>>
>>> On 4/1/2016 4:57 AM, Felipe Balbi wrote:
>>>>
>>>> Hi,
>>>>
>>>> Grygorii Strashko <grygorii.strashko@ti.com> writes:
>>>>> On 04/01/2016 01:20 PM, Felipe Balbi wrote:
>>>
>>> [...]
>>>
>>>>> commit 7ace8fc8219e4cbbfd5b4790390d9a01a2541cdf
>>>>> Author: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
>>>>> 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@renesas.com>
>>>>>       Signed-off-by: Felipe Balbi <balbi@ti.com>
>>>>>
>>>>> 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.
>>
>> okay, so how do you get proper DMA pointers with something like this:
>>
>> 	kdwc3_dma_mask = dma_get_mask(dev);
>> 	dev->dma_mask = &kdwc3_dma_mask;
>>
>> This doesn't anything.
>>
> Drivers actually needs to touch dma_mask(s) only if the core DMA
> code hasn't populated it it.

that's fair, but when driver _do_ touch it, I'd rather it be useful ;-)

> I see Grygorii pointed out couple of things already.

yeah

-- 
balbi

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web