Skip to content

Commit f408126

Browse files
committed
Merge tag 'dmaengine-fix-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine
Pull dmaengine fixes from Vinod Koul: "A bunch of dmaengine driver fixes for: - coverity discovered issues for xilinx driver - qcom, gpi driver fix for undefined bhaviour and one off cleanup - update Peter's email for TI DMA drivers - one-off for idxd driver - resource leak fix for mediatek and milbeaut drivers" * tag 'dmaengine-fix-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: dmaengine: stm32-mdma: fix STM32_MDMA_VERY_HIGH_PRIORITY value dmaengine: xilinx_dma: fix mixed_enum_type coverity warning dmaengine: xilinx_dma: fix incompatible param warning in _child_probe() dmaengine: xilinx_dma: check dma_async_device_register return value dmaengine: qcom: fix gpi undefined behavior dt-bindings: dma: ti: Update maintainer and author information MAINTAINERS: Add entry for Texas Instruments DMA drivers qcom: bam_dma: Delete useless kfree code dmaengine: dw-edma: Fix use after free in dw_edma_alloc_chunk() dmaengine: milbeaut-xdmac: Fix a resource leak in the error handling path of the probe function dmaengine: mediatek: mtk-hsdma: Fix a resource leak in the error handling path of the probe function dmaengine: qcom: gpi: Fixes a format mismatch dmaengine: idxd: off by one in cleanup code dmaengine: ti: k3-udma: Fix pktdma rchan TPL level setup
2 parents caab314 + e1263f9 commit f408126

File tree

13 files changed

+48
-25
lines changed

13 files changed

+48
-25
lines changed

Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright (C) 2020 Texas Instruments Incorporated
3+
# Author: Peter Ujfalusi <[email protected]>
24
%YAML 1.2
35
---
46
$id: http://devicetree.org/schemas/dma/ti/k3-bcdma.yaml#
@@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
79
title: Texas Instruments K3 DMSS BCDMA Device Tree Bindings
810

911
maintainers:
10-
- Peter Ujfalusi <peter.ujfalusi@ti.com>
12+
- Peter Ujfalusi <peter.ujfalusi@gmail.com>
1113

1214
description: |
1315
The Block Copy DMA (BCDMA) is intended to perform similar functions as the TR

Documentation/devicetree/bindings/dma/ti/k3-pktdma.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright (C) 2020 Texas Instruments Incorporated
3+
# Author: Peter Ujfalusi <[email protected]>
24
%YAML 1.2
35
---
46
$id: http://devicetree.org/schemas/dma/ti/k3-pktdma.yaml#
@@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
79
title: Texas Instruments K3 DMSS PKTDMA Device Tree Bindings
810

911
maintainers:
10-
- Peter Ujfalusi <peter.ujfalusi@ti.com>
12+
- Peter Ujfalusi <peter.ujfalusi@gmail.com>
1113

1214
description: |
1315
The Packet DMA (PKTDMA) is intended to perform similar functions as the packet

Documentation/devicetree/bindings/dma/ti/k3-udma.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright (C) 2019 Texas Instruments Incorporated
3+
# Author: Peter Ujfalusi <[email protected]>
24
%YAML 1.2
35
---
46
$id: http://devicetree.org/schemas/dma/ti/k3-udma.yaml#
@@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
79
title: Texas Instruments K3 NAVSS Unified DMA Device Tree Bindings
810

911
maintainers:
10-
- Peter Ujfalusi <peter.ujfalusi@ti.com>
12+
- Peter Ujfalusi <peter.ujfalusi@gmail.com>
1113

1214
description: |
1315
The UDMA-P is intended to perform similar (but significantly upgraded)

MAINTAINERS

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17552,6 +17552,19 @@ S: Supported
1755217552
F: Documentation/devicetree/bindings/iio/dac/ti,dac7612.txt
1755317553
F: drivers/iio/dac/ti-dac7612.c
1755417554

17555+
TEXAS INSTRUMENTS DMA DRIVERS
17556+
M: Peter Ujfalusi <[email protected]>
17557+
17558+
S: Maintained
17559+
F: Documentation/devicetree/bindings/dma/ti-dma-crossbar.txt
17560+
F: Documentation/devicetree/bindings/dma/ti-edma.txt
17561+
F: Documentation/devicetree/bindings/dma/ti/
17562+
F: drivers/dma/ti/
17563+
X: drivers/dma/ti/cppi41.c
17564+
F: include/linux/dma/k3-udma-glue.h
17565+
F: include/linux/dma/ti-cppi5.h
17566+
F: include/linux/dma/k3-psil.h
17567+
1755517568
TEXAS INSTRUMENTS' SYSTEM CONTROL INTERFACE (TISCI) PROTOCOL DRIVER
1755617569
M: Nishanth Menon <[email protected]>
1755717570
M: Tero Kristo <[email protected]>

drivers/dma/dw-edma/dw-edma-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ static struct dw_edma_chunk *dw_edma_alloc_chunk(struct dw_edma_desc *desc)
8686

