@@ -159,6 +159,11 @@ enum hl_mmu_page_table_location {
159159#define hl_asic_dma_pool_free (hdev , vaddr , dma_addr ) \
160160 hl_asic_dma_pool_free_caller(hdev, vaddr, dma_addr, __func__)
161161
162+ #define hl_dma_map_sgtable (hdev , sgt , dir ) \
163+ hl_dma_map_sgtable_caller(hdev, sgt, dir, __func__)
164+ #define hl_dma_unmap_sgtable (hdev , sgt , dir ) \
165+ hl_dma_unmap_sgtable_caller(hdev, sgt, dir, __func__)
166+
162167/*
163168 * Reset Flags
164169 *
@@ -1520,9 +1525,9 @@ struct engines_data {
15201525 * @asic_dma_pool_free: free small DMA allocation from pool.
15211526 * @cpu_accessible_dma_pool_alloc: allocate CPU PQ packet from DMA pool.
15221527 * @cpu_accessible_dma_pool_free: free CPU PQ packet from DMA pool.
1523- * @hl_dma_unmap_sgtable: DMA unmap scatter-gather table.
1528+ * @dma_unmap_sgtable: DMA unmap scatter-gather table.
1529+ * @dma_map_sgtable: DMA map scatter-gather table.
15241530 * @cs_parser: parse Command Submission.
1525- * @asic_dma_map_sgtable: DMA map scatter-gather table.
15261531 * @add_end_of_cb_packets: Add packets to the end of CB, if device requires it.
15271532 * @update_eq_ci: update event queue CI.
15281533 * @context_switch: called upon ASID context switch.
@@ -1643,12 +1648,11 @@ struct hl_asic_funcs {
16431648 size_t size , dma_addr_t * dma_handle );
16441649 void (* cpu_accessible_dma_pool_free )(struct hl_device * hdev ,
16451650 size_t size , void * vaddr );
1646- void (* hl_dma_unmap_sgtable )(struct hl_device * hdev ,
1647- struct sg_table * sgt ,
1651+ void (* dma_unmap_sgtable )(struct hl_device * hdev , struct sg_table * sgt ,
16481652 enum dma_data_direction dir );
1649- int (* cs_parser )(struct hl_device * hdev , struct hl_cs_parser * parser );
1650- int (* asic_dma_map_sgtable )(struct hl_device * hdev , struct sg_table * sgt ,
1653+ int (* dma_map_sgtable )(struct hl_device * hdev , struct sg_table * sgt ,
16511654 enum dma_data_direction dir );
1655+ int (* cs_parser )(struct hl_device * hdev , struct hl_cs_parser * parser );
16521656 void (* add_end_of_cb_packets )(struct hl_device * hdev ,
16531657 void * kernel_address , u32 len ,
16541658 u32 original_len ,
@@ -3670,8 +3674,13 @@ void *hl_asic_dma_pool_zalloc_caller(struct hl_device *hdev, size_t size, gfp_t
36703674 dma_addr_t * dma_handle , const char * caller );
36713675void hl_asic_dma_pool_free_caller (struct hl_device * hdev , void * vaddr , dma_addr_t dma_addr ,
36723676 const char * caller );
3673- int hl_dma_map_sgtable (struct hl_device * hdev , struct sg_table * sgt , enum dma_data_direction dir );
3674- void hl_dma_unmap_sgtable (struct hl_device * hdev , struct sg_table * sgt ,
3677+ int hl_dma_map_sgtable_caller (struct hl_device * hdev , struct sg_table * sgt ,
3678+ enum dma_data_direction dir , const char * caller );
3679+ void hl_dma_unmap_sgtable_caller (struct hl_device * hdev , struct sg_table * sgt ,
3680+ enum dma_data_direction dir , const char * caller );
3681+ int hl_asic_dma_map_sgtable (struct hl_device * hdev , struct sg_table * sgt ,
3682+ enum dma_data_direction dir );
3683+ void hl_asic_dma_unmap_sgtable (struct hl_device * hdev , struct sg_table * sgt ,
36753684 enum dma_data_direction dir );
36763685int hl_access_sram_dram_region (struct hl_device * hdev , u64 addr , u64 * val ,
36773686 enum debugfs_access_type acc_type , enum pci_region region_type , bool set_dram_bar );
0 commit comments