aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/s5p-mfc
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-01-24 15:49:18 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-01-24 15:49:18 -0500
commita32f7d1ad3744914273c6907204c2ab3b5d496a0 (patch)
tree1c5ae321ee85665707177547c07810ff7e09e1ab /drivers/media/platform/s5p-mfc
parent6b9e50c463efc5c361496ae6a895cc966ff8025b (diff)
parent68d6f84ba0c47e658beff3a4bf0c43acee4b4690 (diff)
Merge branch 'v4l_for_linus' into staging/for_v3.9
* v4l_for_linus: (464 commits) [media] uvcvideo: Set error_idx properly for S_EXT_CTRLS failures [media] uvcvideo: Cleanup leftovers of partial revert [media] uvcvideo: Return -EACCES when trying to set a read-only control Linux 3.8-rc3 mm: reinstante dropped pmd_trans_splitting() check cred: Remove tgcred pointer from struct cred drm/ttm: fix fence locking in ttm_buffer_object_transfer ARM: clps711x: Fix bad merge of clockevents setup ARM: highbank: save and restore L2 cache and GIC on suspend ARM: highbank: add a power request clear ARM: highbank: fix secondary boot and hotplug ARM: highbank: fix typos with hignbank in power request functions ARM: dts: fix highbank cpu mpidr values ARM: dts: add device_type prop to cpu nodes on Calxeda platforms drm/prime: drop reference on imported dma-buf come from gem xen/netfront: improve truesize tracking ARM: mx5: Fix MX53 flexcan2 clock ARM: OMAP2+: am33xx-hwmod: Fix wrongly terminated am33xx_usbss_mpu_irqs array sctp: fix Kconfig bug in default cookie hmac selection EDAC: Cleanup device deregistering path ... Conflicts: drivers/media/pci/dm1105/dm1105.c drivers/media/platform/soc_camera/mx2_camera.c
Diffstat (limited to 'drivers/media/platform/s5p-mfc')
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc.c92
1 files changed, 39 insertions, 53 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index b1d7f9a9b996..6347f09ca783 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -408,62 +408,48 @@ leave_handle_frame:
408} 408}
409 409
410/* Error handling for interrupt */ 410/* Error handling for interrupt */
411static void s5p_mfc_handle_error(struct s5p_mfc_ctx *ctx, 411static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev,
412 unsigned int reason, unsigned int err) 412 struct s5p_mfc_ctx *ctx, unsigned int reason, unsigned int err)
413{ 413{
414 struct s5p_mfc_dev *dev;
415 unsigned long flags; 414 unsigned long flags;
416 415
417 /* If no context is available then all necessary
418 * processing has been done. */
419 if (ctx == NULL)
420 return;
421
422 dev = ctx->dev;
423 mfc_err("Interrupt Error: %08x\n", err); 416 mfc_err("Interrupt Error: %08x\n", err);
424 s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
425 wake_up_dev(dev, reason, err);
426 417
427 /* Error recovery is dependent on the state of context */ 418 if (ctx != NULL) {
428 switch (ctx->state) { 419 /* Error recovery is dependent on the state of context */
429 case MFCINST_INIT: 420 switch (ctx->state) {
430 /* This error had to happen while acquireing instance */ 421 case MFCINST_RES_CHANGE_INIT:
431 case MFCINST_GOT_INST: 422 case MFCINST_RES_CHANGE_FLUSH:
432 /* This error had to happen while parsing the header */ 423 case MFCINST_RES_CHANGE_END:
433 case MFCINST_HEAD_PARSED: 424 case MFCINST_FINISHING:
434 /* This error had to happen while setting dst buffers */ 425 case MFCINST_FINISHED:
435 case MFCINST_RETURN_INST: 426 case MFCINST_RUNNING:
436 /* This error had to happen while releasing instance */ 427 /* It is higly probable that an error occured
437 clear_work_bit(ctx); 428 * while decoding a frame */
438 wake_up_ctx(ctx, reason, err); 429 clear_work_bit(ctx);
439 if (test_and_clear_bit(0, &dev->hw_lock) == 0) 430 ctx->state = MFCINST_ERROR;
440 BUG(); 431 /* Mark all dst buffers as having an error */
441 s5p_mfc_clock_off(); 432 spin_lock_irqsave(&dev->irqlock, flags);
442 ctx->state = MFCINST_ERROR; 433 s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue,
443 break; 434 &ctx->dst_queue, &ctx->vq_dst);
444 case MFCINST_FINISHING: 435 /* Mark all src buffers as having an error */
445 case MFCINST_FINISHED: 436 s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue,
446 case MFCINST_RUNNING: 437 &ctx->src_queue, &ctx->vq_src);
447 /* It is higly probable that an error occured 438 spin_unlock_irqrestore(&dev->irqlock, flags);
448 * while decoding a frame */ 439 wake_up_ctx(ctx, reason, err);
449 clear_work_bit(ctx); 440 break;
450 ctx->state = MFCINST_ERROR; 441 default:
451 /* Mark all dst buffers as having an error */ 442 clear_work_bit(ctx);
452 spin_lock_irqsave(&dev->irqlock, flags); 443 ctx->state = MFCINST_ERROR;
453 s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue, &ctx->dst_queue, 444 wake_up_ctx(ctx, reason, err);
454 &ctx->vq_dst); 445 break;
455 /* Mark all src buffers as having an error */ 446 }
456 s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue, &ctx->src_queue,
457 &ctx->vq_src);
458 spin_unlock_irqrestore(&dev->irqlock, flags);
459 if (test_and_clear_bit(0, &dev->hw_lock) == 0)
460 BUG();
461 s5p_mfc_clock_off();
462 break;
463 default:
464 mfc_err("Encountered an error interrupt which had not been handled\n");
465 break;
466 } 447 }
448 if (test_and_clear_bit(0, &dev->hw_lock) == 0)
449 BUG();
450 s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
451 s5p_mfc_clock_off();
452 wake_up_dev(dev, reason, err);
467 return; 453 return;
468} 454}
469 455
@@ -628,7 +614,7 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv)
628 dev->warn_start) 614 dev->warn_start)
629 s5p_mfc_handle_frame(ctx, reason, err); 615 s5p_mfc_handle_frame(ctx, reason, err);
630 else 616 else
631 s5p_mfc_handle_error(ctx, reason, err); 617 s5p_mfc_handle_error(dev, ctx, reason, err);
632 clear_bit(0, &dev->enter_suspend); 618 clear_bit(0, &dev->enter_suspend);
633 break; 619 break;
634 620
@@ -1246,7 +1232,7 @@ err_res:
1246} 1232}
1247 1233
1248/* Remove the driver */ 1234/* Remove the driver */
1249static int __devexit s5p_mfc_remove(struct platform_device *pdev) 1235static int s5p_mfc_remove(struct platform_device *pdev)
1250{ 1236{
1251 struct s5p_mfc_dev *dev = platform_get_drvdata(pdev); 1237 struct s5p_mfc_dev *dev = platform_get_drvdata(pdev);
1252 1238
@@ -1441,7 +1427,7 @@ static void *mfc_get_drv_data(struct platform_device *pdev)
1441 1427
1442static struct platform_driver s5p_mfc_driver = { 1428static struct platform_driver s5p_mfc_driver = {
1443 .probe = s5p_mfc_probe, 1429 .probe = s5p_mfc_probe,
1444 .remove = __devexit_p(s5p_mfc_remove), 1430 .remove = s5p_mfc_remove,
1445 .id_table = mfc_driver_ids, 1431 .id_table = mfc_driver_ids,
1446 .driver = { 1432 .driver = {
1447 .name = S5P_MFC_NAME, 1433 .name = S5P_MFC_NAME,