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


Groups > linux.kernel > #1407179 > unrolled thread

Re: [PATCH] drivers: usb: dwc3 : Configure DMA properties and ops from DT

Started byLeo Li <pku.leo@gmail.com>
First post2016-05-25 21:40 +0200
Last post2016-05-27 15:40 +0200
Articles 4 — 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] drivers: usb: dwc3 : Configure DMA properties and ops  from DT Leo Li <pku.leo@gmail.com> - 2016-05-25 21:40 +0200
    Re: [PATCH] drivers: usb: dwc3 : Configure DMA properties and ops from DT Felipe Balbi <felipe.balbi@linux.intel.com> - 2016-05-26 10:40 +0200
      Re: [PATCH] drivers: usb: dwc3 : Configure DMA properties and ops  from DT Leo Li <pku.leo@gmail.com> - 2016-05-26 23:00 +0200
        Re: [PATCH] drivers: usb: dwc3 : Configure DMA properties and ops from DT Felipe Balbi <felipe.balbi@linux.intel.com> - 2016-05-27 15:40 +0200

#1407179 — Re: [PATCH] drivers: usb: dwc3 : Configure DMA properties and ops from DT

FromLeo Li <pku.leo@gmail.com>
Date2016-05-25 21:40 +0200
SubjectRe: [PATCH] drivers: usb: dwc3 : Configure DMA properties and ops from DT
Message-ID<rCMOS-4RW-13@gated-at.bofh.it>
On Wed, May 4, 2016 at 2:57 AM, Felipe Balbi
<felipe.balbi@linux.intel.com> wrote:
>
> Hi,
>
> Rajesh Bhagat <rajesh.bhagat@nxp.com> writes:
>> On certain platforms (e.g. ARM64) the dma_ops needs to be explicitly set
>> to be able to do DMA allocations, so use the of_dma_configure() helper
>> to populate the dma properties and assign an appropriate dma_ops.
>>
>> Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
>> Reviewed-by: Yang-Leo Li <leoyang.li@nxp.com>
>
> Cool, nxp is also using dwc3 :-) C'mon Rajesh, send us a glue layer :)
>
>> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
>> index c679f63..4d5b783 100644
>> --- a/drivers/usb/dwc3/host.c
>> +++ b/drivers/usb/dwc3/host.c
>> @@ -17,6 +17,7 @@
>>
>>  #include <linux/platform_device.h>
>>  #include <linux/usb/xhci_pdriver.h>
>> +#include <linux/of_device.h>
>>
>>  #include "core.h"
>>
>> @@ -32,6 +33,9 @@ int dwc3_host_init(struct dwc3 *dwc)
>>               return -ENOMEM;
>>       }
>>
>> +     if (IS_ENABLED(CONFIG_OF) && dwc->dev->of_node)
>> +             of_dma_configure(&xhci->dev, dwc->dev->of_node);
>
> okay, so we have a long discussion about this going on. You can catch up
> with it starting here:
>
> http://marc.info/?i=1461612094-30939-1-git-send-email-grygorii.strashko@ti.com
>
> At least for now, this patch will be applied. We need to have a better
> solution for this, one that helps not only DT platforms.

Balbi,

Has the patch from Grygorii been applied?  I don't see it in the
mainline tree yet.  Without fix, the dwc3 driver will fail for all
ARM64 SoCs.

Regards,
Leo

[toc] | [next] | [standalone]


#1407456 — Re: [PATCH] drivers: usb: dwc3 : Configure DMA properties and ops from DT

FromFelipe Balbi <felipe.balbi@linux.intel.com>
Date2016-05-26 10:40 +0200
SubjectRe: [PATCH] drivers: usb: dwc3 : Configure DMA properties and ops from DT
Message-ID<rCYZI-45r-27@gated-at.bofh.it>
In reply to#1407179

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

Hi,

