Lines Matching refs:dev_entry
114 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in command_buffers_show() local
118 spin_lock(&dev_entry->cb_spinlock); in command_buffers_show()
120 list_for_each_entry(cb, &dev_entry->cb_list, debugfs_list) { in command_buffers_show()
134 spin_unlock(&dev_entry->cb_spinlock); in command_buffers_show()
145 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in command_submission_show() local
149 spin_lock(&dev_entry->cs_spinlock); in command_submission_show()
151 list_for_each_entry(cs, &dev_entry->cs_list, debugfs_list) { in command_submission_show()
165 spin_unlock(&dev_entry->cs_spinlock); in command_submission_show()
176 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in command_submission_jobs_show() local
180 spin_lock(&dev_entry->cs_job_spinlock); in command_submission_jobs_show()
182 list_for_each_entry(job, &dev_entry->cs_job_list, debugfs_list) { in command_submission_jobs_show()
202 spin_unlock(&dev_entry->cs_job_spinlock); in command_submission_jobs_show()
213 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in userptr_show() local
219 spin_lock(&dev_entry->userptr_spinlock); in userptr_show()
221 list_for_each_entry(userptr, &dev_entry->userptr_list, debugfs_list) { in userptr_show()
233 spin_unlock(&dev_entry->userptr_spinlock); in userptr_show()
244 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in vm_show() local
258 mutex_lock(&dev_entry->ctx_mem_hash_mutex); in vm_show()
260 list_for_each_entry(ctx, &dev_entry->ctx_mem_hash_list, debugfs_list) { in vm_show()
329 mutex_unlock(&dev_entry->ctx_mem_hash_mutex); in vm_show()
331 ctx = hl_get_compute_ctx(dev_entry->hdev); in vm_show()
359 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in userptr_lookup_show() local
367 spin_lock(&dev_entry->userptr_spinlock); in userptr_lookup_show()
369 list_for_each_entry(userptr, &dev_entry->userptr_list, debugfs_list) { in userptr_lookup_show()
370 if (dev_entry->userptr_lookup >= userptr->addr && in userptr_lookup_show()
371 dev_entry->userptr_lookup < userptr->addr + userptr->size) { in userptr_lookup_show()
380 if (dev_entry->userptr_lookup >= sg_start && in userptr_lookup_show()
381 dev_entry->userptr_lookup < sg_end) { in userptr_lookup_show()
382 dma_addr += (dev_entry->userptr_lookup - in userptr_lookup_show()
391 dev_entry->userptr_lookup, in userptr_lookup_show()
400 spin_unlock(&dev_entry->userptr_spinlock); in userptr_lookup_show()
413 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in userptr_lookup_write() local
421 dev_entry->userptr_lookup = value; in userptr_lookup_write()
429 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in mmu_show() local
430 struct hl_device *hdev = dev_entry->hdev; in mmu_show()
433 u64 virt_addr = dev_entry->mmu_addr, phys_addr; in mmu_show()
436 if (dev_entry->mmu_asid == HL_KERNEL_ASID_ID) in mmu_show()
455 (dev_entry->mmu_addr != hops_info.scrambled_vaddr)) in mmu_show()
458 dev_entry->mmu_asid, dev_entry->mmu_addr, in mmu_show()
464 dev_entry->mmu_asid, dev_entry->mmu_addr, phys_addr); in mmu_show()
476 if (dev_entry->mmu_asid != HL_KERNEL_ASID_ID) in mmu_show()
487 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in mmu_asid_va_write() local
488 struct hl_device *hdev = dev_entry->hdev; in mmu_asid_va_write()
504 rc = kstrtouint(kbuf, 10, &dev_entry->mmu_asid); in mmu_asid_va_write()
510 rc = kstrtoull(c+3, 16, &dev_entry->mmu_addr); in mmu_asid_va_write()
525 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in mmu_ack_error() local
526 struct hl_device *hdev = dev_entry->hdev; in mmu_ack_error()
529 if (!dev_entry->mmu_cap_mask) { in mmu_ack_error()
534 rc = hdev->asic_funcs->ack_mmu_errors(hdev, dev_entry->mmu_cap_mask); in mmu_ack_error()
549 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in mmu_ack_error_value_write() local
550 struct hl_device *hdev = dev_entry->hdev; in mmu_ack_error_value_write()
565 rc = kstrtoull(kbuf, 16, &dev_entry->mmu_cap_mask); in mmu_ack_error_value_write()
579 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in engines_show() local
580 struct hl_device *hdev = dev_entry->hdev; in engines_show()
1565 static void add_secured_nodes(struct hl_dbg_device_entry *dev_entry, struct dentry *root) in add_secured_nodes() argument
1570 &dev_entry->i2c_bus); in add_secured_nodes()
1575 &dev_entry->i2c_addr); in add_secured_nodes()
1580 &dev_entry->i2c_reg); in add_secured_nodes()
1585 &dev_entry->i2c_len); in add_secured_nodes()
1590 dev_entry, in add_secured_nodes()
1596 dev_entry, in add_secured_nodes()
1602 dev_entry, in add_secured_nodes()
1608 dev_entry, in add_secured_nodes()
1612 static void add_files_to_device(struct hl_device *hdev, struct hl_dbg_device_entry *dev_entry, in add_files_to_device() argument
1627 dev_entry, in add_files_to_device()
1633 &dev_entry->addr); in add_files_to_device()
1638 dev_entry, in add_files_to_device()
1644 dev_entry, in add_files_to_device()
1650 dev_entry, in add_files_to_device()
1656 dev_entry, in add_files_to_device()
1662 dev_entry, in add_files_to_device()
1668 dev_entry, in add_files_to_device()
1674 dev_entry, in add_files_to_device()
1680 dev_entry, in add_files_to_device()
1686 dev_entry, in add_files_to_device()
1692 &dev_entry->data_dma_blob_desc); in add_files_to_device()
1697 dev_entry, in add_files_to_device()
1703 &dev_entry->mon_dump_blob_desc); in add_files_to_device()
1713 dev_entry, in add_files_to_device()
1719 dev_entry, in add_files_to_device()
1727 for (i = 0, entry = dev_entry->entry_arr ; i < count ; i++, entry++) { in add_files_to_device()
1734 entry->dev_entry = dev_entry; in add_files_to_device()
1740 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_device_init() local
1743 dev_entry->hdev = hdev; in hl_debugfs_device_init()
1744 dev_entry->entry_arr = kmalloc_array(count, sizeof(struct hl_debugfs_entry), GFP_KERNEL); in hl_debugfs_device_init()
1745 if (!dev_entry->entry_arr) in hl_debugfs_device_init()
1748 dev_entry->data_dma_blob_desc.size = 0; in hl_debugfs_device_init()
1749 dev_entry->data_dma_blob_desc.data = NULL; in hl_debugfs_device_init()
1750 dev_entry->mon_dump_blob_desc.size = 0; in hl_debugfs_device_init()
1751 dev_entry->mon_dump_blob_desc.data = NULL; in hl_debugfs_device_init()
1753 INIT_LIST_HEAD(&dev_entry->file_list); in hl_debugfs_device_init()
1754 INIT_LIST_HEAD(&dev_entry->cb_list); in hl_debugfs_device_init()
1755 INIT_LIST_HEAD(&dev_entry->cs_list); in hl_debugfs_device_init()
1756 INIT_LIST_HEAD(&dev_entry->cs_job_list); in hl_debugfs_device_init()
1757 INIT_LIST_HEAD(&dev_entry->userptr_list); in hl_debugfs_device_init()
1758 INIT_LIST_HEAD(&dev_entry->ctx_mem_hash_list); in hl_debugfs_device_init()
1759 mutex_init(&dev_entry->file_mutex); in hl_debugfs_device_init()
1760 init_rwsem(&dev_entry->state_dump_sem); in hl_debugfs_device_init()
1761 spin_lock_init(&dev_entry->cb_spinlock); in hl_debugfs_device_init()
1762 spin_lock_init(&dev_entry->cs_spinlock); in hl_debugfs_device_init()
1763 spin_lock_init(&dev_entry->cs_job_spinlock); in hl_debugfs_device_init()
1764 spin_lock_init(&dev_entry->userptr_spinlock); in hl_debugfs_device_init()
1765 mutex_init(&dev_entry->ctx_mem_hash_mutex); in hl_debugfs_device_init()
1789 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_device() local
1791 dev_entry->root = debugfs_create_dir(dev_name(hdev->dev), hl_debug_root); in hl_debugfs_add_device()
1793 add_files_to_device(hdev, dev_entry, dev_entry->root); in hl_debugfs_add_device()
1795 add_secured_nodes(dev_entry, dev_entry->root); in hl_debugfs_add_device()
1807 struct hl_dbg_device_entry *dev_entry = &hpriv->hdev->hl_debugfs; in hl_debugfs_add_file() local
1809 mutex_lock(&dev_entry->file_mutex); in hl_debugfs_add_file()
1810 list_add(&hpriv->debugfs_list, &dev_entry->file_list); in hl_debugfs_add_file()
1811 mutex_unlock(&dev_entry->file_mutex); in hl_debugfs_add_file()
1816 struct hl_dbg_device_entry *dev_entry = &hpriv->hdev->hl_debugfs; in hl_debugfs_remove_file() local
1818 mutex_lock(&dev_entry->file_mutex); in hl_debugfs_remove_file()
1820 mutex_unlock(&dev_entry->file_mutex); in hl_debugfs_remove_file()
1825 struct hl_dbg_device_entry *dev_entry = &cb->hdev->hl_debugfs; in hl_debugfs_add_cb() local
1827 spin_lock(&dev_entry->cb_spinlock); in hl_debugfs_add_cb()
1828 list_add(&cb->debugfs_list, &dev_entry->cb_list); in hl_debugfs_add_cb()
1829 spin_unlock(&dev_entry->cb_spinlock); in hl_debugfs_add_cb()
1834 struct hl_dbg_device_entry *dev_entry = &cb->hdev->hl_debugfs; in hl_debugfs_remove_cb() local
1836 spin_lock(&dev_entry->cb_spinlock); in hl_debugfs_remove_cb()
1838 spin_unlock(&dev_entry->cb_spinlock); in hl_debugfs_remove_cb()
1843 struct hl_dbg_device_entry *dev_entry = &cs->ctx->hdev->hl_debugfs; in hl_debugfs_add_cs() local
1845 spin_lock(&dev_entry->cs_spinlock); in hl_debugfs_add_cs()
1846 list_add(&cs->debugfs_list, &dev_entry->cs_list); in hl_debugfs_add_cs()
1847 spin_unlock(&dev_entry->cs_spinlock); in hl_debugfs_add_cs()
1852 struct hl_dbg_device_entry *dev_entry = &cs->ctx->hdev->hl_debugfs; in hl_debugfs_remove_cs() local
1854 spin_lock(&dev_entry->cs_spinlock); in hl_debugfs_remove_cs()
1856 spin_unlock(&dev_entry->cs_spinlock); in hl_debugfs_remove_cs()
1861 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_job() local
1863 spin_lock(&dev_entry->cs_job_spinlock); in hl_debugfs_add_job()
1864 list_add(&job->debugfs_list, &dev_entry->cs_job_list); in hl_debugfs_add_job()
1865 spin_unlock(&dev_entry->cs_job_spinlock); in hl_debugfs_add_job()
1870 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_remove_job() local
1872 spin_lock(&dev_entry->cs_job_spinlock); in hl_debugfs_remove_job()
1874 spin_unlock(&dev_entry->cs_job_spinlock); in hl_debugfs_remove_job()
1879 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_userptr() local
1881 spin_lock(&dev_entry->userptr_spinlock); in hl_debugfs_add_userptr()
1882 list_add(&userptr->debugfs_list, &dev_entry->userptr_list); in hl_debugfs_add_userptr()
1883 spin_unlock(&dev_entry->userptr_spinlock); in hl_debugfs_add_userptr()
1889 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_remove_userptr() local
1891 spin_lock(&dev_entry->userptr_spinlock); in hl_debugfs_remove_userptr()
1893 spin_unlock(&dev_entry->userptr_spinlock); in hl_debugfs_remove_userptr()
1898 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_ctx_mem_hash() local
1900 mutex_lock(&dev_entry->ctx_mem_hash_mutex); in hl_debugfs_add_ctx_mem_hash()
1901 list_add(&ctx->debugfs_list, &dev_entry->ctx_mem_hash_list); in hl_debugfs_add_ctx_mem_hash()
1902 mutex_unlock(&dev_entry->ctx_mem_hash_mutex); in hl_debugfs_add_ctx_mem_hash()
1907 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_remove_ctx_mem_hash() local
1909 mutex_lock(&dev_entry->ctx_mem_hash_mutex); in hl_debugfs_remove_ctx_mem_hash()
1911 mutex_unlock(&dev_entry->ctx_mem_hash_mutex); in hl_debugfs_remove_ctx_mem_hash()
1924 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_set_state_dump() local
1926 down_write(&dev_entry->state_dump_sem); in hl_debugfs_set_state_dump()
1928 dev_entry->state_dump_head = (dev_entry->state_dump_head + 1) % in hl_debugfs_set_state_dump()
1929 ARRAY_SIZE(dev_entry->state_dump); in hl_debugfs_set_state_dump()
1930 vfree(dev_entry->state_dump[dev_entry->state_dump_head]); in hl_debugfs_set_state_dump()
1931 dev_entry->state_dump[dev_entry->state_dump_head] = data; in hl_debugfs_set_state_dump()
1933 up_write(&dev_entry->state_dump_sem); in hl_debugfs_set_state_dump()