Files
android_kernel_samsung_sm86…/driver/vidc/inc/venus_hfi_response.h
Govindaraj Rajagopal ae4e77ad42 video: driver: fix deadlock issue with response workqueue
Both &inst->stats_work and &inst->response_work both were using
&inst->response_workq for scheduling works. From reverse thread
handle_session_response_work_handler incremented refcount via
get_inst_ref(), at the same time driverfd got closed by HAL.
So strongref is held by handle_session_response_work_handler and
as part of put_inst(refcount is zero), will attempt to destry
&inst->response_workq inside msm_vidc_close_helper.

destroy_workqueue() call will wait until all already fired events
to complete, which will never happen in this case i.e leading to
deadlock situation. It is an attempt to self destruction, which is
not allowed.

Added changes to avoid above mentioned situation.

Change-Id: Ieb26a4b02f87f2bb738027cfd16e4c261b756dc3
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-01-13 17:29:22 +05:30

29 lines
988 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2020-2021,, The Linux Foundation. All rights reserved.
*/
#ifndef __VENUS_HFI_RESPONSE_H__
#define __VENUS_HFI_RESPONSE_H__
#include "hfi_packet.h"
int handle_response(struct msm_vidc_core *core,
void *response);
int validate_packet(u8 *response_pkt, u8 *core_resp_pkt,
u32 core_resp_pkt_size, const char *func);
bool is_valid_port(struct msm_vidc_inst *inst, u32 port,
const char *func);
bool is_valid_hfi_buffer_type(struct msm_vidc_inst *inst,
u32 buffer_type, const char *func);
void handle_session_response_work_handler(struct work_struct *work);
int handle_session_response_work(struct msm_vidc_inst *inst,
struct response_work *work);
int cancel_response_work(struct msm_vidc_inst *inst);
int cancel_response_work_sync(struct msm_vidc_inst *inst);
int handle_system_error(struct msm_vidc_core *core,
struct hfi_packet *pkt);
void fw_coredump(struct msm_vidc_core *core);
#endif // __VENUS_HFI_RESPONSE_H__