From 61aa24cab89603706cc7e06d9e84df0da4d38b7a Mon Sep 17 00:00:00 2001 From: Eunyoung Lee Date: Thu, 10 May 2018 20:29:49 +0900 Subject: [PATCH] [COMMON] fimc-is2: add child group lock - sync patch : http://12.36.155.73:81/#/c/253798/ Change-Id: If020ed05db46d9ffebf60c6df6d01f8225d1c0ab Signed-off-by: Eunyoung Lee --- .../exynos/fimc-is2/fimc-is-groupmgr.c | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-groupmgr.c b/drivers/media/platform/exynos/fimc-is2/fimc-is-groupmgr.c index ff613501dc66..8141ee3a078a 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-groupmgr.c +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-groupmgr.c @@ -2917,8 +2917,12 @@ int fimc_is_group_shot(struct fimc_is_groupmgr *groupmgr, struct fimc_is_group *gprev, *gnext; struct fimc_is_group_frame *gframe; struct fimc_is_group_task *gtask; + struct fimc_is_group *child; + struct fimc_is_group_task *gtask_child; bool try_sdown = false; bool try_rdown = false; + bool try_gdown[GROUP_ID_MAX] = {false}; + u32 gtask_child_id = 0; FIMC_BUG(!groupmgr); FIMC_BUG(!group); @@ -2974,6 +2978,25 @@ int fimc_is_group_shot(struct fimc_is_groupmgr *groupmgr, /* from ISP-MCSC to ISP-DCP-MCSC group setting change */ fimc_is_groupmgr_votf_change_path(group->vnext, START_VIRTUAL_OTF); + child = group->child; + while (child) { + if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state)) + break; + + gtask_child = &groupmgr->gtask[child->id]; + gtask_child_id = child->id; + child = child->child; + if (!test_bit(FIMC_IS_GTASK_START, >ask_child->state)) + continue; + + ret = down_interruptible(>ask_child->smp_resource); + if (ret) { + mgerr(" down fail(%d) #2", group, group, ret); + goto p_err_ignore; + } + try_gdown[gtask_child_id] = true; + } + if (device->sensor && !test_bit(FIMC_IS_SENSOR_FRONT_START, &device->sensor->state)) { /* * this statement is execued only at initial. @@ -3200,6 +3223,18 @@ p_err_ignore: kthread_queue_work(&vnext_gtask->worker, &vframe->work); } + child = group->child; + while (child) { + if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state)) + break; + + gtask_child = &groupmgr->gtask[child->id]; + if (try_gdown[child->id]) + up(>ask_child->smp_resource); + + child = child->child; + } + if (group->vprev) fimc_is_groupmgr_votf_change_path(group, END_VIRTUAL_OTF); @@ -3227,6 +3262,18 @@ p_err_cancel: kthread_queue_work(&vnext_gtask->worker, &vframe->work); } + child = group->child; + while (child) { + if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state)) + break; + + gtask_child = &groupmgr->gtask[child->id]; + if (try_gdown[child->id]) + up(>ask_child->smp_resource); + + child = child->child; + } + if (group->vprev) fimc_is_groupmgr_votf_change_path(group, END_VIRTUAL_OTF); @@ -3257,6 +3304,7 @@ int fimc_is_group_done(struct fimc_is_groupmgr *groupmgr, struct fimc_is_group *child; #endif ulong flags; + struct fimc_is_group_task *gtask_child; FIMC_BUG(!groupmgr); FIMC_BUG(!group); @@ -3332,6 +3380,19 @@ int fimc_is_group_done(struct fimc_is_groupmgr *groupmgr, spin_unlock_irqrestore(&gframemgr->gframe_slock, flags); } + child = group->child; + while (child) { + if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state)) + break; + + gtask_child = &groupmgr->gtask[child->id]; + child = child->child; + if (!test_bit(FIMC_IS_GTASK_START, >ask_child->state)) + continue; + + up(>ask_child->smp_resource); + } + smp_shot_inc(group); up(>ask->smp_resource); -- 2.20.1