summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-17 11:47:17 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-17 11:47:17 -0800
commite81dd54f62c753dd423d1a9b62481a1c599fb975 (patch)
treeab37f1250243f750ee9ce551007179931238a5b3 /include
parent9b725d5959a1d9bb670ccdb23add45f0eaafefb5 (diff)
parentab736ed52e3409b58a4888715e4425b6e8ac444f (diff)
Merge tag 'dmaengine-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine
Pull dmaengine updates from Vinod Koul: "Core: - Add Frank Li as susbstem reviewer to help with reviews New Support: - Mediatek support for Dimensity 6300 and 9200 controller - Qualcomm Kaanapali and Glymur GPI DMA engine - Synopsis DW AXI Agilex5 - Renesas RZ/V2N SoC - Atmel microchip lan9691-dma - Tegra ADMA tegra264 Updates: - sg_nents_for_dma() helper use in subsystem - pm_runtime_mark_last_busy() redundant call update for subsystem - Residue support for xilinx AXIDMA driver - Intel Max SGL Size Support and capabilities for DSA3.0 - AXI dma larger than 32bits address support" * tag 'dmaengine-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (64 commits) dmaengine: add Frank Li as reviewer dt-bindings: dma: qcom,gpi: Update max interrupts lines to 16 dmaengine: fsl-edma: don't explicitly disable clocks in .remove() dmaengine: xilinx: xdma: use sg_nents_for_dma() helper dmaengine: sh: use sg_nents_for_dma() helper dmaengine: sa11x0: use sg_nents_for_dma() helper dmaengine: qcom: bam_dma: use sg_nents_for_dma() helper dmaengine: qcom: adm: use sg_nents_for_dma() helper dmaengine: pxa-dma: use sg_nents_for_dma() helper dmaengine: lgm: use sg_nents_for_dma() helper dmaengine: k3dma: use sg_nents_for_dma() helper dmaengine: dw-axi-dmac: use sg_nents_for_dma() helper dmaengine: bcm2835-dma: use sg_nents_for_dma() helper dmaengine: axi-dmac: use sg_nents_for_dma() helper dmaengine: altera-msgdma: use sg_nents_for_dma() helper scatterlist: introduce sg_nents_for_dma() helper dmaengine: idxd: Add Max SGL Size Support for DSA3.0 dmaengine: idxd: Expose DSA3.0 capabilities through sysfs dmaengine: sh: rz-dmac: Make channel irq local dmaengine: pl08x: Fix comment stating the difference between PL080 and PL081 ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/dma/edma.h24
-rw-r--r--include/linux/scatterlist.h2
-rw-r--r--include/linux/shdma-base.h28
-rw-r--r--include/uapi/linux/idxd.h270
4 files changed, 160 insertions, 164 deletions
diff --git a/include/linux/dma/edma.h b/include/linux/dma/edma.h
index 3080747689f6..270b5458aecf 100644
--- a/include/linux/dma/edma.h
+++ b/include/linux/dma/edma.h
@@ -27,7 +27,7 @@ struct dw_edma_region {
};
/**
- * struct dw_edma_core_ops - platform-specific eDMA methods
+ * struct dw_edma_plat_ops - platform-specific eDMA methods
* @irq_vector: Get IRQ number of the passed eDMA channel. Note the
* method accepts the channel id in the end-to-end
* numbering with the eDMA write channels being placed
@@ -63,19 +63,17 @@ enum dw_edma_chip_flags {
/**
* struct dw_edma_chip - representation of DesignWare eDMA controller hardware
* @dev: struct device of the eDMA controller
- * @id: instance ID
* @nr_irqs: total number of DMA IRQs
- * @ops DMA channel to IRQ number mapping
- * @flags dw_edma_chip_flags
- * @reg_base DMA register base address
- * @ll_wr_cnt DMA write link list count
- * @ll_rd_cnt DMA read link list count
- * @rg_region DMA register region
- * @ll_region_wr DMA descriptor link list memory for write channel
- * @ll_region_rd DMA descriptor link list memory for read channel
- * @dt_region_wr DMA data memory for write channel
- * @dt_region_rd DMA data memory for read channel
- * @mf DMA register map format
+ * @ops: DMA channel to IRQ number mapping
+ * @flags: dw_edma_chip_flags
+ * @reg_base: DMA register base address
+ * @ll_wr_cnt: DMA write link list count
+ * @ll_rd_cnt: DMA read link list count
+ * @ll_region_wr: DMA descriptor link list memory for write channel
+ * @ll_region_rd: DMA descriptor link list memory for read channel
+ * @dt_region_wr: DMA data memory for write channel
+ * @dt_region_rd: DMA data memory for read channel
+ * @mf: DMA register map format
* @dw: struct dw_edma that is filled by dw_edma_probe()
*/
struct dw_edma_chip {
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 29f6ceb98d74..6de1a2434299 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -441,6 +441,8 @@ static inline void sg_init_marker(struct scatterlist *sgl,
int sg_nents(struct scatterlist *sg);
int sg_nents_for_len(struct scatterlist *sg, u64 len);
+int sg_nents_for_dma(struct scatterlist *sgl, unsigned int sglen, size_t len);
+
struct scatterlist *sg_last(struct scatterlist *s, unsigned int);
void sg_init_table(struct scatterlist *, unsigned int);
void sg_init_one(struct scatterlist *, const void *, unsigned int);
diff --git a/include/linux/shdma-base.h b/include/linux/shdma-base.h
index 03ba4dab2ef7..b6827c06d332 100644
--- a/include/linux/shdma-base.h
+++ b/include/linux/shdma-base.h
@@ -19,11 +19,11 @@
#include <linux/types.h>
/**
- * shdma_pm_state - DMA channel PM state
- * SHDMA_PM_ESTABLISHED: either idle or during data transfer
- * SHDMA_PM_BUSY: during the transfer preparation, when we have to
+ * enum shdma_pm_state - DMA channel PM state
+ * @SHDMA_PM_ESTABLISHED: either idle or during data transfer
+ * @SHDMA_PM_BUSY: during the transfer preparation, when we have to
* drop the lock temporarily
- * SHDMA_PM_PENDING: transfers pending
+ * @SHDMA_PM_PENDING: transfers pending
*/
enum shdma_pm_state {
SHDMA_PM_ESTABLISHED,
@@ -74,18 +74,18 @@ struct shdma_chan {
/**
* struct shdma_ops - simple DMA driver operations
- * desc_completed: return true, if this is the descriptor, that just has
+ * @desc_completed: return true, if this is the descriptor, that just has
* completed (atomic)
- * halt_channel: stop DMA channel operation (atomic)
- * channel_busy: return true, if the channel is busy (atomic)
- * slave_addr: return slave DMA address
- * desc_setup: set up the hardware specific descriptor portion (atomic)
- * set_slave: bind channel to a slave
- * setup_xfer: configure channel hardware for operation (atomic)
- * start_xfer: start the DMA transfer (atomic)
- * embedded_desc: return Nth struct shdma_desc pointer from the
+ * @halt_channel: stop DMA channel operation (atomic)
+ * @channel_busy: return true, if the channel is busy (atomic)
+ * @slave_addr: return slave DMA address
+ * @desc_setup: set up the hardware specific descriptor portion (atomic)
+ * @set_slave: bind channel to a slave
+ * @setup_xfer: configure channel hardware for operation (atomic)
+ * @start_xfer: start the DMA transfer (atomic)
+ * @embedded_desc: return Nth struct shdma_desc pointer from the
* descriptor array
- * chan_irq: process channel IRQ, return true if a transfer has
+ * @chan_irq: process channel IRQ, return true if a transfer has
* completed (atomic)
*/
struct shdma_ops {
diff --git a/include/uapi/linux/idxd.h b/include/uapi/linux/idxd.h
index 3d1987e1bb2d..fdcc8eefb925 100644
--- a/include/uapi/linux/idxd.h
+++ b/include/uapi/linux/idxd.h
@@ -3,11 +3,7 @@
#ifndef _USR_IDXD_H_
#define _USR_IDXD_H_
-#ifdef __KERNEL__
#include <linux/types.h>
-#else
-#include <stdint.h>
-#endif
/* Driver command error status */
enum idxd_scmd_stat {
@@ -176,132 +172,132 @@ enum iax_completion_status {
#define DSA_COMP_STATUS(status) ((status) & DSA_COMP_STATUS_MASK)
struct dsa_hw_desc {
- uint32_t pasid:20;
- uint32_t rsvd:11;
- uint32_t priv:1;
- uint32_t flags:24;
- uint32_t opcode:8;
- uint64_t completion_addr;
+ __u32 pasid:20;
+ __u32 rsvd:11;
+ __u32 priv:1;
+ __u32 flags:24;
+ __u32 opcode:8;
+ __u64 completion_addr;
union {
- uint64_t src_addr;
- uint64_t rdback_addr;
- uint64_t pattern;
- uint64_t desc_list_addr;
- uint64_t pattern_lower;
- uint64_t transl_fetch_addr;
+ __u64 src_addr;
+ __u64 rdback_addr;
+ __u64 pattern;
+ __u64 desc_list_addr;
+ __u64 pattern_lower;
+ __u64 transl_fetch_addr;
};
union {
- uint64_t dst_addr;
- uint64_t rdback_addr2;
- uint64_t src2_addr;
- uint64_t comp_pattern;
+ __u64 dst_addr;
+ __u64 rdback_addr2;
+ __u64 src2_addr;
+ __u64 comp_pattern;
};
union {
- uint32_t xfer_size;
- uint32_t desc_count;
- uint32_t region_size;
+ __u32 xfer_size;
+ __u32 desc_count;
+ __u32 region_size;
};
- uint16_t int_handle;
- uint16_t rsvd1;
+ __u16 int_handle;
+ __u16 rsvd1;
union {
- uint8_t expected_res;
+ __u8 expected_res;
/* create delta record */
struct {
- uint64_t delta_addr;
- uint32_t max_delta_size;
- uint32_t delt_rsvd;
- uint8_t expected_res_mask;
+ __u64 delta_addr;
+ __u32 max_delta_size;
+ __u32 delt_rsvd;
+ __u8 expected_res_mask;
};
- uint32_t delta_rec_size;
- uint64_t dest2;
+ __u32 delta_rec_size;
+ __u64 dest2;
/* CRC */
struct {
- uint32_t crc_seed;
- uint32_t crc_rsvd;
- uint64_t seed_addr;
+ __u32 crc_seed;
+ __u32 crc_rsvd;
+ __u64 seed_addr;
};
/* DIF check or strip */
struct {
- uint8_t src_dif_flags;
- uint8_t dif_chk_res;
- uint8_t dif_chk_flags;
- uint8_t dif_chk_res2[5];
- uint32_t chk_ref_tag_seed;
- uint16_t chk_app_tag_mask;
- uint16_t chk_app_tag_seed;
+ __u8 src_dif_flags;
+ __u8 dif_chk_res;
+ __u8 dif_chk_flags;
+ __u8 dif_chk_res2[5];
+ __u32 chk_ref_tag_seed;
+ __u16 chk_app_tag_mask;
+ __u16 chk_app_tag_seed;
};
/* DIF insert */
struct {
- uint8_t dif_ins_res;
- uint8_t dest_dif_flag;
- uint8_t dif_ins_flags;
- uint8_t dif_ins_res2[13];
- uint32_t ins_ref_tag_seed;
- uint16_t ins_app_tag_mask;
- uint16_t ins_app_tag_seed;
+ __u8 dif_ins_res;
+ __u8 dest_dif_flag;
+ __u8 dif_ins_flags;
+ __u8 dif_ins_res2[13];
+ __u32 ins_ref_tag_seed;
+ __u16 ins_app_tag_mask;
+ __u16 ins_app_tag_seed;
};
/* DIF update */
struct {
- uint8_t src_upd_flags;
- uint8_t upd_dest_flags;
- uint8_t dif_upd_flags;
- uint8_t dif_upd_res[5];
- uint32_t src_ref_tag_seed;
- uint16_t src_app_tag_mask;
- uint16_t src_app_tag_seed;
- uint32_t dest_ref_tag_seed;
- uint16_t dest_app_tag_mask;
- uint16_t dest_app_tag_seed;
+ __u8 src_upd_flags;
+ __u8 upd_dest_flags;
+ __u8 dif_upd_flags;
+ __u8 dif_upd_res[5];
+ __u32 src_ref_tag_seed;
+ __u16 src_app_tag_mask;
+ __u16 src_app_tag_seed;
+ __u32 dest_ref_tag_seed;
+ __u16 dest_app_tag_mask;
+ __u16 dest_app_tag_seed;
};
/* Fill */
- uint64_t pattern_upper;
+ __u64 pattern_upper;
/* Translation fetch */
struct {
- uint64_t transl_fetch_res;
- uint32_t region_stride;
+ __u64 transl_fetch_res;
+ __u32 region_stride;
};
/* DIX generate */
struct {
- uint8_t dix_gen_res;
- uint8_t dest_dif_flags;
- uint8_t dif_flags;
- uint8_t dix_gen_res2[13];
- uint32_t ref_tag_seed;
- uint16_t app_tag_mask;
- uint16_t app_tag_seed;
+ __u8 dix_gen_res;
+ __u8 dest_dif_flags;
+ __u8 dif_flags;
+ __u8 dix_gen_res2[13];
+ __u32 ref_tag_seed;
+ __u16 app_tag_mask;
+ __u16 app_tag_seed;
};
- uint8_t op_specific[24];
+ __u8 op_specific[24];
};
} __attribute__((packed));
struct iax_hw_desc {
- uint32_t pasid:20;
- uint32_t rsvd:11;
- uint32_t priv:1;
- uint32_t flags:24;
- uint32_t opcode:8;
- uint64_t completion_addr;
- uint64_t src1_addr;
- uint64_t dst_addr;
- uint32_t src1_size;
- uint16_t int_handle;
+ __u32 pasid:20;
+ __u32 rsvd:11;
+ __u32 priv:1;
+ __u32 flags:24;
+ __u32 opcode:8;
+ __u64 completion_addr;
+ __u64 src1_addr;
+ __u64 dst_addr;
+ __u32 src1_size;
+ __u16 int_handle;
union {
- uint16_t compr_flags;
- uint16_t decompr_flags;
+ __u16 compr_flags;
+ __u16 decompr_flags;
};
- uint64_t src2_addr;
- uint32_t max_dst_size;
- uint32_t src2_size;
- uint32_t filter_flags;
- uint32_t num_inputs;
+ __u64 src2_addr;
+ __u32 max_dst_size;
+ __u32 src2_size;
+ __u32 filter_flags;
+ __u32 num_inputs;
} __attribute__((packed));
struct dsa_raw_desc {
- uint64_t field[8];
+ __u64 field[8];
} __attribute__((packed));
/*
@@ -309,91 +305,91 @@ struct dsa_raw_desc {
* volatile and prevent the compiler from optimize the read.
*/
struct dsa_completion_record {
- volatile uint8_t status;
+ volatile __u8 status;
union {
- uint8_t result;
- uint8_t dif_status;
+ __u8 result;
+ __u8 dif_status;
};
- uint8_t fault_info;
- uint8_t rsvd;
+ __u8 fault_info;
+ __u8 rsvd;
union {
- uint32_t bytes_completed;
- uint32_t descs_completed;
+ __u32 bytes_completed;
+ __u32 descs_completed;
};
- uint64_t fault_addr;
+ __u64 fault_addr;
union {
/* common record */
struct {
- uint32_t invalid_flags:24;
- uint32_t rsvd2:8;
+ __u32 invalid_flags:24;
+ __u32 rsvd2:8;
};
- uint32_t delta_rec_size;
- uint64_t crc_val;
+ __u32 delta_rec_size;
+ __u64 crc_val;
/* DIF check & strip */
struct {
- uint32_t dif_chk_ref_tag;
- uint16_t dif_chk_app_tag_mask;
- uint16_t dif_chk_app_tag;
+ __u32 dif_chk_ref_tag;
+ __u16 dif_chk_app_tag_mask;
+ __u16 dif_chk_app_tag;
};
/* DIF insert */
struct {
- uint64_t dif_ins_res;
- uint32_t dif_ins_ref_tag;
- uint16_t dif_ins_app_tag_mask;
- uint16_t dif_ins_app_tag;
+ __u64 dif_ins_res;
+ __u32 dif_ins_ref_tag;
+ __u16 dif_ins_app_tag_mask;
+ __u16 dif_ins_app_tag;
};
/* DIF update */
struct {
- uint32_t dif_upd_src_ref_tag;
- uint16_t dif_upd_src_app_tag_mask;
- uint16_t dif_upd_src_app_tag;
- uint32_t dif_upd_dest_ref_tag;
- uint16_t dif_upd_dest_app_tag_mask;
- uint16_t dif_upd_dest_app_tag;
+ __u32 dif_upd_src_ref_tag;
+ __u16 dif_upd_src_app_tag_mask;
+ __u16 dif_upd_src_app_tag;
+ __u32 dif_upd_dest_ref_tag;
+ __u16 dif_upd_dest_app_tag_mask;
+ __u16 dif_upd_dest_app_tag;
};
/* DIX generate */
struct {
- uint64_t dix_gen_res;
- uint32_t dix_ref_tag;
- uint16_t dix_app_tag_mask;
- uint16_t dix_app_tag;
+ __u64 dix_gen_res;
+ __u32 dix_ref_tag;
+ __u16 dix_app_tag_mask;
+ __u16 dix_app_tag;
};
- uint8_t op_specific[16];
+ __u8 op_specific[16];
};
} __attribute__((packed));
struct dsa_raw_completion_record {
- uint64_t field[4];
+ __u64 field[4];
} __attribute__((packed));
struct iax_completion_record {
- volatile uint8_t status;
- uint8_t error_code;
- uint8_t fault_info;
- uint8_t rsvd;
- uint32_t bytes_completed;
- uint64_t fault_addr;
- uint32_t invalid_flags;
- uint32_t rsvd2;
- uint32_t output_size;
- uint8_t output_bits;
- uint8_t rsvd3;
- uint16_t xor_csum;
- uint32_t crc;
- uint32_t min;
- uint32_t max;
- uint32_t sum;
- uint64_t rsvd4[2];
+ volatile __u8 status;
+ __u8 error_code;
+ __u8 fault_info;
+ __u8 rsvd;
+ __u32 bytes_completed;
+ __u64 fault_addr;
+ __u32 invalid_flags;
+ __u32 rsvd2;
+ __u32 output_size;
+ __u8 output_bits;
+ __u8 rsvd3;
+ __u16 xor_csum;
+ __u32 crc;
+ __u32 min;
+ __u32 max;
+ __u32 sum;
+ __u64 rsvd4[2];
} __attribute__((packed));
struct iax_raw_completion_record {
- uint64_t field[8];
+ __u64 field[8];
} __attribute__((packed));
#endif