Leo Li <pku.leo@gmail.com> writes:
>>> On certain platforms (e.g. ARM64) the dma_ops needs to be explicitly set
>>> to be able to do DMA allocations, so use the of_dma_configure() helper
>>> to populate the dma properties and assign an appropriate dma_ops.
>>>
>>> Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
>>> Reviewed-by: Yang-Leo Li <leoyang.li@nxp.com>
>>
>> Cool, nxp is also using dwc3 :-) C'mon Rajesh, send us a glue layer :)
>>
>>> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
>>> index c679f63..4d5b783 100644
>>> --- a/drivers/usb/dwc3/host.c
>>> +++ b/drivers/usb/dwc3/host.c
>>> @@ -17,6 +17,7 @@
>>>
>>>  #include <linux/platform_device.h>
>>>  #include <linux/usb/xhci_pdriver.h>
>>> +#include <linux/of_device.h>
>>>
>>>  #include "core.h"
>>>
>>> @@ -32,6 +33,9 @@ int dwc3_host_init(struct dwc3 *dwc)
>>>               return -ENOMEM;
>>>       }
>>>
>>> +     if (IS_ENABLED(CONFIG_OF) && dwc->dev->of_node)
>>> +             of_dma_configure(&xhci->dev, dwc->dev->of_node);
>>
>> okay, so we have a long discussion about this going on. You can catch up
>> with it starting here:
>>
>> http://marc.info/?i=1461612094-30939-1-git-send-email-grygorii.strashko@ti.com
>>
>> At least for now, this patch will be applied. We need to have a better
>> solution for this, one that helps not only DT platforms.
>
> Balbi,
>
> Has the patch from Grygorii been applied?  I don't see it in the
> mainline tree yet.  Without fix, the dwc3 driver will fail for all
> ARM64 SoCs.

right, it's still broken. But we don't want something that fixes only
OF, right? dwc3 is also broken for PCI when IOMMU is enabled. It breaks
for the same reasons.

We really need a way to inherit DMA bits from parent device here.

-- 
balbi

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


#1407712

FromLeo Li <pku.leo@gmail.com>
Date2016-05-26 23:00 +0200
Message-ID<rDaxP-2F5-9@gated-at.bofh.it>
In reply to#1407456
On Thu, May 26, 2016 at 3:30 AM, Felipe Balbi
<felipe.balbi@linux.intel.com> wrote:
>
> Hi,
>
> Leo Li <pku.leo@gmail.com> writes:
>>>> On certain platforms (e.g. ARM64) the dma_ops needs to be explicitly set
>>>> to be able to do DMA allocations, so use the of_dma_configure() helper
>>>> to populate the dma properties and assign an appropriate dma_ops.
>>>>
>>>> Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
>>>> Reviewed-by: Yang-Leo Li <leoyang.li@nxp.com>
>>>
>>> Cool, nxp is also using dwc3 :-) C'mon Rajesh, send us a glue layer :)
>>>
>>>> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
>>>> index c679f63..4d5b783 100644
>>>> --- a/drivers/usb/dwc3/host.c
>>>> +++ b/drivers/usb/dwc3/host.c
>>>> @@ -17,6 +17,7 @@
>>>>
>>>>  #include <linux/platform_device.h>
>>>>  #include <linux/usb/xhci_pdriver.h>
>>>> +#include <linux/of_device.h>
>>>>
>>>>  #include "core.h"
>>>>
>>>> @@ -32,6 +33,9 @@ int dwc3_host_init(struct dwc3 *dwc)
>>>>               return -ENOMEM;
>>>>       }
>>>>
>>>> +     if (IS_ENABLED(CONFIG_OF) && dwc->dev->of_node)
>>>> +             of_dma_configure(&xhci->dev, dwc->dev->of_node);
>>>
>>> okay, so we have a long discussion about this going on. You can catch up
>>> with it starting here:
>>>
>>> http://marc.info/?i=1461612094-30939-1-git-send-email-grygorii.strashko@ti.com
>>>
>>> At least for now, this patch will be applied. We need to have a better
>>> solution for this, one that helps not only DT platforms.
>>
>> Balbi,
>>
>> Has the patch from Grygorii been applied?  I don't see it in the
>> mainline tree yet.  Without fix, the dwc3 driver will fail for all
>> ARM64 SoCs.
>
> right, it's still broken. But we don't want something that fixes only
> OF, right? dwc3 is also broken for PCI when IOMMU is enabled. It breaks
> for the same reasons.
>
> We really need a way to inherit DMA bits from parent device here.

