Skip to content

Commit 1516c55

Browse files
trusinowiczgregkh
authored andcommitted
accel/ivpu: Reset fw log on cold boot
commit 4b4d9e3 upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1c302f6 commit 1516c55

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
@@ -25,6 +25,7 @@ extern unsigned int ivpu_fw_log_level;
2525

2626
void ivpu_fw_log_print(struct ivpu_device *vdev, bool only_new_msgs, struct drm_printer *p);
2727
void ivpu_fw_log_clear(struct ivpu_device *vdev);
28+
void ivpu_fw_log_reset(struct ivpu_device *vdev);
2829

2930

3031
#endif /* __IVPU_FW_LOG_H__ */

drivers/accel/ivpu/ivpu_pm.c

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

3939
ivpu_cmdq_reset_all_contexts(vdev);
4040
ivpu_ipc_reset(vdev);
41+
ivpu_fw_log_reset(vdev);
4142
ivpu_fw_load(vdev);
4243
fw->entry_point = fw->cold_boot_entry_point;
4344
}

0 commit comments

Comments
 (0)