Skip to content

Commit c6ac718

Browse files
committed
Merge tag 'dmaengine-fix-5.6' of git://git.infradead.org/users/vkoul/slave-dma
Pull dmaengine fixes from Vinod Koul: "Late fixes in dmaengine for v5.6: - move .device_release missing log warning to debug - couple of maintainer entries for HiSilicon and IADX drivers - off-by-one fix for idxd driver - documentation warning fixes - TI k3 dma error handling fix" * tag 'dmaengine-fix-5.6' of git://git.infradead.org/users/vkoul/slave-dma: dmaengine: ti: k3-udma-glue: Fix an error handling path in 'k3_udma_glue_cfg_rx_flow()' MAINTAINERS: Add maintainer for HiSilicon DMA engine driver dmaengine: idxd: fix off by one on cdev dwq refcount MAINTAINERS: rectify the INTEL IADX DRIVER entry dmaengine: move .device_release missing log warning to debug level docs: dmaengine: provider.rst: get rid of some warnings
2 parents 979e52c + 018af9b commit c6ac718

File tree

5 files changed

+38
-16
lines changed

5 files changed

+38
-16
lines changed

Documentation/driver-api/dmaengine/provider.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,15 @@ to use.
266266
attached (via the dmaengine_desc_attach_metadata() helper to the descriptor.
267267

268268
From the DMA driver the following is expected for this mode:
269+
269270
- DMA_MEM_TO_DEV / DEV_MEM_TO_MEM
271+
270272
The data from the provided metadata buffer should be prepared for the DMA
271273
controller to be sent alongside of the payload data. Either by copying to a
272274
hardware descriptor, or highly coupled packet.
275+
273276
- DMA_DEV_TO_MEM
277+
274278
On transfer completion the DMA driver must copy the metadata to the client
275279
provided metadata buffer before notifying the client about the completion.
276280
After the transfer completion, DMA drivers must not touch the metadata
@@ -284,10 +288,14 @@ to use.
284288
and dmaengine_desc_set_metadata_len() is provided as helper functions.
285289

286290
From the DMA driver the following is expected for this mode:
287-
- get_metadata_ptr
291+
292+
- get_metadata_ptr()
293+
288294
Should return a pointer for the metadata buffer, the maximum size of the
289295
metadata buffer and the currently used / valid (if any) bytes in the buffer.
290-
- set_metadata_len
296+
297+
- set_metadata_len()
298+
291299
It is called by the clients after it have placed the metadata to the buffer
292300
to let the DMA driver know the number of valid bytes provided.
293301

MAINTAINERS

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7516,6 +7516,12 @@ F: include/uapi/linux/if_hippi.h
75167516
F: net/802/hippi.c
75177517
F: drivers/net/hippi/
75187518

7519+
HISILICON DMA DRIVER
7520+
M: Zhou Wang <[email protected]>
7521+
7522+
S: Maintained
7523+
F: drivers/dma/hisi_dma.c
7524+
75197525
HISILICON SECURITY ENGINE V2 DRIVER (SEC2)
75207526
M: Zaibo Xu <[email protected]>
75217527
@@ -8476,7 +8482,6 @@ L: [email protected]
84768482
S: Supported
84778483
F: drivers/dma/idxd/*
84788484
F: include/uapi/linux/idxd.h
8479-
F: include/linux/idxd.h
84808485

84818486
INTEL IDLE DRIVER
84828487
M: Jacob Pan <[email protected]>

drivers/dma/dmaengine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ int dma_async_device_register(struct dma_device *device)
11511151
}
11521152

11531153
if (!device->device_release)
1154-
dev_warn(device->dev,
1154+
dev_dbg(device->dev,
11551155
"WARN: Device release is not defined so it is not safe to unbind this driver while in use\n");
11561156

11571157
kref_init(&device->ref);

drivers/dma/idxd/cdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ static int idxd_cdev_open(struct inode *inode, struct file *filp)
8181
dev = &idxd->pdev->dev;
8282
idxd_cdev = &wq->idxd_cdev;
8383

84-
dev_dbg(dev, "%s called\n", __func__);
84+
dev_dbg(dev, "%s called: %d\n", __func__, idxd_wq_refcount(wq));
8585

86-
if (idxd_wq_refcount(wq) > 1 && wq_dedicated(wq))
86+
if (idxd_wq_refcount(wq) > 0 && wq_dedicated(wq))
8787
return -EBUSY;
8888

8989
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);

drivers/dma/ti/k3-udma-glue.c

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -564,12 +564,12 @@ static int k3_udma_glue_cfg_rx_flow(struct k3_udma_glue_rx_channel *rx_chn,
564564
if (IS_ERR(flow->udma_rflow)) {
565565
ret = PTR_ERR(flow->udma_rflow);
566566
dev_err(dev, "UDMAX rflow get err %d\n", ret);
567-
goto err;
567+
return ret;
568568
}
569569

570570
if (flow->udma_rflow_id != xudma_rflow_get_id(flow->udma_rflow)) {
571-
xudma_rflow_put(rx_chn->common.udmax, flow->udma_rflow);
572-
return -ENODEV;
571+
ret = -ENODEV;
572+
goto err_rflow_put;
573573
}
574574

575575
/* request and cfg rings */
@@ -578,27 +578,27 @@ static int k3_udma_glue_cfg_rx_flow(struct k3_udma_glue_rx_channel *rx_chn,
578578
if (!flow->ringrx) {
579579
ret = -ENODEV;
580580
dev_err(dev, "Failed to get RX ring\n");
581-
goto err;
581+
goto err_rflow_put;
582582
}
583583

584584
flow->ringrxfdq = k3_ringacc_request_ring(rx_chn->common.ringacc,
585585
flow_cfg->ring_rxfdq0_id, 0);
586586
if (!flow->ringrxfdq) {
587587
ret = -ENODEV;
588588
dev_err(dev, "Failed to get RXFDQ ring\n");
589-
goto err;
589+
goto err_ringrx_free;
590590
}
591591

592592
ret = k3_ringacc_ring_cfg(flow->ringrx, &flow_cfg->rx_cfg);
593593
if (ret) {
594594
dev_err(dev, "Failed to cfg ringrx %d\n", ret);
595-
goto err;
595+
goto err_ringrxfdq_free;
596596
}
597597

598598
ret = k3_ringacc_ring_cfg(flow->ringrxfdq, &flow_cfg->rxfdq_cfg);
599599
if (ret) {
600600
dev_err(dev, "Failed to cfg ringrxfdq %d\n", ret);
601-
goto err;
601+
goto err_ringrxfdq_free;
602602
}
603603

604604
if (rx_chn->remote) {
@@ -648,16 +648,25 @@ static int k3_udma_glue_cfg_rx_flow(struct k3_udma_glue_rx_channel *rx_chn,
648648
if (ret) {
649649
dev_err(dev, "flow%d config failed: %d\n", flow->udma_rflow_id,
650650
ret);
651-
goto err;
651+
goto err_ringrxfdq_free;
652652
}
653653

654654
rx_chn->flows_ready++;
655655
dev_dbg(dev, "flow%d config done. ready:%d\n",
656656
flow->udma_rflow_id, rx_chn->flows_ready);
657657

658658
return 0;
659-
err:
660-
k3_udma_glue_release_rx_flow(rx_chn, flow_idx);
659+
660+
err_ringrxfdq_free:
661+
k3_ringacc_ring_free(flow->ringrxfdq);
662+
663+
err_ringrx_free:
664+
k3_ringacc_ring_free(flow->ringrx);
665+
666+
err_rflow_put:
667+
xudma_rflow_put(rx_chn->common.udmax, flow->udma_rflow);
668+
flow->udma_rflow = NULL;
669+
661670
return ret;
662671
}
663672

0 commit comments

Comments
 (0)