Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma

Pull slave-dmaengine fixes from Vinod Koul:
"The first one fixes issue in pl330 to check for DT compatible and
the second one fixes omap-dma to start without delay"

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
dmaengine: omap-dma: Start DMA without delay for cyclic channels
DMA: PL330: Add check if device tree compatible

+41 -17
+14 -6
drivers/dma/omap-dma.c
··· 276 277 spin_lock_irqsave(&c->vc.lock, flags); 278 if (vchan_issue_pending(&c->vc) && !c->desc) { 279 - struct omap_dmadev *d = to_omap_dma_dev(chan->device); 280 - spin_lock(&d->lock); 281 - if (list_empty(&c->node)) 282 - list_add_tail(&c->node, &d->pending); 283 - spin_unlock(&d->lock); 284 - tasklet_schedule(&d->task); 285 } 286 spin_unlock_irqrestore(&c->vc.lock, flags); 287 }
··· 276 277 spin_lock_irqsave(&c->vc.lock, flags); 278 if (vchan_issue_pending(&c->vc) && !c->desc) { 279 + /* 280 + * c->cyclic is used only by audio and in this case the DMA need 281 + * to be started without delay. 282 + */ 283 + if (!c->cyclic) { 284 + struct omap_dmadev *d = to_omap_dma_dev(chan->device); 285 + spin_lock(&d->lock); 286 + if (list_empty(&c->node)) 287 + list_add_tail(&c->node, &d->pending); 288 + spin_unlock(&d->lock); 289 + tasklet_schedule(&d->task); 290 + } else { 291 + omap_dma_start_desc(c); 292 + } 293 } 294 spin_unlock_irqrestore(&c->vc.lock, flags); 295 }
+27 -11
drivers/dma/pl330.c
··· 2882 { 2883 struct dma_pl330_platdata *pdat; 2884 struct dma_pl330_dmac *pdmac; 2885 - struct dma_pl330_chan *pch; 2886 struct pl330_info *pi; 2887 struct dma_device *pd; 2888 struct resource *res; ··· 2984 ret = dma_async_device_register(pd); 2985 if (ret) { 2986 dev_err(&adev->dev, "unable to register DMAC\n"); 2987 - goto probe_err2; 2988 } 2989 2990 dev_info(&adev->dev, ··· 3004 pi->pcfg.data_bus_width / 8, pi->pcfg.num_chan, 3005 pi->pcfg.num_peri, pi->pcfg.num_events); 3006 3007 - ret = of_dma_controller_register(adev->dev.of_node, 3008 - of_dma_pl330_xlate, pdmac); 3009 - if (ret) { 3010 - dev_err(&adev->dev, 3011 - "unable to register DMA to the generic DT DMA helpers\n"); 3012 - goto probe_err2; 3013 - } 3014 - 3015 return 0; 3016 3017 probe_err2: 3018 pl330_del(pi); 3019 probe_err1: ··· 3037 if (!pdmac) 3038 return 0; 3039 3040 - of_dma_controller_free(adev->dev.of_node); 3041 3042 amba_set_drvdata(adev, NULL); 3043 3044 /* Idle the DMAC */
··· 2882 { 2883 struct dma_pl330_platdata *pdat; 2884 struct dma_pl330_dmac *pdmac; 2885 + struct dma_pl330_chan *pch, *_p; 2886 struct pl330_info *pi; 2887 struct dma_device *pd; 2888 struct resource *res; ··· 2984 ret = dma_async_device_register(pd); 2985 if (ret) { 2986 dev_err(&adev->dev, "unable to register DMAC\n"); 2987 + goto probe_err3; 2988 + } 2989 + 2990 + if (adev->dev.of_node) { 2991 + ret = of_dma_controller_register(adev->dev.of_node, 2992 + of_dma_pl330_xlate, pdmac); 2993 + if (ret) { 2994 + dev_err(&adev->dev, 2995 + "unable to register DMA to the generic DT DMA helpers\n"); 2996 + } 2997 } 2998 2999 dev_info(&adev->dev, ··· 2995 pi->pcfg.data_bus_width / 8, pi->pcfg.num_chan, 2996 pi->pcfg.num_peri, pi->pcfg.num_events); 2997 2998 return 0; 2999 + probe_err3: 3000 + amba_set_drvdata(adev, NULL); 3001 3002 + /* Idle the DMAC */ 3003 + list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels, 3004 + chan.device_node) { 3005 + 3006 + /* Remove the channel */ 3007 + list_del(&pch->chan.device_node); 3008 + 3009 + /* Flush the channel */ 3010 + pl330_control(&pch->chan, DMA_TERMINATE_ALL, 0); 3011 + pl330_free_chan_resources(&pch->chan); 3012 + } 3013 probe_err2: 3014 pl330_del(pi); 3015 probe_err1: ··· 3023 if (!pdmac) 3024 return 0; 3025 3026 + if (adev->dev.of_node) 3027 + of_dma_controller_free(adev->dev.of_node); 3028 3029 + dma_async_device_unregister(&pdmac->ddma); 3030 amba_set_drvdata(adev, NULL); 3031 3032 /* Idle the DMAC */