Re: [PATCH 2/6] usb: dwc3: omap: don't access DMA bits directly

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

 



On 04/05/2016 01:29 PM, Felipe Balbi wrote:
> Grygorii Strashko <grygorii.strashko@xxxxxx> writes:
>> On 04/05/2016 08:51 AM, Felipe Balbi wrote:
>>> Grygorii Strashko <grygorii.strashko@xxxxxx> writes:
>>>> On 04/02/2016 11:28 AM, Felipe Balbi wrote:
>>>>> Instead of having a static global just for
>>>>> initializing dma_mask directly, let's use
>>>>> dma_coerce_mask_and_coherent() for that.
>>>>>
>>>>> Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx>
>>>>> ---
>>>>>     drivers/usb/dwc3/dwc3-omap.c | 4 +---
>>>>>     1 file changed, 1 insertion(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
>>>>> index 22e9606d8e08..c219118bfda0 100644
>>>>> --- a/drivers/usb/dwc3/dwc3-omap.c
>>>>> +++ b/drivers/usb/dwc3/dwc3-omap.c
>>>>> @@ -331,8 +331,6 @@ static void dwc3_omap_disable_irqs(struct dwc3_omap *omap)
>>>>>     	dwc3_omap_write_irqmisc_clr(omap, reg);
>>>>>     }
>>>>>     
>>>>> -static u64 dwc3_omap_dma_mask = DMA_BIT_MASK(32);
>>>>> -
>>>>>     static int dwc3_omap_id_notifier(struct notifier_block *nb,
>>>>>     	unsigned long event, void *ptr)
>>>>>     {
>>>>> @@ -490,7 +488,7 @@ static int dwc3_omap_probe(struct platform_device *pdev)
>>>>>     	omap->irq	= irq;
>>>>>     	omap->base	= base;
>>>>>     	omap->vbus_reg	= vbus_reg;
>>>>> -	dev->dma_mask	= &dwc3_omap_dma_mask;
>>>>> +	dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
>>>>
>>>> I think, It'll be better to just remove DMA configuration code
>>>> from this driver and other drivers which support DT-boot mode only.
>>>
>>> I don't have HW, can you test that on AM57x and/or AM437x ?
>>>
>>
>> Yes. I can. With below change I see no issues with USB in Host mode
>> on my AM57x board:
> 
> what about peripheral side ? Host mode worked fine on K2 devices, only
> peripheral suffered from the bad DMA API usage.
> 

As I've mentioned before (and we verified that) on newer kernels 
peripheral mode has been fixed by commit:

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

Also, on OMAP devices dwc3 core device is created from DT now  (dwc3-omap calls 
of_platform_populate()), so it's safe to drop manual DMA configuration code
from this driver (and if statement should be kept unchanged in dwc3/core.c
- as per my comment on your patch 5).

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



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux