Skip to content

Commit 4b4d9e3

Browse files
trusinowiczjlawryno
authored andcommitted
accel/ivpu: Reset fw log on cold boot
Add ivpu_fw_log_reset() that resets the read_index of all FW logs on cold boot so logs are properly read. Signed-off-by: Tomasz Rusinowicz <[email protected]> Reviewed-by: Jacek Lawrynowicz <[email protected]> Reviewed-by: Jeffrey Hugo <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Jacek Lawrynowicz <[email protected]>
1 parent 3a3fb81 commit 4b4d9e3

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

drivers/accel/ivpu/ivpu_fw_log.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,17 @@ void ivpu_fw_log_clear(struct ivpu_device *vdev)
140140
while (fw_log_ptr(vdev, vdev->fw->mem_log_verb, &next, &log_header) == 0)
141141
log_header->read_index = log_header->write_index;
142142
}
143+
144+
void ivpu_fw_log_reset(struct ivpu_device *vdev)
145+
{
146+
struct vpu_tracing_buffer_header *log_header;
147+
u32 next;
148+
149+
next = 0;
150+
while (fw_log_ptr(vdev, vdev->fw->mem_log_crit, &next, &log_header) == 0)
151+
log_header->read_index = 0;
152+
153+
next = 0;
154+
while (fw_log_ptr(vdev, vdev->fw->mem_log_verb, &next, &log_header) == 0)
155+
log_header->read_index = 0;
156+
}

drivers/accel/ivpu/ivpu_fw_log.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ extern unsigned int ivpu_fw_log_level;
2727

2828
void ivpu_fw_log_print(struct ivpu_device *vdev, bool only_new_msgs, struct drm_printer *p);
2929
void ivpu_fw_log_clear(struct ivpu_device *vdev);
30+
void ivpu_fw_log_reset(struct ivpu_device *vdev);
3031

3132
static inline void ivpu_fw_log_dump(struct ivpu_device *vdev)
3233
{

drivers/accel/ivpu/ivpu_pm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ static void ivpu_pm_prepare_cold_boot(struct ivpu_device *vdev)
3737

3838
ivpu_cmdq_reset_all_contexts(vdev);
3939
ivpu_ipc_reset(vdev);
40+
ivpu_fw_log_reset(vdev);
4041
ivpu_fw_load(vdev);
4142
fw->entry_point = fw->cold_boot_entry_point;
4243
}

0 commit comments

Comments
 (0)