Lines Matching refs:dev_entry
107 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in command_buffers_show() local
111 spin_lock(&dev_entry->cb_spinlock); in command_buffers_show()
113 list_for_each_entry(cb, &dev_entry->cb_list, debugfs_list) { in command_buffers_show()
127 spin_unlock(&dev_entry->cb_spinlock); in command_buffers_show()
138 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in command_submission_show() local
142 spin_lock(&dev_entry->cs_spinlock); in command_submission_show()
144 list_for_each_entry(cs, &dev_entry->cs_list, debugfs_list) { in command_submission_show()
158 spin_unlock(&dev_entry->cs_spinlock); in command_submission_show()
169 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in command_submission_jobs_show() local
173 spin_lock(&dev_entry->cs_job_spinlock); in command_submission_jobs_show()
175 list_for_each_entry(job, &dev_entry->cs_job_list, debugfs_list) { in command_submission_jobs_show()
195 spin_unlock(&dev_entry->cs_job_spinlock); in command_submission_jobs_show()
206 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in userptr_show() local
212 spin_lock(&dev_entry->userptr_spinlock); in userptr_show()
214 list_for_each_entry(userptr, &dev_entry->userptr_list, debugfs_list) { in userptr_show()
226 spin_unlock(&dev_entry->userptr_spinlock); in userptr_show()
237 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in vm_show() local
251 mutex_lock(&dev_entry->ctx_mem_hash_mutex); in vm_show()
253 list_for_each_entry(ctx, &dev_entry->ctx_mem_hash_list, debugfs_list) { in vm_show()
322 mutex_unlock(&dev_entry->ctx_mem_hash_mutex); in vm_show()
324 ctx = hl_get_compute_ctx(dev_entry->hdev); in vm_show()
352 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in userptr_lookup_show() local
360 spin_lock(&dev_entry->userptr_spinlock); in userptr_lookup_show()
362 list_for_each_entry(userptr, &dev_entry->userptr_list, debugfs_list) { in userptr_lookup_show()
363 if (dev_entry->userptr_lookup >= userptr->addr && in userptr_lookup_show()
364 dev_entry->userptr_lookup < userptr->addr + userptr->size) { in userptr_lookup_show()
373 if (dev_entry->userptr_lookup >= sg_start && in userptr_lookup_show()
374 dev_entry->userptr_lookup < sg_end) { in userptr_lookup_show()
375 dma_addr += (dev_entry->userptr_lookup - in userptr_lookup_show()
384 dev_entry->userptr_lookup, in userptr_lookup_show()
393 spin_unlock(&dev_entry->userptr_spinlock); in userptr_lookup_show()
406 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in userptr_lookup_write() local
414 dev_entry->userptr_lookup = value; in userptr_lookup_write()
422 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in mmu_show() local
423 struct hl_device *hdev = dev_entry->hdev; in mmu_show()
426 u64 virt_addr = dev_entry->mmu_addr, phys_addr; in mmu_show()
429 if (dev_entry->mmu_asid == HL_KERNEL_ASID_ID) in mmu_show()
448 (dev_entry->mmu_addr != hops_info.scrambled_vaddr)) in mmu_show()
451 dev_entry->mmu_asid, dev_entry->mmu_addr, in mmu_show()
457 dev_entry->mmu_asid, dev_entry->mmu_addr, phys_addr); in mmu_show()
469 if (dev_entry->mmu_asid != HL_KERNEL_ASID_ID) in mmu_show()
480 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in mmu_asid_va_write() local
481 struct hl_device *hdev = dev_entry->hdev; in mmu_asid_va_write()
497 rc = kstrtouint(kbuf, 10, &dev_entry->mmu_asid); in mmu_asid_va_write()
503 rc = kstrtoull(c+3, 16, &dev_entry->mmu_addr); in mmu_asid_va_write()
518 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in mmu_ack_error() local
519 struct hl_device *hdev = dev_entry->hdev; in mmu_ack_error()
522 if (!dev_entry->mmu_cap_mask) { in mmu_ack_error()
527 rc = hdev->asic_funcs->ack_mmu_errors(hdev, dev_entry->mmu_cap_mask); in mmu_ack_error()
542 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in mmu_ack_error_value_write() local
543 struct hl_device *hdev = dev_entry->hdev; in mmu_ack_error_value_write()
558 rc = kstrtoull(kbuf, 16, &dev_entry->mmu_cap_mask); in mmu_ack_error_value_write()
572 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in engines_show() local
573 struct hl_device *hdev = dev_entry->hdev; in engines_show()
1558 static void add_secured_nodes(struct hl_dbg_device_entry *dev_entry, struct dentry *root) in add_secured_nodes() argument
1563 &dev_entry->i2c_bus); in add_secured_nodes()
1568 &dev_entry->i2c_addr); in add_secured_nodes()
1573 &dev_entry->i2c_reg); in add_secured_nodes()
1578 &dev_entry->i2c_len); in add_secured_nodes()
1583 dev_entry, in add_secured_nodes()
1589 dev_entry, in add_secured_nodes()
1595 dev_entry, in add_secured_nodes()
1601 dev_entry, in add_secured_nodes()
1605 static void add_files_to_device(struct hl_device *hdev, struct hl_dbg_device_entry *dev_entry, in add_files_to_device() argument
1620 dev_entry, in add_files_to_device()
1626 &dev_entry->addr); in add_files_to_device()
1631 dev_entry, in add_files_to_device()
1637 dev_entry, in add_files_to_device()
1643 dev_entry, in add_files_to_device()
1649 dev_entry, in add_files_to_device()
1655 dev_entry, in add_files_to_device()
1661 dev_entry, in add_files_to_device()
1667 dev_entry, in add_files_to_device()
1673 dev_entry, in add_files_to_device()
1679 dev_entry, in add_files_to_device()
1685 &dev_entry->data_dma_blob_desc); in add_files_to_device()
1690 dev_entry, in add_files_to_device()
1696 &dev_entry->mon_dump_blob_desc); in add_files_to_device()
1706 dev_entry, in add_files_to_device()
1712 dev_entry, in add_files_to_device()
1725 for (i = 0, entry = dev_entry->entry_arr ; i < count ; i++, entry++) { in add_files_to_device()
1732 entry->dev_entry = dev_entry; in add_files_to_device()
1738 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_device_init() local
1741 dev_entry->hdev = hdev; in hl_debugfs_device_init()
1742 dev_entry->entry_arr = kmalloc_array(count, sizeof(struct hl_debugfs_entry), GFP_KERNEL); in hl_debugfs_device_init()
1743 if (!dev_entry->entry_arr) in hl_debugfs_device_init()
1746 dev_entry->data_dma_blob_desc.size = 0; in hl_debugfs_device_init()
1747 dev_entry->data_dma_blob_desc.data = NULL; in hl_debugfs_device_init()
1748 dev_entry->mon_dump_blob_desc.size = 0; in hl_debugfs_device_init()
1749 dev_entry->mon_dump_blob_desc.data = NULL; in hl_debugfs_device_init()
1751 INIT_LIST_HEAD(&dev_entry->file_list); in hl_debugfs_device_init()
1752 INIT_LIST_HEAD(&dev_entry->cb_list); in hl_debugfs_device_init()
1753 INIT_LIST_HEAD(&dev_entry->cs_list); in hl_debugfs_device_init()
1754 INIT_LIST_HEAD(&dev_entry->cs_job_list); in hl_debugfs_device_init()
1755 INIT_LIST_HEAD(&dev_entry->userptr_list); in hl_debugfs_device_init()
1756 INIT_LIST_HEAD(&dev_entry->ctx_mem_hash_list); in hl_debugfs_device_init()
1757 mutex_init(&dev_entry->file_mutex); in hl_debugfs_device_init()
1758 init_rwsem(&dev_entry->state_dump_sem); in hl_debugfs_device_init()
1759 spin_lock_init(&dev_entry->cb_spinlock); in hl_debugfs_device_init()
1760 spin_lock_init(&dev_entry->cs_spinlock); in hl_debugfs_device_init()
1761 spin_lock_init(&dev_entry->cs_job_spinlock); in hl_debugfs_device_init()
1762 spin_lock_init(&dev_entry->userptr_spinlock); in hl_debugfs_device_init()
1763 mutex_init(&dev_entry->ctx_mem_hash_mutex); in hl_debugfs_device_init()
1787 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_device() local
1789 dev_entry->root = hdev->drm.accel->debugfs_root; in hl_debugfs_add_device()
1791 add_files_to_device(hdev, dev_entry, dev_entry->root); in hl_debugfs_add_device()
1794 add_secured_nodes(dev_entry, dev_entry->root); in hl_debugfs_add_device()
1799 struct hl_dbg_device_entry *dev_entry = &hpriv->hdev->hl_debugfs; in hl_debugfs_add_file() local
1801 mutex_lock(&dev_entry->file_mutex); in hl_debugfs_add_file()
1802 list_add(&hpriv->debugfs_list, &dev_entry->file_list); in hl_debugfs_add_file()
1803 mutex_unlock(&dev_entry->file_mutex); in hl_debugfs_add_file()
1808 struct hl_dbg_device_entry *dev_entry = &hpriv->hdev->hl_debugfs; in hl_debugfs_remove_file() local
1810 mutex_lock(&dev_entry->file_mutex); in hl_debugfs_remove_file()
1812 mutex_unlock(&dev_entry->file_mutex); in hl_debugfs_remove_file()
1817 struct hl_dbg_device_entry *dev_entry = &cb->hdev->hl_debugfs; in hl_debugfs_add_cb() local
1819 spin_lock(&dev_entry->cb_spinlock); in hl_debugfs_add_cb()
1820 list_add(&cb->debugfs_list, &dev_entry->cb_list); in hl_debugfs_add_cb()
1821 spin_unlock(&dev_entry->cb_spinlock); in hl_debugfs_add_cb()
1826 struct hl_dbg_device_entry *dev_entry = &cb->hdev->hl_debugfs; in hl_debugfs_remove_cb() local
1828 spin_lock(&dev_entry->cb_spinlock); in hl_debugfs_remove_cb()
1830 spin_unlock(&dev_entry->cb_spinlock); in hl_debugfs_remove_cb()
1835 struct hl_dbg_device_entry *dev_entry = &cs->ctx->hdev->hl_debugfs; in hl_debugfs_add_cs() local
1837 spin_lock(&dev_entry->cs_spinlock); in hl_debugfs_add_cs()
1838 list_add(&cs->debugfs_list, &dev_entry->cs_list); in hl_debugfs_add_cs()
1839 spin_unlock(&dev_entry->cs_spinlock); in hl_debugfs_add_cs()
1844 struct hl_dbg_device_entry *dev_entry = &cs->ctx->hdev->hl_debugfs; in hl_debugfs_remove_cs() local
1846 spin_lock(&dev_entry->cs_spinlock); in hl_debugfs_remove_cs()
1848 spin_unlock(&dev_entry->cs_spinlock); in hl_debugfs_remove_cs()
1853 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_job() local
1855 spin_lock(&dev_entry->cs_job_spinlock); in hl_debugfs_add_job()
1856 list_add(&job->debugfs_list, &dev_entry->cs_job_list); in hl_debugfs_add_job()
1857 spin_unlock(&dev_entry->cs_job_spinlock); in hl_debugfs_add_job()
1862 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_remove_job() local
1864 spin_lock(&dev_entry->cs_job_spinlock); in hl_debugfs_remove_job()
1866 spin_unlock(&dev_entry->cs_job_spinlock); in hl_debugfs_remove_job()
1871 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_userptr() local
1873 spin_lock(&dev_entry->userptr_spinlock); in hl_debugfs_add_userptr()
1874 list_add(&userptr->debugfs_list, &dev_entry->userptr_list); in hl_debugfs_add_userptr()
1875 spin_unlock(&dev_entry->userptr_spinlock); in hl_debugfs_add_userptr()
1881 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_remove_userptr() local
1883 spin_lock(&dev_entry->userptr_spinlock); in hl_debugfs_remove_userptr()
1885 spin_unlock(&dev_entry->userptr_spinlock); in hl_debugfs_remove_userptr()
1890 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_ctx_mem_hash() local
1892 mutex_lock(&dev_entry->ctx_mem_hash_mutex); in hl_debugfs_add_ctx_mem_hash()
1893 list_add(&ctx->debugfs_list, &dev_entry->ctx_mem_hash_list); in hl_debugfs_add_ctx_mem_hash()
1894 mutex_unlock(&dev_entry->ctx_mem_hash_mutex); in hl_debugfs_add_ctx_mem_hash()
1899 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_remove_ctx_mem_hash() local
1901 mutex_lock(&dev_entry->ctx_mem_hash_mutex); in hl_debugfs_remove_ctx_mem_hash()
1903 mutex_unlock(&dev_entry->ctx_mem_hash_mutex); in hl_debugfs_remove_ctx_mem_hash()
1916 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_set_state_dump() local
1918 down_write(&dev_entry->state_dump_sem); in hl_debugfs_set_state_dump()
1920 dev_entry->state_dump_head = (dev_entry->state_dump_head + 1) % in hl_debugfs_set_state_dump()
1921 ARRAY_SIZE(dev_entry->state_dump); in hl_debugfs_set_state_dump()
1922 vfree(dev_entry->state_dump[dev_entry->state_dump_head]); in hl_debugfs_set_state_dump()
1923 dev_entry->state_dump[dev_entry->state_dump_head] = data; in hl_debugfs_set_state_dump()
1925 up_write(&dev_entry->state_dump_sem); in hl_debugfs_set_state_dump()