Lines Matching +full:sync +full:- +full:active

1 // SPDX-License-Identifier: GPL-2.0
13 * hl_format_as_binary - helper function, format an integer as binary
37 buf_len -= 3; in hl_format_as_binary()
43 bit = n & (1 << (sizeof(n) * BITS_PER_BYTE - 1)); in hl_format_as_binary()
58 * resize_to_fit - helper function, resize buffer to fit given amount of data
79 return -ENOMEM; in resize_to_fit()
89 * hl_snprintf_resize() - print formatted data to buffer, resize as needed
113 return -EINVAL; in hl_snprintf_resize()
116 length = vsnprintf(*buf + *offset, *size - *offset, format, args); in hl_snprintf_resize()
125 length = vsnprintf(*buf + *offset, *size - *offset, format, in hl_snprintf_resize()
136 * hl_sync_engine_to_string - convert engine type enum to string literal
155 * hl_print_resize_sync_engine - helper function, format engine name and ID
174 * hl_state_dump_get_sync_name - transform sync object id to name if available
176 * @sync_id: sync object id
180 * sync objects are named.
184 struct hl_state_dump_specs *sds = &hdev->state_dump_specs; in hl_state_dump_get_sync_name()
187 hash_for_each_possible(sds->so_id_to_str_tb, entry, in hl_state_dump_get_sync_name()
189 if (sync_id == entry->id) in hl_state_dump_get_sync_name()
190 return entry->name; in hl_state_dump_get_sync_name()
196 * hl_state_dump_get_monitor_name - transform monitor object dump to monitor
208 struct hl_state_dump_specs *sds = &hdev->state_dump_specs; in hl_state_dump_get_monitor_name()
211 hash_for_each_possible(sds->monitor_id_to_str_tb, in hl_state_dump_get_monitor_name()
212 entry, node, mon->id) in hl_state_dump_get_monitor_name()
213 if (mon->id == entry->id) in hl_state_dump_get_monitor_name()
214 return entry->name; in hl_state_dump_get_monitor_name()
220 * hl_state_dump_free_sync_to_engine_map - free sync object to engine map
221 * @map: sync object to engine map
231 hash_for_each_safe(map->tb, i, tmp_node, entry, node) { in hl_state_dump_free_sync_to_engine_map()
232 hash_del(&entry->node); in hl_state_dump_free_sync_to_engine_map()
238 * hl_state_dump_get_sync_to_engine - transform sync_id to
240 * @map: sync object to engine map
241 * @sync_id: sync object id
245 * does not cover all possible, it is a best effort sync ids.
252 hash_for_each_possible(map->tb, entry, node, sync_id) in hl_state_dump_get_sync_to_engine()
253 if (entry->sync_id == sync_id) in hl_state_dump_get_sync_to_engine()
259 * hl_state_dump_read_sync_objects - read sync objects array
261 * @index: sync manager block index starting with E_N
267 struct hl_state_dump_specs *sds = &hdev->state_dump_specs; in hl_state_dump_read_sync_objects()
272 base_addr = sds->props[SP_SYNC_OBJ_BASE_ADDR] + in hl_state_dump_read_sync_objects()
273 sds->props[SP_NEXT_SYNC_OBJ_ADDR] * index; in hl_state_dump_read_sync_objects()
275 sync_objects = vmalloc(sds->props[SP_SYNC_OBJ_AMOUNT] * sizeof(u32)); in hl_state_dump_read_sync_objects()
279 for (i = 0; i < sds->props[SP_SYNC_OBJ_AMOUNT]; ++i) in hl_state_dump_read_sync_objects()
286 * hl_state_dump_free_sync_objects - free sync objects array allocated by
288 * @sync_objects: sync objects array
297 * hl_state_dump_print_syncs_single_block - print active sync objects on a
300 * @index: sync manager block index starting with E_N
304 * @map: sync engines names map
313 struct hl_state_dump_specs *sds = &hdev->state_dump_specs; in hl_state_dump_print_syncs_single_block()
318 if (sds->sync_namager_names) { in hl_state_dump_print_syncs_single_block()
321 sds->sync_namager_names[index]); in hl_state_dump_print_syncs_single_block()
328 rc = -ENOMEM; in hl_state_dump_print_syncs_single_block()
332 for (i = 0; i < sds->props[SP_SYNC_OBJ_AMOUNT]; ++i) { in hl_state_dump_print_syncs_single_block()
339 sync_object_addr = sds->props[SP_SYNC_OBJ_BASE_ADDR] + in hl_state_dump_print_syncs_single_block()
340 sds->props[SP_NEXT_SYNC_OBJ_ADDR] * index + in hl_state_dump_print_syncs_single_block()
343 rc = hl_snprintf_resize(buf, size, offset, "sync id: %u", i); in hl_state_dump_print_syncs_single_block()
367 entry->engine_type, in hl_state_dump_print_syncs_single_block()
368 entry->engine_id); in hl_state_dump_print_syncs_single_block()
385 * hl_state_dump_print_syncs - print active sync objects
398 struct hl_state_dump_specs *sds = &hdev->state_dump_specs; in hl_state_dump_print_syncs()
405 return -ENOMEM; in hl_state_dump_print_syncs()
407 rc = sds->funcs.gen_sync_to_engine_map(hdev, map); in hl_state_dump_print_syncs()
411 rc = hl_snprintf_resize(buf, size, offset, "Non zero sync objects:\n"); in hl_state_dump_print_syncs()
415 if (sds->sync_namager_names) { in hl_state_dump_print_syncs()
416 for (index = 0; sds->sync_namager_names[index]; ++index) { in hl_state_dump_print_syncs()
423 for (index = 0; index < sds->props[SP_NUM_CORES]; ++index) { in hl_state_dump_print_syncs()
440 * hl_state_dump_alloc_read_sm_block_monitors - read monitors for a specific
443 * @index: sync manager block index starting with E_N
451 struct hl_state_dump_specs *sds = &hdev->state_dump_specs; in hl_state_dump_alloc_read_sm_block_monitors()
456 monitors = vmalloc(sds->props[SP_MONITORS_AMOUNT] * in hl_state_dump_alloc_read_sm_block_monitors()
461 base_addr = sds->props[SP_NEXT_SYNC_OBJ_ADDR] * index; in hl_state_dump_alloc_read_sm_block_monitors()
463 for (i = 0; i < sds->props[SP_MONITORS_AMOUNT]; ++i) { in hl_state_dump_alloc_read_sm_block_monitors()
466 RREG32(base_addr + sds->props[SP_MON_OBJ_WR_ADDR_LOW] + in hl_state_dump_alloc_read_sm_block_monitors()
470 RREG32(base_addr + sds->props[SP_MON_OBJ_WR_ADDR_HIGH] + in hl_state_dump_alloc_read_sm_block_monitors()
474 RREG32(base_addr + sds->props[SP_MON_OBJ_WR_DATA] + in hl_state_dump_alloc_read_sm_block_monitors()
478 RREG32(base_addr + sds->props[SP_MON_OBJ_ARM_DATA] + in hl_state_dump_alloc_read_sm_block_monitors()
482 RREG32(base_addr + sds->props[SP_MON_OBJ_STATUS] + in hl_state_dump_alloc_read_sm_block_monitors()
490 * hl_state_dump_free_monitors - free the monitors structure
500 * hl_state_dump_print_monitors_single_block - print active monitors on a
503 * @index: sync manager block index starting with E_N
515 struct hl_state_dump_specs *sds = &hdev->state_dump_specs; in hl_state_dump_print_monitors_single_block()
519 if (sds->sync_namager_names) { in hl_state_dump_print_monitors_single_block()
522 sds->sync_namager_names[index]); in hl_state_dump_print_monitors_single_block()
529 rc = -ENOMEM; in hl_state_dump_print_monitors_single_block()
533 for (i = 0; i < sds->props[SP_MONITORS_AMOUNT]; ++i) { in hl_state_dump_print_monitors_single_block()
534 if (!(sds->funcs.monitor_valid(&monitors[i]))) in hl_state_dump_print_monitors_single_block()
538 rc = sds->funcs.print_single_monitor(buf, size, offset, hdev, in hl_state_dump_print_monitors_single_block()
553 * hl_state_dump_print_monitors - print active monitors
565 struct hl_state_dump_specs *sds = &hdev->state_dump_specs; in hl_state_dump_print_monitors()
574 if (sds->sync_namager_names) { in hl_state_dump_print_monitors()
575 for (index = 0; sds->sync_namager_names[index]; ++index) { in hl_state_dump_print_monitors()
582 for (index = 0; index < sds->props[SP_NUM_CORES]; ++index) { in hl_state_dump_print_monitors()
595 * hl_state_dump_print_engine_fences - print active fences for a specific
608 struct hl_state_dump_specs *sds = &hdev->state_dump_specs; in hl_state_dump_print_engine_fences()
614 n_fences = sds->props[SP_NUM_OF_TPC_ENGINES]; in hl_state_dump_print_engine_fences()
615 base_addr = sds->props[SP_TPC0_CMDQ]; in hl_state_dump_print_engine_fences()
616 next_fence = sds->props[SP_NEXT_TPC]; in hl_state_dump_print_engine_fences()
619 n_fences = sds->props[SP_NUM_OF_MME_ENGINES]; in hl_state_dump_print_engine_fences()
620 base_addr = sds->props[SP_MME_CMDQ]; in hl_state_dump_print_engine_fences()
621 next_fence = sds->props[SP_NEXT_MME]; in hl_state_dump_print_engine_fences()
624 n_fences = sds->props[SP_NUM_OF_DMA_ENGINES]; in hl_state_dump_print_engine_fences()
625 base_addr = sds->props[SP_DMA_CMDQ]; in hl_state_dump_print_engine_fences()
626 next_fence = sds->props[SP_DMA_QUEUES_OFFSET]; in hl_state_dump_print_engine_fences()
629 return -EINVAL; in hl_state_dump_print_engine_fences()
632 rc = sds->funcs.print_fences_single_engine( in hl_state_dump_print_engine_fences()
635 sds->props[SP_FENCE0_CNT_OFFSET], in hl_state_dump_print_engine_fences()
637 sds->props[SP_CP_STS_OFFSET], in hl_state_dump_print_engine_fences()
647 * hl_state_dump_print_fences - print active fences
679 * hl_state_dump() - dump system state