mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-27 06:50:37 +00:00

Introduce a heartbeat-based Timeout Detection and Recovery (TDR) mechanism. The enhancement aims to improve the reliability of device hang detection by monitoring heartbeat updates. Each progressing inference will update heartbeat counter allowing driver to monitor its progression. Limit maximum number of reschedules when heartbeat indicates progression to 30. This increases the maximum running time of single inference to about 60 seconds. The heartbeat mechanism provides a more robust method for detecting device hangs, potentially reducing false positive recoveries due to long running inferences. Signed-off-by: Karol Wachowski <karol.wachowski@intel.com> Signed-off-by: Maciej Falkowski <maciej.falkowski@linux.intel.com> Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Link: https://lore.kernel.org/r/20250416102555.384526-1-maciej.falkowski@linux.intel.com
56 lines
1.3 KiB
C
56 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) 2020-2024 Intel Corporation
|
|
*/
|
|
|
|
#ifndef __IVPU_FW_H__
|
|
#define __IVPU_FW_H__
|
|
|
|
#include "vpu_jsm_api.h"
|
|
|
|
#define FW_VERSION_HEADER_SIZE SZ_4K
|
|
#define FW_VERSION_STR_SIZE SZ_256
|
|
|
|
struct ivpu_device;
|
|
struct ivpu_bo;
|
|
struct vpu_boot_params;
|
|
|
|
struct ivpu_fw_info {
|
|
const struct firmware *file;
|
|
const char *name;
|
|
char version[FW_VERSION_STR_SIZE];
|
|
struct ivpu_bo *mem;
|
|
struct ivpu_bo *mem_shave_nn;
|
|
struct ivpu_bo *mem_log_crit;
|
|
struct ivpu_bo *mem_log_verb;
|
|
u64 runtime_addr;
|
|
u32 runtime_size;
|
|
u64 image_load_offset;
|
|
u32 image_size;
|
|
u32 shave_nn_size;
|
|
u64 entry_point; /* Cold or warm boot entry point for next boot */
|
|
u64 cold_boot_entry_point;
|
|
u32 trace_level;
|
|
u32 trace_destination_mask;
|
|
u64 trace_hw_component_mask;
|
|
u32 dvfs_mode;
|
|
u32 primary_preempt_buf_size;
|
|
u32 secondary_preempt_buf_size;
|
|
u64 read_only_addr;
|
|
u32 read_only_size;
|
|
u32 sched_mode;
|
|
u64 last_heartbeat;
|
|
};
|
|
|
|
int ivpu_fw_init(struct ivpu_device *vdev);
|
|
void ivpu_fw_fini(struct ivpu_device *vdev);
|
|
void ivpu_fw_load(struct ivpu_device *vdev);
|
|
void ivpu_fw_boot_params_setup(struct ivpu_device *vdev, struct vpu_boot_params *bp);
|
|
|
|
static inline bool ivpu_fw_is_cold_boot(struct ivpu_device *vdev)
|
|
{
|
|
return vdev->fw->entry_point == vdev->fw->cold_boot_entry_point;
|
|
}
|
|
|
|
#endif /* __IVPU_FW_H__ */
|