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 tag 'dmaengine-fix-5.5-rc5' of git://git.infradead.org/users/vkoul/slave-dma

Pull dmaengine fixes from Vinod Koul:
"A bunch of fixes for:

- uninitialized dma_slave_caps access

- virt-dma use after free in vchan_complete()

- driver fixes for ioat, k3dma and jz4780"

* tag 'dmaengine-fix-5.5-rc5' of git://git.infradead.org/users/vkoul/slave-dma:
ioat: ioat_alloc_ring() failure handling.
dmaengine: virt-dma: Fix access after free in vchan_complete()
dmaengine: k3dma: Avoid null pointer traversal
dmaengine: dma-jz4780: Also break descriptor chains on JZ4725B
dmaengine: Fix access to uninitialized dma_slave_caps

+18 -8
+2 -1
drivers/dma/dma-jz4780.c
··· 999 999 static const struct jz4780_dma_soc_data jz4725b_dma_soc_data = { 1000 1000 .nb_channels = 6, 1001 1001 .transfer_ord_max = 5, 1002 - .flags = JZ_SOC_DATA_PER_CHAN_PM | JZ_SOC_DATA_NO_DCKES_DCKEC, 1002 + .flags = JZ_SOC_DATA_PER_CHAN_PM | JZ_SOC_DATA_NO_DCKES_DCKEC | 1003 + JZ_SOC_DATA_BREAK_LINKS, 1003 1004 }; 1004 1005 1005 1006 static const struct jz4780_dma_soc_data jz4770_dma_soc_data = {
+2 -1
drivers/dma/ioat/dma.c
··· 377 377 378 378 descs->virt = dma_alloc_coherent(to_dev(ioat_chan), 379 379 SZ_2M, &descs->hw, flags); 380 - if (!descs->virt && (i > 0)) { 380 + if (!descs->virt) { 381 381 int idx; 382 382 383 383 for (idx = 0; idx < i; idx++) { 384 + descs = &ioat_chan->descs[idx]; 384 385 dma_free_coherent(to_dev(ioat_chan), SZ_2M, 385 386 descs->virt, descs->hw); 386 387 descs->virt = NULL;
+9 -3
drivers/dma/k3dma.c
··· 229 229 c = p->vchan; 230 230 if (c && (tc1 & BIT(i))) { 231 231 spin_lock_irqsave(&c->vc.lock, flags); 232 - vchan_cookie_complete(&p->ds_run->vd); 233 - p->ds_done = p->ds_run; 234 - p->ds_run = NULL; 232 + if (p->ds_run != NULL) { 233 + vchan_cookie_complete(&p->ds_run->vd); 234 + p->ds_done = p->ds_run; 235 + p->ds_run = NULL; 236 + } 235 237 spin_unlock_irqrestore(&c->vc.lock, flags); 236 238 } 237 239 if (c && (tc2 & BIT(i))) { ··· 271 269 return -EAGAIN; 272 270 273 271 if (BIT(c->phy->idx) & k3_dma_get_chan_stat(d)) 272 + return -EAGAIN; 273 + 274 + /* Avoid losing track of ds_run if a transaction is in flight */ 275 + if (c->phy->ds_run) 274 276 return -EAGAIN; 275 277 276 278 if (vd) {
+1 -2
drivers/dma/virt-dma.c
··· 104 104 dmaengine_desc_get_callback(&vd->tx, &cb); 105 105 106 106 list_del(&vd->node); 107 - vchan_vdesc_fini(vd); 108 - 109 107 dmaengine_desc_callback_invoke(&cb, &vd->tx_result); 108 + vchan_vdesc_fini(vd); 110 109 } 111 110 } 112 111
+4 -1
include/linux/dmaengine.h
··· 1364 1364 static inline int dmaengine_desc_set_reuse(struct dma_async_tx_descriptor *tx) 1365 1365 { 1366 1366 struct dma_slave_caps caps; 1367 + int ret; 1367 1368 1368 - dma_get_slave_caps(tx->chan, &caps); 1369 + ret = dma_get_slave_caps(tx->chan, &caps); 1370 + if (ret) 1371 + return ret; 1369 1372 1370 1373 if (caps.descriptor_reuse) { 1371 1374 tx->flags |= DMA_CTRL_REUSE;