I agree with your proposal, but the original discussion seems to be on
halt right now.  If it need more time to get to an agreement on proper
fix, probably it's better to have a temporary fix right now to make
the driver working again.

Regards,
Leo

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


#1408082 — Re: [PATCH] drivers: usb: dwc3 : Configure DMA properties and ops from DT

FromFelipe Balbi <felipe.balbi@linux.intel.com>
Date2016-05-27 15:40 +0200
SubjectRe: [PATCH] drivers: usb: dwc3 : Configure DMA properties and ops from DT
Message-ID<rDq9C-41V-79@gated-at.bofh.it>
In reply to#1407712

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

Hi,

Leo Li <pku.leo@gmail.com> writes:
>> Leo Li <pku.leo@gmail.com> writes:
>>>>> On certain platforms (e.g. ARM64) the dma_ops needs to be explicitly set
>>>>> to be able to do DMA allocations, so use the of_dma_configure() helper
>>>>> to populate the dma properties and assign an appropriate dma_ops.
>>>>>
>>>>> Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
>>>>> Reviewed-by: Yang-Leo Li <leoyang.li@nxp.com>
>>>>
>>>> Cool, nxp is also using dwc3 :-) C'mon Rajesh, send us a glue layer :)
>>>>
>>>>> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
>>>>> index c679f63..4d5b783 100644
>>>>> --- a/drivers/usb/dwc3/host.c
>>>>> +++ b/drivers/usb/dwc3/host.c
>>>>> @@ -17,6 +17,7 @@
>>>>>
>>>>>  #include <linux/platform_device.h>
>>>>>  #include <linux/usb/xhci_pdriver.h>
>>>>> +#include <linux/of_device.h>
>>>>>
>>>>>  #include "core.h"
>>>>>
>>>>> @@ -32,6 +33,9 @@ int dwc3_host_init(struct dwc3 *dwc)
>>>>>               return -ENOMEM;
>>>>>       }
>>>>>
>>>>> +     if (IS_ENABLED(CONFIG_OF) && dwc->dev->of_node)
>>>>> +             of_dma_configure(&xhci->dev, dwc->dev->of_node);
>>>>
>>>> okay, so we have a long discussion about this going on. You can catch up
>>>> with it starting here:
>>>>
>>>> http://marc.info/?i=1461612094-30939-1-git-send-email-grygorii.strashko@ti.com
>>>>
>>>> At least for now, this patch will be applied. We need to have a better
>>>> solution for this, one that helps not only DT platforms.
>>>
>>> Balbi,
>>>
>>> Has the patch from Grygorii been applied?  I don't see it in the
>>> mainline tree yet.  Without fix, the dwc3 driver will fail for all
>>> ARM64 SoCs.
>>
>> right, it's still broken. But we don't want something that fixes only
>> OF, right? dwc3 is also broken for PCI when IOMMU is enabled. It breaks
>> for the same reasons.
>>
>> We really need a way to inherit DMA bits from parent device here.
>
> I agree with your proposal, but the original discussion seems to be on
> halt right now.  If it need more time to get to an agreement on proper
> fix, probably it's better to have a temporary fix right now to make
> the driver working again.

if it temporarily solves all users, sure. But if temporarily solves the
problem for just a subset of the users, then that subset will stop
thinking about the solution while the other subset is left alone
thinking about it.

Sorry, but I prefer to get this sorted out for everybody, rather than
for one subset of users.

-- 
balbi

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web