Skip to content

Commit 02e92ea

Browse files
Dikshita AgarwalHans Verkuil
authored andcommitted
media: venus: avoid multiple core dumps
Core dump is generated whenever there is system error reported by firmware. Right now, multiple such dumps are generated if recovery fails in first attempt, since the sys error handler is invoked again for every failed recovery. To avoid it, add conditional check to generate core dump only once during every system error notification from firmware. Signed-off-by: Dikshita Agarwal <[email protected]> Reviewed-by: Bryan O'Donoghue <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: document new dump_core field]
1 parent e750a4b commit 02e92ea

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

drivers/media/platform/qcom/venus/core.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ static void venus_event_notify(struct venus_core *core, u32 event)
6868

6969
mutex_lock(&core->lock);
7070
set_bit(0, &core->sys_error);
71+
set_bit(0, &core->dump_core);
7172
list_for_each_entry(inst, &core->instances, list)
7273
inst->ops->event_notify(inst, EVT_SESSION_ERROR, NULL);
7374
mutex_unlock(&core->lock);
@@ -110,7 +111,10 @@ static void venus_sys_error_handler(struct work_struct *work)
110111

111112
venus_shutdown(core);
112113

113-
venus_coredump(core);
114+
if (test_bit(0, &core->dump_core)) {
115+
venus_coredump(core);
116+
clear_bit(0, &core->dump_core);
117+
}
114118

115119
pm_runtime_put_sync(core->dev);
116120

drivers/media/platform/qcom/venus/core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ struct venus_format {
169169
* @core1_usage_count: usage counter for core1
170170
* @root: debugfs root directory
171171
* @venus_ver: the venus firmware version
172+
* @dump_core: a flag indicating that a core dump is required
172173
*/
173174
struct venus_core {
174175
void __iomem *base;
@@ -232,6 +233,7 @@ struct venus_core {
232233
u32 minor;
233234
u32 rev;
234235
} venus_ver;
236+
unsigned long dump_core;
235237
};
236238

237239
struct vdec_controls {

0 commit comments

Comments
 (0)