1
0
Fork 0

LF-561: [8QM_MEK/8QXP_MEK]mxc:vpu_malone:reinit completion before send command

we should reinit the completion before send command
who may trigger the completion,
otherwise it may be reinit after complete in certain timing,
then led to timeout

use private workqueue instead of public workqueue

Signed-off-by: ming_qian <ming.qian@nxp.com>
Acked-by: Shijie Qin <shijie.qin@nxp.com>
5.4-rM2-2.2.x-imx-squashed
ming_qian 2019-12-20 10:20:32 +08:00 committed by Shijie Qin
parent 59bf0914d6
commit 19d577f1f7
2 changed files with 7 additions and 7 deletions

View File

@ -3025,8 +3025,8 @@ static int send_abort_cmd(struct vpu_ctx *ctx)
record_log_info(ctx, LOG_PADDING, 0, 0);
if (size <= 0)
vpu_err("%s(): failed to fill abort padding data\n", __func__);
v4l2_vpu_send_cmd(ctx, ctx->str_index, VID_API_CMD_ABORT, 1, &size);
reinit_completion(&ctx->completion);
v4l2_vpu_send_cmd(ctx, ctx->str_index, VID_API_CMD_ABORT, 1, &size);
if (!wait_for_completion_timeout(&ctx->completion, msecs_to_jiffies(1000))) {
ctx->hang_status = true;
vpu_err("the path id:%d firmware timeout after send VID_API_CMD_ABORT\n",
@ -3048,8 +3048,8 @@ static int send_stop_cmd(struct vpu_ctx *ctx)
ctx->wait_rst_done = true;
vpu_dbg(LVL_BIT_FLOW, "ctx[%d] send STOP CMD\n", ctx->str_index);
v4l2_vpu_send_cmd(ctx, ctx->str_index, VID_API_CMD_STOP, 0, NULL);
reinit_completion(&ctx->stop_cmp);
v4l2_vpu_send_cmd(ctx, ctx->str_index, VID_API_CMD_STOP, 0, NULL);
if (!wait_for_completion_timeout(&ctx->stop_cmp, msecs_to_jiffies(1000))) {
vpu_dec_clear_pending_cmd(ctx);
ctx->hang_status = true;
@ -6131,9 +6131,9 @@ static int swreset_vpu_firmware(struct vpu_dev *dev, u_int32 idx)
dev->firmware_started = false;
kfifo_reset(&dev->mu_msg_fifo);
reinit_completion(&dev->start_cmp);
do_send_cmd_to_firmware(ctx, 0, VID_API_CMD_FIRM_RESET, 0, NULL);
reinit_completion(&dev->start_cmp);
if (!wait_for_completion_timeout(&dev->start_cmp, msecs_to_jiffies(10000))) {
vpu_err("error: %s() fail\n", __func__);
return -1;
@ -6499,7 +6499,7 @@ static void vpu_dec_resume_work(struct vpu_dev *vpudev)
int i;
mutex_lock(&vpudev->dev_mutex);
schedule_work(&vpudev->msg_work);
queue_work(vpudev->workqueue, &vpudev->msg_work);
for (i = 0; i < VPU_MAX_NUM_STREAMS; i++) {
struct vpu_ctx *ctx = vpudev->ctx[i];
@ -6520,8 +6520,8 @@ static int __maybe_unused vpu_suspend(struct device *dev)
if (vpudev->hang_mask != vpudev->instance_mask) {
/*if there is an available device, send snapshot command to firmware*/
v4l2_vpu_send_snapshot(vpudev);
reinit_completion(&vpudev->snap_done_cmp);
v4l2_vpu_send_snapshot(vpudev);
if (!wait_for_completion_timeout(&vpudev->snap_done_cmp, msecs_to_jiffies(1000))) {
vpu_err("error: wait for vpu decoder snapdone event timeout!\n");
ret = -1;
@ -6560,9 +6560,9 @@ static int resume_from_snapshot(struct vpu_dev *vpudev)
{
int ret = 0;
reinit_completion(&vpudev->start_cmp);
enable_csr_reg(vpudev);
/*wait for firmware resotre done*/
reinit_completion(&vpudev->start_cmp);
if (!wait_for_completion_timeout(&vpudev->start_cmp, msecs_to_jiffies(1000))) {
vpu_err("error: wait for vpu decoder resume done timeout!\n");
ret = -1;

View File

@ -31,7 +31,7 @@ static void vpu_mu_inq_msg(struct vpu_dev *dev, void *msg)
return;
}
schedule_work(&dev->msg_work);
queue_work(dev->workqueue, &dev->msg_work);
}
static void vpu_mbox_free(struct vpu_dev *dev)