8787
if (desc->chunk) {
8888
/* Create and add new element into the linked list */
89-
desc->chunks_alloc++;
90-
list_add_tail(&chunk->list, &desc->chunk->list);
9189
if (!dw_edma_alloc_burst(chunk)) {
9290
kfree(chunk);
9391
return NULL;
9492
}
93+
desc->chunks_alloc++;
94+
list_add_tail(&chunk->list, &desc->chunk->list);
9595
} else {
9696
/* List head */
9797
chunk->burst = NULL;

drivers/dma/idxd/sysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ int idxd_register_driver(void)
434434
return 0;
435435

436436
drv_fail:
437-
for (; i > 0; i--)
437+
while (--i >= 0)
438438
driver_unregister(&idxd_drvs[i]->drv);
439439
return rc;
440440
}
@@ -1840,7 +1840,7 @@ int idxd_register_bus_type(void)
18401840
return 0;
18411841

18421842
bus_err:
1843-
for (; i > 0; i--)
1843+
while (--i >= 0)
18441844
bus_unregister(idxd_bus_types[i]);
18451845
return rc;
18461846
}

drivers/dma/mediatek/mtk-hsdma.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
10071007
return 0;
10081008

10091009
err_free:
1010+
mtk_hsdma_hw_deinit(hsdma);
10101011
of_dma_controller_free(pdev->dev.of_node);
10111012
err_unregister:
10121013
dma_async_device_unregister(dd);

drivers/dma/milbeaut-xdmac.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ static int milbeaut_xdmac_probe(struct platform_device *pdev)
350350

351351
ret = dma_async_device_register(ddev);
352352
if (ret)
353-
return ret;
353+
goto disable_xdmac;
354354

355355
ret = of_dma_controller_register(dev->of_node,
356356
of_dma_simple_xlate, mdev);
@@ -363,6 +363,8 @@ static int milbeaut_xdmac_probe(struct platform_device *pdev)
363363

364364
unregister_dmac:
365365
dma_async_device_unregister(ddev);
366+
disable_xdmac:
367+
disable_xdmac(mdev);
366368
return ret;
367369
}
368370

drivers/dma/qcom/bam_dma.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan,
630630
GFP_NOWAIT);
631631

632632
if (!async_desc)
633-
goto err_out;
633+
return NULL;
634634

635635
if (flags & DMA_PREP_FENCE)
636636
async_desc->flags |= DESC_FLAG_NWD;
@@ -670,10 +670,6 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan,
670670
}
671671

672672
return vchan_tx_prep(&bchan->vc, &async_desc->vd, flags);
673-
674-
err_out:
675-
kfree(async_desc);
676-
return NULL;
677673
}
678674

679675
/**

drivers/dma/qcom/gpi.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,15 +1416,15 @@ static int gpi_alloc_ring(struct gpi_ring *ring, u32 elements,
14161416
len = 1 << bit;
14171417
ring->alloc_size = (len + (len - 1));
14181418
dev_dbg(gpii->gpi_dev->dev,
1419-
"#el:%u el_size:%u len:%u actual_len:%llu alloc_size:%lu\n",
1419+
"#el:%u el_size:%u len:%u actual_len:%llu alloc_size:%zu\n",
14201420
elements, el_size, (elements * el_size), len,
14211421
ring->alloc_size);
14221422

14231423
ring->pre_aligned = dma_alloc_coherent(gpii->gpi_dev->dev,
14241424
ring->alloc_size,
14251425
&ring->dma_handle, GFP_KERNEL);
14261426
if (!ring->pre_aligned) {
1427-
dev_err(gpii->gpi_dev->dev, "could not alloc size:%lu mem for ring\n",
1427+
dev_err(gpii->gpi_dev->dev, "could not alloc size:%zu mem for ring\n",
14281428
ring->alloc_size);
14291429
return -ENOMEM;
14301430
}
@@ -1444,8 +1444,8 @@ static int gpi_alloc_ring(struct gpi_ring *ring, u32 elements,
14441444
smp_wmb();
14451445

14461446
dev_dbg(gpii->gpi_dev->dev,
1447-
"phy_pre:0x%0llx phy_alig:0x%0llx len:%u el_size:%u elements:%u\n",
1448-
ring->dma_handle, ring->phys_addr, ring->len,
1447+
"phy_pre:%pad phy_alig:%pa len:%u el_size:%u elements:%u\n",
1448+
&ring->dma_handle, &ring->phys_addr, ring->len,
14491449
ring->el_size, ring->elements);
14501450

14511451
return 0;
@@ -1948,7 +1948,7 @@ static int gpi_ch_init(struct gchan *gchan)
19481948
return ret;
19491949

19501950
error_start_chan:
1951-
for (i = i - 1; i >= 0; i++) {
1951+
for (i = i - 1; i >= 0; i--) {
19521952
gpi_stop_chan(&gpii->gchan[i]);
19531953
gpi_send_cmd(gpii, gchan, GPI_CH_CMD_RESET);
19541954
}

0 commit comments

Comments
 (0)