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()
1284 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_device() local
1289 dev_entry->hdev = hdev; in hl_debugfs_add_device()
1290 dev_entry->entry_arr = kmalloc_array(count, in hl_debugfs_add_device()
1293 if (!dev_entry->entry_arr) in hl_debugfs_add_device()
1296 dev_entry->blob_desc.size = 0; in hl_debugfs_add_device()
1297 dev_entry->blob_desc.data = NULL; in hl_debugfs_add_device()
1299 INIT_LIST_HEAD(&dev_entry->file_list); in hl_debugfs_add_device()
1300 INIT_LIST_HEAD(&dev_entry->cb_list); in hl_debugfs_add_device()
1301 INIT_LIST_HEAD(&dev_entry->cs_list); in hl_debugfs_add_device()
1302 INIT_LIST_HEAD(&dev_entry->cs_job_list); in hl_debugfs_add_device()
1303 INIT_LIST_HEAD(&dev_entry->userptr_list); in hl_debugfs_add_device()
1304 INIT_LIST_HEAD(&dev_entry->ctx_mem_hash_list); in hl_debugfs_add_device()
1305 mutex_init(&dev_entry->file_mutex); in hl_debugfs_add_device()
1306 init_rwsem(&dev_entry->state_dump_sem); in hl_debugfs_add_device()
1307 spin_lock_init(&dev_entry->cb_spinlock); in hl_debugfs_add_device()
1308 spin_lock_init(&dev_entry->cs_spinlock); in hl_debugfs_add_device()
1309 spin_lock_init(&dev_entry->cs_job_spinlock); in hl_debugfs_add_device()
1310 spin_lock_init(&dev_entry->userptr_spinlock); in hl_debugfs_add_device()
1311 spin_lock_init(&dev_entry->ctx_mem_hash_spinlock); in hl_debugfs_add_device()
1313 dev_entry->root = debugfs_create_dir(dev_name(hdev->dev), in hl_debugfs_add_device()
1318 dev_entry->root, in hl_debugfs_add_device()
1319 &dev_entry->addr); in hl_debugfs_add_device()
1323 dev_entry->root, in hl_debugfs_add_device()
1324 dev_entry, in hl_debugfs_add_device()
1329 dev_entry->root, in hl_debugfs_add_device()
1330 dev_entry, in hl_debugfs_add_device()
1335 dev_entry->root, in hl_debugfs_add_device()
1336 dev_entry, in hl_debugfs_add_device()
1341 dev_entry->root, in hl_debugfs_add_device()
1342 &dev_entry->i2c_bus); in hl_debugfs_add_device()
1346 dev_entry->root, in hl_debugfs_add_device()
1347 &dev_entry->i2c_addr); in hl_debugfs_add_device()
1351 dev_entry->root, in hl_debugfs_add_device()
1352 &dev_entry->i2c_reg); in hl_debugfs_add_device()
1356 dev_entry->root, in hl_debugfs_add_device()
1357 dev_entry, in hl_debugfs_add_device()
1362 dev_entry->root, in hl_debugfs_add_device()
1363 dev_entry, 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, in hl_debugfs_add_device()
1392 dev_entry->root, in hl_debugfs_add_device()
1393 dev_entry, in hl_debugfs_add_device()
1398 dev_entry->root, in hl_debugfs_add_device()
1399 dev_entry, in hl_debugfs_add_device()
1404 dev_entry->root, in hl_debugfs_add_device()
1405 dev_entry, in hl_debugfs_add_device()
1410 dev_entry->root, in hl_debugfs_add_device()
1411 &dev_entry->blob_desc); in hl_debugfs_add_device()
1415 dev_entry->root, in hl_debugfs_add_device()
1420 dev_entry->root, in hl_debugfs_add_device()
1421 dev_entry, in hl_debugfs_add_device()
1424 for (i = 0, entry = dev_entry->entry_arr ; i < count ; i++, entry++) { in hl_debugfs_add_device()
1427 dev_entry->root, in hl_debugfs_add_device()
1431 entry->dev_entry = dev_entry; in hl_debugfs_add_device()
1454 struct hl_dbg_device_entry *dev_entry = &hpriv->hdev->hl_debugfs; in hl_debugfs_add_file() local
1456 mutex_lock(&dev_entry->file_mutex); in hl_debugfs_add_file()
1457 list_add(&hpriv->debugfs_list, &dev_entry->file_list); in hl_debugfs_add_file()
1458 mutex_unlock(&dev_entry->file_mutex); in hl_debugfs_add_file()
1463 struct hl_dbg_device_entry *dev_entry = &hpriv->hdev->hl_debugfs; in hl_debugfs_remove_file() local
1465 mutex_lock(&dev_entry->file_mutex); in hl_debugfs_remove_file()
1467 mutex_unlock(&dev_entry->file_mutex); in hl_debugfs_remove_file()
1472 struct hl_dbg_device_entry *dev_entry = &cb->hdev->hl_debugfs; in hl_debugfs_add_cb() local
1474 spin_lock(&dev_entry->cb_spinlock); in hl_debugfs_add_cb()
1475 list_add(&cb->debugfs_list, &dev_entry->cb_list); in hl_debugfs_add_cb()
1476 spin_unlock(&dev_entry->cb_spinlock); in hl_debugfs_add_cb()
1481 struct hl_dbg_device_entry *dev_entry = &cb->hdev->hl_debugfs; in hl_debugfs_remove_cb() local
1483 spin_lock(&dev_entry->cb_spinlock); in hl_debugfs_remove_cb()
1485 spin_unlock(&dev_entry->cb_spinlock); in hl_debugfs_remove_cb()
1490 struct hl_dbg_device_entry *dev_entry = &cs->ctx->hdev->hl_debugfs; in hl_debugfs_add_cs() local
1492 spin_lock(&dev_entry->cs_spinlock); in hl_debugfs_add_cs()
1493 list_add(&cs->debugfs_list, &dev_entry->cs_list); in hl_debugfs_add_cs()
1494 spin_unlock(&dev_entry->cs_spinlock); in hl_debugfs_add_cs()
1499 struct hl_dbg_device_entry *dev_entry = &cs->ctx->hdev->hl_debugfs; in hl_debugfs_remove_cs() local
1501 spin_lock(&dev_entry->cs_spinlock); in hl_debugfs_remove_cs()
1503 spin_unlock(&dev_entry->cs_spinlock); in hl_debugfs_remove_cs()
1508 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_job() local
1510 spin_lock(&dev_entry->cs_job_spinlock); in hl_debugfs_add_job()
1511 list_add(&job->debugfs_list, &dev_entry->cs_job_list); in hl_debugfs_add_job()
1512 spin_unlock(&dev_entry->cs_job_spinlock); in hl_debugfs_add_job()
1517 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_remove_job() local
1519 spin_lock(&dev_entry->cs_job_spinlock); in hl_debugfs_remove_job()
1521 spin_unlock(&dev_entry->cs_job_spinlock); in hl_debugfs_remove_job()
1526 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_userptr() local
1528 spin_lock(&dev_entry->userptr_spinlock); in hl_debugfs_add_userptr()
1529 list_add(&userptr->debugfs_list, &dev_entry->userptr_list); in hl_debugfs_add_userptr()
1530 spin_unlock(&dev_entry->userptr_spinlock); in hl_debugfs_add_userptr()
1536 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_remove_userptr() local
1538 spin_lock(&dev_entry->userptr_spinlock); in hl_debugfs_remove_userptr()
1540 spin_unlock(&dev_entry->userptr_spinlock); in hl_debugfs_remove_userptr()
1545 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_add_ctx_mem_hash() local
1547 spin_lock(&dev_entry->ctx_mem_hash_spinlock); in hl_debugfs_add_ctx_mem_hash()
1548 list_add(&ctx->debugfs_list, &dev_entry->ctx_mem_hash_list); in hl_debugfs_add_ctx_mem_hash()
1549 spin_unlock(&dev_entry->ctx_mem_hash_spinlock); in hl_debugfs_add_ctx_mem_hash()
1554 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_remove_ctx_mem_hash() local
1556 spin_lock(&dev_entry->ctx_mem_hash_spinlock); in hl_debugfs_remove_ctx_mem_hash()
1558 spin_unlock(&dev_entry->ctx_mem_hash_spinlock); in hl_debugfs_remove_ctx_mem_hash()
1571 struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; in hl_debugfs_set_state_dump() local
1573 down_write(&dev_entry->state_dump_sem); in hl_debugfs_set_state_dump()
1575 dev_entry->state_dump_head = (dev_entry->state_dump_head + 1) % in hl_debugfs_set_state_dump()
1576 ARRAY_SIZE(dev_entry->state_dump); in hl_debugfs_set_state_dump()
1577 vfree(dev_entry->state_dump[dev_entry->state_dump_head]); in hl_debugfs_set_state_dump()
1578 dev_entry->state_dump[dev_entry->state_dump_head] = data; in hl_debugfs_set_state_dump()
1580 up_write(&dev_entry->state_dump_sem); in hl_debugfs_set_state_dump()