提交 7296e25f 编写于 作者: K Kamil Debski 提交者: Mauro Carvalho Chehab

[media] s5p-mfc: Fix interrupt error handling routine

New context states were added but handling in s5p_mfc_handle_error for
these states was not. After this patch these states are be handled
correctly.
Signed-off-by: NKamil Debski <k.debski@samsung.com>
Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 a26860bd
...@@ -412,62 +412,48 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx, ...@@ -412,62 +412,48 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx,
} }
/* Error handling for interrupt */ /* Error handling for interrupt */
static void s5p_mfc_handle_error(struct s5p_mfc_ctx *ctx, static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev,
unsigned int reason, unsigned int err) struct s5p_mfc_ctx *ctx, unsigned int reason, unsigned int err)
{ {
struct s5p_mfc_dev *dev;
unsigned long flags; unsigned long flags;
/* If no context is available then all necessary
* processing has been done. */
if (ctx == NULL)
return;
dev = ctx->dev;
mfc_err("Interrupt Error: %08x\n", err); mfc_err("Interrupt Error: %08x\n", err);
s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
wake_up_dev(dev, reason, err);
/* Error recovery is dependent on the state of context */ if (ctx != NULL) {
switch (ctx->state) { /* Error recovery is dependent on the state of context */
case MFCINST_INIT: switch (ctx->state) {
/* This error had to happen while acquireing instance */ case MFCINST_RES_CHANGE_INIT:
case MFCINST_GOT_INST: case MFCINST_RES_CHANGE_FLUSH:
/* This error had to happen while parsing the header */ case MFCINST_RES_CHANGE_END:
case MFCINST_HEAD_PARSED: case MFCINST_FINISHING:
/* This error had to happen while setting dst buffers */ case MFCINST_FINISHED:
case MFCINST_RETURN_INST: case MFCINST_RUNNING:
/* This error had to happen while releasing instance */ /* It is higly probable that an error occured
clear_work_bit(ctx); * while decoding a frame */
wake_up_ctx(ctx, reason, err); clear_work_bit(ctx);
if (test_and_clear_bit(0, &dev->hw_lock) == 0) ctx->state = MFCINST_ERROR;
BUG(); /* Mark all dst buffers as having an error */
s5p_mfc_clock_off(); spin_lock_irqsave(&dev->irqlock, flags);
ctx->state = MFCINST_ERROR; s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue,
break; &ctx->dst_queue, &ctx->vq_dst);
case MFCINST_FINISHING: /* Mark all src buffers as having an error */
case MFCINST_FINISHED: s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue,
case MFCINST_RUNNING: &ctx->src_queue, &ctx->vq_src);
/* It is higly probable that an error occured spin_unlock_irqrestore(&dev->irqlock, flags);
* while decoding a frame */ wake_up_ctx(ctx, reason, err);
clear_work_bit(ctx); break;
ctx->state = MFCINST_ERROR; default:
/* Mark all dst buffers as having an error */ clear_work_bit(ctx);
spin_lock_irqsave(&dev->irqlock, flags); ctx->state = MFCINST_ERROR;
s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue, &ctx->dst_queue, wake_up_ctx(ctx, reason, err);
&ctx->vq_dst); break;
/* Mark all src buffers as having an error */ }
s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue, &ctx->src_queue,
&ctx->vq_src);
spin_unlock_irqrestore(&dev->irqlock, flags);
if (test_and_clear_bit(0, &dev->hw_lock) == 0)
BUG();
s5p_mfc_clock_off();
break;
default:
mfc_err("Encountered an error interrupt which had not been handled\n");
break;
} }
if (test_and_clear_bit(0, &dev->hw_lock) == 0)
BUG();
s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
s5p_mfc_clock_off();
wake_up_dev(dev, reason, err);
return; return;
} }
...@@ -632,7 +618,7 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv) ...@@ -632,7 +618,7 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv)
dev->warn_start) dev->warn_start)
s5p_mfc_handle_frame(ctx, reason, err); s5p_mfc_handle_frame(ctx, reason, err);
else else
s5p_mfc_handle_error(ctx, reason, err); s5p_mfc_handle_error(dev, ctx, reason, err);
clear_bit(0, &dev->enter_suspend); clear_bit(0, &dev->enter_suspend);
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册