Lines Matching refs:dev_entry

102 	struct hl_dbg_device_entry *dev_entry = entry->dev_entry;  in command_buffers_show()  local
106 spin_lock(&dev_entry->cb_spinlock); in command_buffers_show()
108 list_for_each_entry(cb, &dev_entry->cb_list, debugfs_list) { in command_buffers_show()
122 spin_unlock(&dev_entry->cb_spinlock); in command_buffers_show()
133 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in command_submission_show() local
137 spin_lock(&dev_entry->cs_spinlock); in command_submission_show()
139 list_for_each_entry(cs, &dev_entry->cs_list, debugfs_list) { in command_submission_show()
153 spin_unlock(&dev_entry->cs_spinlock); in command_submission_show()
164 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in command_submission_jobs_show() local
168 spin_lock(&dev_entry->cs_job_spinlock); in command_submission_jobs_show()
170 list_for_each_entry(job, &dev_entry->cs_job_list, debugfs_list) { in command_submission_jobs_show()
189 spin_unlock(&dev_entry->cs_job_spinlock); in command_submission_jobs_show()
200 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in userptr_show() local
206 spin_lock(&dev_entry->userptr_spinlock); in userptr_show()
208 list_for_each_entry(userptr, &dev_entry->userptr_list, debugfs_list) { in userptr_show()
220 spin_unlock(&dev_entry->userptr_spinlock); in userptr_show()
231 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in vm_show() local
243 if (!dev_entry->hdev->mmu_enable) in vm_show()
246 spin_lock(&dev_entry->ctx_mem_hash_spinlock); in vm_show()
248 list_for_each_entry(ctx, &dev_entry->ctx_mem_hash_list, debugfs_list) { in vm_show()
315 spin_unlock(&dev_entry->ctx_mem_hash_spinlock); in vm_show()
326 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in userptr_lookup_show() local
334 spin_lock(&dev_entry->userptr_spinlock); in userptr_lookup_show()
336 list_for_each_entry(userptr, &dev_entry->userptr_list, debugfs_list) { in userptr_lookup_show()
337 if (dev_entry->userptr_lookup >= userptr->addr && in userptr_lookup_show()
338 dev_entry->userptr_lookup < userptr->addr + userptr->size) { in userptr_lookup_show()
348 if (dev_entry->userptr_lookup >= sg_start && in userptr_lookup_show()
349 dev_entry->userptr_lookup < sg_end) { in userptr_lookup_show()
350 dma_addr += (dev_entry->userptr_lookup - in userptr_lookup_show()
359 dev_entry->userptr_lookup, in userptr_lookup_show()
368 spin_unlock(&dev_entry->userptr_spinlock); in userptr_lookup_show()
381 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in userptr_lookup_write() local
389 dev_entry->userptr_lookup = value; in userptr_lookup_write()
397 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in mmu_show() local
398 struct hl_device *hdev = dev_entry->hdev; in mmu_show()
401 u64 virt_addr = dev_entry->mmu_addr, phys_addr; in mmu_show()
407 if (dev_entry->mmu_asid == HL_KERNEL_ASID_ID) in mmu_show()
426 (dev_entry->mmu_addr != hops_info.scrambled_vaddr)) in mmu_show()
429 dev_entry->mmu_asid, dev_entry->mmu_addr, in mmu_show()
435 dev_entry->mmu_asid, dev_entry->mmu_addr, phys_addr); in mmu_show()
454 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in mmu_asid_va_write() local
455 struct hl_device *hdev = dev_entry->hdev; in mmu_asid_va_write()
474 rc = kstrtouint(kbuf, 10, &dev_entry->mmu_asid); in mmu_asid_va_write()
480 rc = kstrtoull(c+3, 16, &dev_entry->mmu_addr); in mmu_asid_va_write()
495 struct hl_dbg_device_entry *dev_entry = entry->dev_entry; in engines_show() local
496 struct hl_device *hdev = dev_entry->hdev; in engines_show()
1329 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_device() local
1334 dev_entry->hdev = hdev; in hl_debugfs_add_device()
1335 dev_entry->entry_arr = kmalloc_array(count, in hl_debugfs_add_device()
1338 if (!dev_entry->entry_arr) in hl_debugfs_add_device()
1341 dev_entry->blob_desc.size = 0; in hl_debugfs_add_device()
1342 dev_entry->blob_desc.data = NULL; in hl_debugfs_add_device()
1344 INIT_LIST_HEAD(&dev_entry->file_list); in hl_debugfs_add_device()
1345 INIT_LIST_HEAD(&dev_entry->cb_list); in hl_debugfs_add_device()
1346 INIT_LIST_HEAD(&dev_entry->cs_list); in hl_debugfs_add_device()
1347 INIT_LIST_HEAD(&dev_entry->cs_job_list); in hl_debugfs_add_device()
1348 INIT_LIST_HEAD(&dev_entry->userptr_list); in hl_debugfs_add_device()
1349 INIT_LIST_HEAD(&dev_entry->ctx_mem_hash_list); in hl_debugfs_add_device()
1350 mutex_init(&dev_entry->file_mutex); in hl_debugfs_add_device()
1351 init_rwsem(&dev_entry->state_dump_sem); in hl_debugfs_add_device()
1352 spin_lock_init(&dev_entry->cb_spinlock); in hl_debugfs_add_device()
1353 spin_lock_init(&dev_entry->cs_spinlock); in hl_debugfs_add_device()
1354 spin_lock_init(&dev_entry->cs_job_spinlock); in hl_debugfs_add_device()
1355 spin_lock_init(&dev_entry->userptr_spinlock); in hl_debugfs_add_device()
1356 spin_lock_init(&dev_entry->ctx_mem_hash_spinlock); in hl_debugfs_add_device()
1358 dev_entry->root = debugfs_create_dir(dev_name(hdev->dev), in hl_debugfs_add_device()
1363 dev_entry->root, in hl_debugfs_add_device()
1364 &dev_entry->addr); in hl_debugfs_add_device()
1368 dev_entry->root, in hl_debugfs_add_device()
1369 dev_entry, in hl_debugfs_add_device()
1374 dev_entry->root, in hl_debugfs_add_device()
1375 dev_entry, in hl_debugfs_add_device()
1380 dev_entry->root, in hl_debugfs_add_device()
1381 dev_entry, in hl_debugfs_add_device()
1386 dev_entry->root, in hl_debugfs_add_device()
1387 &dev_entry->i2c_bus); in hl_debugfs_add_device()
1391 dev_entry->root, in hl_debugfs_add_device()
1392 &dev_entry->i2c_addr); in hl_debugfs_add_device()
1396 dev_entry->root, in hl_debugfs_add_device()
1397 &dev_entry->i2c_reg); in hl_debugfs_add_device()
1401 dev_entry->root, in hl_debugfs_add_device()
1402 dev_entry, in hl_debugfs_add_device()
1407 dev_entry->root, in hl_debugfs_add_device()
1408 dev_entry, in hl_debugfs_add_device()
1413 dev_entry->root, in hl_debugfs_add_device()
1414 dev_entry, in hl_debugfs_add_device()
1419 dev_entry->root, in hl_debugfs_add_device()
1420 dev_entry, in hl_debugfs_add_device()
1425 dev_entry->root, in hl_debugfs_add_device()
1426 dev_entry, in hl_debugfs_add_device()
1431 dev_entry->root, in hl_debugfs_add_device()
1432 dev_entry, in hl_debugfs_add_device()
1437 dev_entry->root, in hl_debugfs_add_device()
1438 dev_entry, in hl_debugfs_add_device()
1443 dev_entry->root, in hl_debugfs_add_device()
1444 dev_entry, in hl_debugfs_add_device()
1449 dev_entry->root, in hl_debugfs_add_device()
1450 dev_entry, in hl_debugfs_add_device()
1455 dev_entry->root, in hl_debugfs_add_device()
1456 &dev_entry->blob_desc); in hl_debugfs_add_device()
1460 dev_entry->root, in hl_debugfs_add_device()
1465 dev_entry->root, in hl_debugfs_add_device()
1466 dev_entry, in hl_debugfs_add_device()
1471 dev_entry->root, in hl_debugfs_add_device()
1472 dev_entry, in hl_debugfs_add_device()
1475 for (i = 0, entry = dev_entry->entry_arr ; i < count ; i++, entry++) { in hl_debugfs_add_device()
1478 dev_entry->root, in hl_debugfs_add_device()
1482 entry->dev_entry = dev_entry; in hl_debugfs_add_device()
1505 struct hl_dbg_device_entry *dev_entry = &hpriv->hdev->hl_debugfs; in hl_debugfs_add_file() local
1507 mutex_lock(&dev_entry->file_mutex); in hl_debugfs_add_file()
1508 list_add(&hpriv->debugfs_list, &dev_entry->file_list); in hl_debugfs_add_file()
1509 mutex_unlock(&dev_entry->file_mutex); in hl_debugfs_add_file()
1514 struct hl_dbg_device_entry *dev_entry = &hpriv->hdev->hl_debugfs; in hl_debugfs_remove_file() local
1516 mutex_lock(&dev_entry->file_mutex); in hl_debugfs_remove_file()
1518 mutex_unlock(&dev_entry->file_mutex); in hl_debugfs_remove_file()
1523 struct hl_dbg_device_entry *dev_entry = &cb->hdev->hl_debugfs; in hl_debugfs_add_cb() local
1525 spin_lock(&dev_entry->cb_spinlock); in hl_debugfs_add_cb()
1526 list_add(&cb->debugfs_list, &dev_entry->cb_list); in hl_debugfs_add_cb()
1527 spin_unlock(&dev_entry->cb_spinlock); in hl_debugfs_add_cb()
1532 struct hl_dbg_device_entry *dev_entry = &cb->hdev->hl_debugfs; in hl_debugfs_remove_cb() local
1534 spin_lock(&dev_entry->cb_spinlock); in hl_debugfs_remove_cb()
1536 spin_unlock(&dev_entry->cb_spinlock); in hl_debugfs_remove_cb()
1541 struct hl_dbg_device_entry *dev_entry = &cs->ctx->hdev->hl_debugfs; in hl_debugfs_add_cs() local
1543 spin_lock(&dev_entry->cs_spinlock); in hl_debugfs_add_cs()
1544 list_add(&cs->debugfs_list, &dev_entry->cs_list); in hl_debugfs_add_cs()
1545 spin_unlock(&dev_entry->cs_spinlock); in hl_debugfs_add_cs()
1550 struct hl_dbg_device_entry *dev_entry = &cs->ctx->hdev->hl_debugfs; in hl_debugfs_remove_cs() local
1552 spin_lock(&dev_entry->cs_spinlock); in hl_debugfs_remove_cs()
1554 spin_unlock(&dev_entry->cs_spinlock); in hl_debugfs_remove_cs()
1559 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_job() local
1561 spin_lock(&dev_entry->cs_job_spinlock); in hl_debugfs_add_job()
1562 list_add(&job->debugfs_list, &dev_entry->cs_job_list); in hl_debugfs_add_job()
1563 spin_unlock(&dev_entry->cs_job_spinlock); in hl_debugfs_add_job()
1568 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_remove_job() local
1570 spin_lock(&dev_entry->cs_job_spinlock); in hl_debugfs_remove_job()
1572 spin_unlock(&dev_entry->cs_job_spinlock); in hl_debugfs_remove_job()
1577 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_userptr() local
1579 spin_lock(&dev_entry->userptr_spinlock); in hl_debugfs_add_userptr()
1580 list_add(&userptr->debugfs_list, &dev_entry->userptr_list); in hl_debugfs_add_userptr()
1581 spin_unlock(&dev_entry->userptr_spinlock); in hl_debugfs_add_userptr()
1587 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_remove_userptr() local
1589 spin_lock(&dev_entry->userptr_spinlock); in hl_debugfs_remove_userptr()
1591 spin_unlock(&dev_entry->userptr_spinlock); in hl_debugfs_remove_userptr()
1596 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_ctx_mem_hash() local
1598 spin_lock(&dev_entry->ctx_mem_hash_spinlock); in hl_debugfs_add_ctx_mem_hash()
1599 list_add(&ctx->debugfs_list, &dev_entry->ctx_mem_hash_list); in hl_debugfs_add_ctx_mem_hash()
1600 spin_unlock(&dev_entry->ctx_mem_hash_spinlock); in hl_debugfs_add_ctx_mem_hash()
1605 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_remove_ctx_mem_hash() local
1607 spin_lock(&dev_entry->ctx_mem_hash_spinlock); in hl_debugfs_remove_ctx_mem_hash()
1609 spin_unlock(&dev_entry->ctx_mem_hash_spinlock); in hl_debugfs_remove_ctx_mem_hash()
1622 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_set_state_dump() local
1624 down_write(&dev_entry->state_dump_sem); in hl_debugfs_set_state_dump()
1626 dev_entry->state_dump_head = (dev_entry->state_dump_head + 1) % in hl_debugfs_set_state_dump()
1627 ARRAY_SIZE(dev_entry->state_dump); in hl_debugfs_set_state_dump()
1628 vfree(dev_entry->state_dump[dev_entry->state_dump_head]); in hl_debugfs_set_state_dump()
1629 dev_entry->state_dump[dev_entry->state_dump_head] = data; in hl_debugfs_set_state_dump()
1631 up_write(&dev_entry->state_dump_sem); in hl_debugfs_set_state_dump()