Commit 7f74d4d3 authored by Omer Shpigelman's avatar Omer Shpigelman Committed by Oded Gabbay

habanalabs: re-factor memory module code

Some of the functions in the memory module code were too long and/or
contained multiple operations that are not always done together. Re-factor
the code by dividing those functions to smaller functions which are more
readable and maintainable.
Signed-off-by: default avatarOmer Shpigelman <oshpigelman@habana.ai>
Reviewed-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
parent 5d101257
...@@ -3935,7 +3935,7 @@ static int goya_parse_cb_no_ext_queue(struct hl_device *hdev, ...@@ -3935,7 +3935,7 @@ static int goya_parse_cb_no_ext_queue(struct hl_device *hdev,
return 0; return 0;
dev_err(hdev->dev, dev_err(hdev->dev,
"Internal CB address %px + 0x%x is not in SRAM nor in DRAM\n", "Internal CB address 0x%px + 0x%x is not in SRAM nor in DRAM\n",
parser->user_cb, parser->user_cb_size); parser->user_cb, parser->user_cb_size);
return -EFAULT; return -EFAULT;
......
...@@ -692,7 +692,7 @@ struct hl_ctx_mgr { ...@@ -692,7 +692,7 @@ struct hl_ctx_mgr {
* @sgt: pointer to the scatter-gather table that holds the pages. * @sgt: pointer to the scatter-gather table that holds the pages.
* @dir: for DMA unmapping, the direction must be supplied, so save it. * @dir: for DMA unmapping, the direction must be supplied, so save it.
* @debugfs_list: node in debugfs list of command submissions. * @debugfs_list: node in debugfs list of command submissions.
* @addr: user-space virtual pointer to the start of the memory area. * @addr: user-space virtual address of the start of the memory area.
* @size: size of the memory area to pin & map. * @size: size of the memory area to pin & map.
* @dma_mapped: true if the SG was mapped to DMA addresses, false otherwise. * @dma_mapped: true if the SG was mapped to DMA addresses, false otherwise.
*/ */
...@@ -1527,7 +1527,7 @@ void hl_vm_fini(struct hl_device *hdev); ...@@ -1527,7 +1527,7 @@ void hl_vm_fini(struct hl_device *hdev);
int hl_pin_host_memory(struct hl_device *hdev, u64 addr, u64 size, int hl_pin_host_memory(struct hl_device *hdev, u64 addr, u64 size,
struct hl_userptr *userptr); struct hl_userptr *userptr);
int hl_unpin_host_memory(struct hl_device *hdev, struct hl_userptr *userptr); void hl_unpin_host_memory(struct hl_device *hdev, struct hl_userptr *userptr);
void hl_userptr_delete_list(struct hl_device *hdev, void hl_userptr_delete_list(struct hl_device *hdev,
struct list_head *userptr_list); struct list_head *userptr_list);
bool hl_userptr_is_pinned(struct hl_device *hdev, u64 addr, u32 size, bool hl_userptr_is_pinned(struct hl_device *hdev, u64 addr, u32 size,
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment