Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull slave-dmaengine fixes from Vinod Koul:
"We have two small fixes. First one from Daniel to handle 0-length
packets for usb cppi dma. Second by Russell for imx-sdam cyclic
residue reporting"

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
Update imx-sdma cyclic handling to report residue
dma: cppi41: handle 0-length packets

+28 -8
+10 -3
drivers/dma/cppi41.c
··· 86 86 87 87 #define USBSS_IRQ_PD_COMP (1 << 2) 88 88 89 + /* Packet Descriptor */ 90 + #define PD2_ZERO_LENGTH (1 << 19) 91 + 89 92 struct cppi41_channel { 90 93 struct dma_chan chan; 91 94 struct dma_async_tx_descriptor txd; ··· 310 307 __iormb(); 311 308 312 309 while (val) { 313 - u32 desc; 310 + u32 desc, len; 314 311 315 312 q_num = __fls(val); 316 313 val &= ~(1 << q_num); ··· 322 319 q_num, desc); 323 320 continue; 324 321 } 325 - c->residue = pd_trans_len(c->desc->pd6) - 326 - pd_trans_len(c->desc->pd0); 327 322 323 + if (c->desc->pd2 & PD2_ZERO_LENGTH) 324 + len = 0; 325 + else 326 + len = pd_trans_len(c->desc->pd0); 327 + 328 + c->residue = pd_trans_len(c->desc->pd6) - len; 328 329 dma_cookie_complete(&c->txd); 329 330 c->txd.callback(c->txd.callback_param); 330 331 }
+18 -4
drivers/dma/imx-sdma.c
··· 255 255 enum dma_slave_buswidth word_size; 256 256 unsigned int buf_tail; 257 257 unsigned int num_bd; 258 + unsigned int period_len; 258 259 struct sdma_buffer_descriptor *bd; 259 260 dma_addr_t bd_phys; 260 261 unsigned int pc_from_device, pc_to_device; ··· 594 593 595 594 static void sdma_handle_channel_loop(struct sdma_channel *sdmac) 596 595 { 596 + if (sdmac->desc.callback) 597 + sdmac->desc.callback(sdmac->desc.callback_param); 598 + } 599 + 600 + static void sdma_update_channel_loop(struct sdma_channel *sdmac) 601 + { 597 602 struct sdma_buffer_descriptor *bd; 598 603 599 604 /* ··· 618 611 bd->mode.status |= BD_DONE; 619 612 sdmac->buf_tail++; 620 613 sdmac->buf_tail %= sdmac->num_bd; 621 - 622 - if (sdmac->desc.callback) 623 - sdmac->desc.callback(sdmac->desc.callback_param); 624 614 } 625 615 } 626 616 ··· 672 668 while (stat) { 673 669 int channel = fls(stat) - 1; 674 670 struct sdma_channel *sdmac = &sdma->channel[channel]; 671 + 672 + if (sdmac->flags & IMX_DMA_SG_LOOP) 673 + sdma_update_channel_loop(sdmac); 675 674 676 675 tasklet_schedule(&sdmac->tasklet); 677 676 ··· 1136 1129 sdmac->status = DMA_IN_PROGRESS; 1137 1130 1138 1131 sdmac->buf_tail = 0; 1132 + sdmac->period_len = period_len; 1139 1133 1140 1134 sdmac->flags |= IMX_DMA_SG_LOOP; 1141 1135 sdmac->direction = direction; ··· 1233 1225 struct dma_tx_state *txstate) 1234 1226 { 1235 1227 struct sdma_channel *sdmac = to_sdma_chan(chan); 1228 + u32 residue; 1229 + 1230 + if (sdmac->flags & IMX_DMA_SG_LOOP) 1231 + residue = (sdmac->num_bd - sdmac->buf_tail) * sdmac->period_len; 1232 + else 1233 + residue = sdmac->chn_count - sdmac->chn_real_count; 1236 1234 1237 1235 dma_set_tx_state(txstate, chan->completed_cookie, chan->cookie, 1238 - sdmac->chn_count - sdmac->chn_real_count); 1236 + residue); 1239 1237 1240 1238 return sdmac->status; 1241 1239 }
-1
sound/soc/fsl/imx-pcm-dma.c
··· 59 59 { 60 60 return devm_snd_dmaengine_pcm_register(&pdev->dev, 61 61 &imx_dmaengine_pcm_config, 62 - SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | 63 62 SND_DMAENGINE_PCM_FLAG_COMPAT); 64 63 } 65 64 EXPORT_SYMBOL_GPL(imx_pcm_dma_init);