Commit 02e92ea8 authored by Dikshita Agarwal's avatar Dikshita Agarwal Committed by Hans Verkuil

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: default avatarDikshita Agarwal <quic_dikshita@quicinc.com>
Reviewed-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: default avatarStanimir Varbanov <stanimir.k.varbanov@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: document new dump_core field]
parent e750a4b1
......@@ -68,6 +68,7 @@ static void venus_event_notify(struct venus_core *core, u32 event)
mutex_lock(&core->lock);
set_bit(0, &core->sys_error);
set_bit(0, &core->dump_core);
list_for_each_entry(inst, &core->instances, list)
inst->ops->event_notify(inst, EVT_SESSION_ERROR, NULL);
mutex_unlock(&core->lock);
......@@ -110,7 +111,10 @@ static void venus_sys_error_handler(struct work_struct *work)
venus_shutdown(core);
venus_coredump(core);
if (test_bit(0, &core->dump_core)) {
venus_coredump(core);
clear_bit(0, &core->dump_core);
}
pm_runtime_put_sync(core->dev);
......
......@@ -169,6 +169,7 @@ struct venus_format {
* @core1_usage_count: usage counter for core1
* @root: debugfs root directory
* @venus_ver: the venus firmware version
* @dump_core: a flag indicating that a core dump is required
*/
struct venus_core {
void __iomem *base;
......@@ -232,6 +233,7 @@ struct venus_core {
u32 minor;
u32 rev;
} venus_ver;
unsigned long dump_core;
};
struct vdec_controls {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment