]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: venus: avoid multiple core dumps
authorDikshita Agarwal <quic_dikshita@quicinc.com>
Wed, 6 Mar 2024 05:53:26 +0000 (11:23 +0530)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Sun, 30 Jun 2024 09:22:44 +0000 (11:22 +0200)
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 <quic_dikshita@quicinc.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: document new dump_core field]

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

index ce206b70975418200bc6b20f463258dcb35494c7..af8890fd6ec27a4c3c3a403dfc89c443f34a9d8e 100644 (file)
@@ -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);
 
index 6a77de3744543132bfdb538b3c465cae6bd7e550..55202b89e1b9fcdd9aa9dc8299f74a62de252c59 100644 (file)
@@ -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 {