History

Merge tag 'dmaengine-fix-4.5-rc7' of git://git.infradead.org/users/vkoul/slave-dma

Pull dmaengine fix from Vinod Koul: "One minor fix on pxa driver to fix the cyclic dma tranfers" * tag 'dmaengine-fix-4.5-rc7' of git://git.infradead.org/users/vkoul/slave-dma: dmaengine: pxa_dma: fix cyclic transfers

Linus Torvalds committed 10 years ago

Commit 40fea2e2 parents ee8f395 f1692121 file · +7 −1Browse files

Unified · Split

drivers/dma/pxa_dma.c+7−1
@@ -583,6 +583,8 @@ static void set_updater_desc(struct pxad_desc_sw *sw_desc, · 582 unmodified lines
583583 (PXA_DCMD_LENGTH & sizeof(u32));
584584 if (flags & DMA_PREP_INTERRUPT)
585585 updater->dcmd |= PXA_DCMD_ENDIRQEN;
586+ if (sw_desc->cyclic)
587+ sw_desc->hw_desc[sw_desc->nb_desc - 2]->ddadr = sw_desc->first;
586588 }
587589
588590 static bool is_desc_completed(struct virt_dma_desc *vd)
@@ -673,6 +675,10 @@ static irqreturn_t pxad_chan_handler(int irq, void *dev_id) · 84 unmodified lines
673675 dev_dbg(&chan->vc.chan.dev->device,
674676 "%s(): checking txd %p[%x]: completed=%d\n",
675677 __func__, vd, vd->tx.cookie, is_desc_completed(vd));
678+ if (to_pxad_sw_desc(vd)->cyclic) {
679+ vchan_cyclic_callback(vd);
680+ break;
681+ }
676682 if (is_desc_completed(vd)) {
677683 list_del(&vd->node);
678684 vchan_cookie_complete(vd);
@@ -1080,7 +1086,7 @@ pxad_prep_dma_cyclic(struct dma_chan *dchan, · 401 unmodified lines
10801086 return NULL;
10811087
10821088 pxad_get_config(chan, dir, &dcmd, &dsadr, &dtadr);
1083− dcmd |= PXA_DCMD_ENDIRQEN | (PXA_DCMD_LENGTH | period_len);
1089+ dcmd |= PXA_DCMD_ENDIRQEN | (PXA_DCMD_LENGTH & period_len);
10841090 dev_dbg(&chan->vc.chan.dev->device,
10851091 "%s(): buf_addr=0x%lx len=%zu period=%zu dir=%d flags=%lx\n",
10861092 __func__, (unsigned long)buf_addr, len, period_len, dir, flags);