aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/dmaengine.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-09-07 17:03:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-09-07 17:03:05 -0400
commitcd7b34fe1c2d93c54b368c295de88612c0b7120b (patch)
tree63e7726e2b437c79a53d1b3528d4dc685d3f84e3 /drivers/dma/dmaengine.c
parent75c727155ce1239c1417ba32a48c796de0d762d4 (diff)
parent41bd0314fa3a458bee7ad768d079e681316332e7 (diff)
Merge tag 'dmaengine-4.14-rc1' of git://git.infradead.org/users/vkoul/slave-dma
Pull dmaengine updates from Vinod Koul: "This one features the usual updates to the drivers and one good part of removing DA_SG from core as it has no users. Summary: - Remove DMA_SG support as we have no users for this feature - New driver for Altera / Intel mSGDMA IP core - Support for memset in dmatest and qcom_hidma driver - Update for non cyclic mode in k3dma, bunch of update in bam_dma, bcm sba-raid - Constify device ids across drivers" * tag 'dmaengine-4.14-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (52 commits) dmaengine: sun6i: support V3s SoC variant dmaengine: sun6i: make gate bit in sun8i's DMA engines a common quirk dmaengine: rcar-dmac: document R8A77970 bindings dmaengine: xilinx_dma: Fix error code format specifier dmaengine: altera: Use macros instead of structs to describe the registers dmaengine: ti-dma-crossbar: Fix dra7 reserve function dmaengine: pl330: constify amba_id dmaengine: pl08x: constify amba_id dmaengine: bcm-sba-raid: Remove redundant SBA_REQUEST_STATE_COMPLETED dmaengine: bcm-sba-raid: Explicitly ACK mailbox message after sending dmaengine: bcm-sba-raid: Add debugfs support dmaengine: bcm-sba-raid: Remove redundant SBA_REQUEST_STATE_RECEIVED dmaengine: bcm-sba-raid: Re-factor sba_process_deferred_requests() dmaengine: bcm-sba-raid: Pre-ack async tx descriptor dmaengine: bcm-sba-raid: Peek mbox when we have no free requests dmaengine: bcm-sba-raid: Alloc resources before registering DMA device dmaengine: bcm-sba-raid: Improve sba_issue_pending() run duration dmaengine: bcm-sba-raid: Increase number of free sba_request dmaengine: bcm-sba-raid: Allow arbitrary number free sba_request dmaengine: bcm-sba-raid: Remove reqs_free_count from sba_device ...
Diffstat (limited to 'drivers/dma/dmaengine.c')
-rw-r--r--drivers/dma/dmaengine.c103
1 files changed, 79 insertions, 24 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index d9118ec23025..b451354735d3 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -923,30 +923,85 @@ int dma_async_device_register(struct dma_device *device)
923 return -ENODEV; 923 return -ENODEV;
924 924
925 /* validate device routines */ 925 /* validate device routines */
926 BUG_ON(dma_has_cap(DMA_MEMCPY, device->cap_mask) && 926 if (!device->dev) {
927 !device->device_prep_dma_memcpy); 927 pr_err("DMAdevice must have dev\n");
928 BUG_ON(dma_has_cap(DMA_XOR, device->cap_mask) && 928 return -EIO;
929 !device->device_prep_dma_xor); 929 }
930 BUG_ON(dma_has_cap(DMA_XOR_VAL, device->cap_mask) && 930
931 !device->device_prep_dma_xor_val); 931 if (dma_has_cap(DMA_MEMCPY, device->cap_mask) && !device->device_prep_dma_memcpy) {
932 BUG_ON(dma_has_cap(DMA_PQ, device->cap_mask) && 932 dev_err(device->dev,
933 !device->device_prep_dma_pq); 933 "Device claims capability %s, but op is not defined\n",
934 BUG_ON(dma_has_cap(DMA_PQ_VAL, device->cap_mask) && 934 "DMA_MEMCPY");
935 !device->device_prep_dma_pq_val); 935 return -EIO;
936 BUG_ON(dma_has_cap(DMA_MEMSET, device->cap_mask) && 936 }
937 !device->device_prep_dma_memset); 937
938 BUG_ON(dma_has_cap(DMA_INTERRUPT, device->cap_mask) && 938 if (dma_has_cap(DMA_XOR, device->cap_mask) && !device->device_prep_dma_xor) {
939 !device->device_prep_dma_interrupt); 939 dev_err(device->dev,
940 BUG_ON(dma_has_cap(DMA_SG, device->cap_mask) && 940 "Device claims capability %s, but op is not defined\n",
941 !device->device_prep_dma_sg); 941 "DMA_XOR");
942 BUG_ON(dma_has_cap(DMA_CYCLIC, device->cap_mask) && 942 return -EIO;
943 !device->device_prep_dma_cyclic); 943 }
944 BUG_ON(dma_has_cap(DMA_INTERLEAVE, device->cap_mask) && 944
945 !device->device_prep_interleaved_dma); 945 if (dma_has_cap(DMA_XOR_VAL, device->cap_mask) && !device->device_prep_dma_xor_val) {
946 946 dev_err(device->dev,
947 BUG_ON(!device->device_tx_status); 947 "Device claims capability %s, but op is not defined\n",
948 BUG_ON(!device->device_issue_pending); 948 "DMA_XOR_VAL");
949 BUG_ON(!device->dev); 949 return -EIO;
950 }
951
952 if (dma_has_cap(DMA_PQ, device->cap_mask) && !device->device_prep_dma_pq) {
953 dev_err(device->dev,
954 "Device claims capability %s, but op is not defined\n",
955 "DMA_PQ");
956 return -EIO;
957 }
958
959 if (dma_has_cap(DMA_PQ_VAL, device->cap_mask) && !device->device_prep_dma_pq_val) {
960 dev_err(device->dev,
961 "Device claims capability %s, but op is not defined\n",
962 "DMA_PQ_VAL");
963 return -EIO;
964 }
965
966 if (dma_has_cap(DMA_MEMSET, device->cap_mask) && !device->device_prep_dma_memset) {
967 dev_err(device->dev,
968 "Device claims capability %s, but op is not defined\n",
969 "DMA_MEMSET");
970 return -EIO;
971 }
972
973 if (dma_has_cap(DMA_INTERRUPT, device->cap_mask) && !device->device_prep_dma_interrupt) {
974 dev_err(device->dev,
975 "Device claims capability %s, but op is not defined\n",
976 "DMA_INTERRUPT");
977 return -EIO;
978 }
979
980 if (dma_has_cap(DMA_CYCLIC, device->cap_mask) && !device->device_prep_dma_cyclic) {
981 dev_err(device->dev,
982 "Device claims capability %s, but op is not defined\n",
983 "DMA_CYCLIC");
984 return -EIO;
985 }
986
987 if (dma_has_cap(DMA_INTERLEAVE, device->cap_mask) && !device->device_prep_interleaved_dma) {
988 dev_err(device->dev,
989 "Device claims capability %s, but op is not defined\n",
990 "DMA_INTERLEAVE");
991 return -EIO;
992 }
993
994
995 if (!device->device_tx_status) {
996 dev_err(device->dev, "Device tx_status is not defined\n");
997 return -EIO;
998 }
999
1000
1001 if (!device->device_issue_pending) {
1002 dev_err(device->dev, "Device issue_pending is not defined\n");
1003 return -EIO;
1004 }
950 1005
951 /* note: this only matters in the 1006 /* note: this only matters in the
952 * CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=n case 1007 * CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=n case