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 if (!dev_entry->hdev->mmu_enable) in vm_show()
261 spin_lock(&dev_entry->ctx_mem_hash_spinlock); in vm_show()
263 list_for_each_entry(ctx, &dev_entry->ctx_mem_hash_list, debugfs_list) { in vm_show()
332 spin_unlock(&dev_entry->ctx_mem_hash_spinlock); in vm_show()
334 ctx = hl_get_compute_ctx(dev_entry->hdev); in vm_show()
362 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in userptr_lookup_show() local
370 spin_lock(&dev_entry->userptr_spinlock); in userptr_lookup_show()
372 list_for_each_entry(userptr, &dev_entry->userptr_list, debugfs_list) { in userptr_lookup_show()
373 if (dev_entry->userptr_lookup >= userptr->addr && in userptr_lookup_show()
374 dev_entry->userptr_lookup < userptr->addr + userptr->size) { in userptr_lookup_show()
383 if (dev_entry->userptr_lookup >= sg_start && in userptr_lookup_show()
384 dev_entry->userptr_lookup < sg_end) { in userptr_lookup_show()
385 dma_addr += (dev_entry->userptr_lookup - in userptr_lookup_show()
394 dev_entry->userptr_lookup, in userptr_lookup_show()
403 spin_unlock(&dev_entry->userptr_spinlock); in userptr_lookup_show()
416 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in userptr_lookup_write() local
424 dev_entry->userptr_lookup = value; in userptr_lookup_write()
432 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in mmu_show() local
433 struct hl_device *hdev = dev_entry->hdev; in mmu_show()
436 u64 virt_addr = dev_entry->mmu_addr, phys_addr; in mmu_show()
442 if (dev_entry->mmu_asid == HL_KERNEL_ASID_ID) in mmu_show()
461 (dev_entry->mmu_addr != hops_info.scrambled_vaddr)) in mmu_show()
464 dev_entry->mmu_asid, dev_entry->mmu_addr, in mmu_show()
470 dev_entry->mmu_asid, dev_entry->mmu_addr, phys_addr); in mmu_show()
482 if (dev_entry->mmu_asid != HL_KERNEL_ASID_ID) in mmu_show()
493 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in mmu_asid_va_write() local
494 struct hl_device *hdev = dev_entry->hdev; in mmu_asid_va_write()
513 rc = kstrtouint(kbuf, 10, &dev_entry->mmu_asid); in mmu_asid_va_write()
519 rc = kstrtoull(c+3, 16, &dev_entry->mmu_addr); in mmu_asid_va_write()
534 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in mmu_ack_error() local
535 struct hl_device *hdev = dev_entry->hdev; in mmu_ack_error()
541 if (!dev_entry->mmu_cap_mask) { in mmu_ack_error()
546 rc = hdev->asic_funcs->ack_mmu_errors(hdev, dev_entry->mmu_cap_mask); in mmu_ack_error()
561 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in mmu_ack_error_value_write() local
562 struct hl_device *hdev = dev_entry->hdev; in mmu_ack_error_value_write()
580 rc = kstrtoull(kbuf, 16, &dev_entry->mmu_cap_mask); in mmu_ack_error_value_write()
594 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in engines_show() local
595 struct hl_device *hdev = dev_entry->hdev; in engines_show()
1586 static void add_secured_nodes(struct hl_dbg_device_entry *dev_entry) in add_secured_nodes() argument
1590 dev_entry->root, in add_secured_nodes()
1591 &dev_entry->i2c_bus); in add_secured_nodes()
1595 dev_entry->root, in add_secured_nodes()
1596 &dev_entry->i2c_addr); in add_secured_nodes()
1600 dev_entry->root, in add_secured_nodes()
1601 &dev_entry->i2c_reg); in add_secured_nodes()
1605 dev_entry->root, in add_secured_nodes()
1606 &dev_entry->i2c_len); in add_secured_nodes()
1610 dev_entry->root, in add_secured_nodes()
1611 dev_entry, in add_secured_nodes()
1616 dev_entry->root, in add_secured_nodes()
1617 dev_entry, in add_secured_nodes()
1622 dev_entry->root, in add_secured_nodes()
1623 dev_entry, in add_secured_nodes()
1628 dev_entry->root, in add_secured_nodes()
1629 dev_entry, in add_secured_nodes()
1635 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_device() local
1640 dev_entry->hdev = hdev; in hl_debugfs_add_device()
1641 dev_entry->entry_arr = kmalloc_array(count, in hl_debugfs_add_device()
1644 if (!dev_entry->entry_arr) in hl_debugfs_add_device()
1647 dev_entry->data_dma_blob_desc.size = 0; in hl_debugfs_add_device()
1648 dev_entry->data_dma_blob_desc.data = NULL; in hl_debugfs_add_device()
1649 dev_entry->mon_dump_blob_desc.size = 0; in hl_debugfs_add_device()
1650 dev_entry->mon_dump_blob_desc.data = NULL; in hl_debugfs_add_device()
1652 INIT_LIST_HEAD(&dev_entry->file_list); in hl_debugfs_add_device()
1653 INIT_LIST_HEAD(&dev_entry->cb_list); in hl_debugfs_add_device()
1654 INIT_LIST_HEAD(&dev_entry->cs_list); in hl_debugfs_add_device()
1655 INIT_LIST_HEAD(&dev_entry->cs_job_list); in hl_debugfs_add_device()
1656 INIT_LIST_HEAD(&dev_entry->userptr_list); in hl_debugfs_add_device()
1657 INIT_LIST_HEAD(&dev_entry->ctx_mem_hash_list); in hl_debugfs_add_device()
1658 mutex_init(&dev_entry->file_mutex); in hl_debugfs_add_device()
1659 init_rwsem(&dev_entry->state_dump_sem); in hl_debugfs_add_device()
1660 spin_lock_init(&dev_entry->cb_spinlock); in hl_debugfs_add_device()
1661 spin_lock_init(&dev_entry->cs_spinlock); in hl_debugfs_add_device()
1662 spin_lock_init(&dev_entry->cs_job_spinlock); in hl_debugfs_add_device()
1663 spin_lock_init(&dev_entry->userptr_spinlock); in hl_debugfs_add_device()
1664 spin_lock_init(&dev_entry->ctx_mem_hash_spinlock); in hl_debugfs_add_device()
1666 dev_entry->root = debugfs_create_dir(dev_name(hdev->dev), in hl_debugfs_add_device()
1671 dev_entry->root, in hl_debugfs_add_device()
1676 dev_entry->root, in hl_debugfs_add_device()
1677 dev_entry, in hl_debugfs_add_device()
1682 dev_entry->root, in hl_debugfs_add_device()
1683 &dev_entry->addr); in hl_debugfs_add_device()
1687 dev_entry->root, in hl_debugfs_add_device()
1688 dev_entry, in hl_debugfs_add_device()
1693 dev_entry->root, in hl_debugfs_add_device()
1694 dev_entry, in hl_debugfs_add_device()
1699 dev_entry->root, in hl_debugfs_add_device()
1700 dev_entry, in hl_debugfs_add_device()
1705 dev_entry->root, in hl_debugfs_add_device()
1706 dev_entry, in hl_debugfs_add_device()
1711 dev_entry->root, in hl_debugfs_add_device()
1712 dev_entry, in hl_debugfs_add_device()
1717 dev_entry->root, in hl_debugfs_add_device()
1718 dev_entry, in hl_debugfs_add_device()
1723 dev_entry->root, in hl_debugfs_add_device()
1724 dev_entry, in hl_debugfs_add_device()
1729 dev_entry->root, in hl_debugfs_add_device()
1730 dev_entry, in hl_debugfs_add_device()
1735 dev_entry->root, in hl_debugfs_add_device()
1736 dev_entry, in hl_debugfs_add_device()
1741 dev_entry->root, in hl_debugfs_add_device()
1742 &dev_entry->data_dma_blob_desc); in hl_debugfs_add_device()
1746 dev_entry->root, in hl_debugfs_add_device()
1747 dev_entry, in hl_debugfs_add_device()
1752 dev_entry->root, in hl_debugfs_add_device()
1753 &dev_entry->mon_dump_blob_desc); in hl_debugfs_add_device()
1757 dev_entry->root, in hl_debugfs_add_device()
1762 dev_entry->root, in hl_debugfs_add_device()
1763 dev_entry, in hl_debugfs_add_device()
1768 dev_entry->root, in hl_debugfs_add_device()
1769 dev_entry, in hl_debugfs_add_device()
1772 for (i = 0, entry = dev_entry->entry_arr ; i < count ; i++, entry++) { in hl_debugfs_add_device()
1775 dev_entry->root, in hl_debugfs_add_device()
1779 entry->dev_entry = dev_entry; in hl_debugfs_add_device()
1783 add_secured_nodes(dev_entry); in hl_debugfs_add_device()
1806 struct hl_dbg_device_entry *dev_entry = &hpriv->hdev->hl_debugfs; in hl_debugfs_add_file() local
1808 mutex_lock(&dev_entry->file_mutex); in hl_debugfs_add_file()
1809 list_add(&hpriv->debugfs_list, &dev_entry->file_list); in hl_debugfs_add_file()
1810 mutex_unlock(&dev_entry->file_mutex); in hl_debugfs_add_file()
1815 struct hl_dbg_device_entry *dev_entry = &hpriv->hdev->hl_debugfs; in hl_debugfs_remove_file() local
1817 mutex_lock(&dev_entry->file_mutex); in hl_debugfs_remove_file()
1819 mutex_unlock(&dev_entry->file_mutex); in hl_debugfs_remove_file()
1824 struct hl_dbg_device_entry *dev_entry = &cb->hdev->hl_debugfs; in hl_debugfs_add_cb() local
1826 spin_lock(&dev_entry->cb_spinlock); in hl_debugfs_add_cb()
1827 list_add(&cb->debugfs_list, &dev_entry->cb_list); in hl_debugfs_add_cb()
1828 spin_unlock(&dev_entry->cb_spinlock); in hl_debugfs_add_cb()
1833 struct hl_dbg_device_entry *dev_entry = &cb->hdev->hl_debugfs; in hl_debugfs_remove_cb() local
1835 spin_lock(&dev_entry->cb_spinlock); in hl_debugfs_remove_cb()
1837 spin_unlock(&dev_entry->cb_spinlock); in hl_debugfs_remove_cb()
1842 struct hl_dbg_device_entry *dev_entry = &cs->ctx->hdev->hl_debugfs; in hl_debugfs_add_cs() local
1844 spin_lock(&dev_entry->cs_spinlock); in hl_debugfs_add_cs()
1845 list_add(&cs->debugfs_list, &dev_entry->cs_list); in hl_debugfs_add_cs()
1846 spin_unlock(&dev_entry->cs_spinlock); in hl_debugfs_add_cs()
1851 struct hl_dbg_device_entry *dev_entry = &cs->ctx->hdev->hl_debugfs; in hl_debugfs_remove_cs() local
1853 spin_lock(&dev_entry->cs_spinlock); in hl_debugfs_remove_cs()
1855 spin_unlock(&dev_entry->cs_spinlock); in hl_debugfs_remove_cs()
1860 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_job() local
1862 spin_lock(&dev_entry->cs_job_spinlock); in hl_debugfs_add_job()
1863 list_add(&job->debugfs_list, &dev_entry->cs_job_list); in hl_debugfs_add_job()
1864 spin_unlock(&dev_entry->cs_job_spinlock); in hl_debugfs_add_job()
1869 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_remove_job() local
1871 spin_lock(&dev_entry->cs_job_spinlock); in hl_debugfs_remove_job()
1873 spin_unlock(&dev_entry->cs_job_spinlock); in hl_debugfs_remove_job()
1878 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_userptr() local
1880 spin_lock(&dev_entry->userptr_spinlock); in hl_debugfs_add_userptr()
1881 list_add(&userptr->debugfs_list, &dev_entry->userptr_list); in hl_debugfs_add_userptr()
1882 spin_unlock(&dev_entry->userptr_spinlock); in hl_debugfs_add_userptr()
1888 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_remove_userptr() local
1890 spin_lock(&dev_entry->userptr_spinlock); in hl_debugfs_remove_userptr()
1892 spin_unlock(&dev_entry->userptr_spinlock); in hl_debugfs_remove_userptr()
1897 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_ctx_mem_hash() local
1899 spin_lock(&dev_entry->ctx_mem_hash_spinlock); in hl_debugfs_add_ctx_mem_hash()
1900 list_add(&ctx->debugfs_list, &dev_entry->ctx_mem_hash_list); in hl_debugfs_add_ctx_mem_hash()
1901 spin_unlock(&dev_entry->ctx_mem_hash_spinlock); in hl_debugfs_add_ctx_mem_hash()
1906 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_remove_ctx_mem_hash() local
1908 spin_lock(&dev_entry->ctx_mem_hash_spinlock); in hl_debugfs_remove_ctx_mem_hash()
1910 spin_unlock(&dev_entry->ctx_mem_hash_spinlock); in hl_debugfs_remove_ctx_mem_hash()
1923 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_set_state_dump() local
1925 down_write(&dev_entry->state_dump_sem); in hl_debugfs_set_state_dump()
1927 dev_entry->state_dump_head = (dev_entry->state_dump_head + 1) % in hl_debugfs_set_state_dump()
1928 ARRAY_SIZE(dev_entry->state_dump); in hl_debugfs_set_state_dump()
1929 vfree(dev_entry->state_dump[dev_entry->state_dump_head]); in hl_debugfs_set_state_dump()
1930 dev_entry->state_dump[dev_entry->state_dump_head] = data; in hl_debugfs_set_state_dump()
1932 up_write(&dev_entry->state_dump_sem); in hl_debugfs_set_state_dump()