[COMMON] fimc-is2: Modify a use tasklet and function
authordan huh <dan.huh@samsung.com>
Tue, 10 Jul 2018 03:40:12 +0000 (12:40 +0900)
committerJungi Lee <jungilsi.lee@samsung.com>
Tue, 17 Jul 2018 11:10:13 +0000 (20:10 +0900)
- When sensor vc tasklet delayed, already dqbuf group leader
  so access a group leader at tasklet, unable to handle kernel paging

PR JIRA ID: CPR-47

Change-Id: I5fa23a92ce340956f6a71c7aa476c3acf1fc7490
Signed-off-by: dan huh <dan.huh@samsung.com>
drivers/media/platform/exynos/fimc-is2/fimc-is-devicemgr.c

index eacdaa3a3c5f34ceb6e10c6ee0e7c4a25a4efa9f..e92caf6e48fe02de520570cd0925496a86c31b9d 100644 (file)
@@ -279,18 +279,18 @@ int fimc_is_devicemgr_start(struct fimc_is_devicemgr *devicemgr,
 {
        int ret = 0;
        struct fimc_is_group *group = NULL;
-       struct fimc_is_group *child_group;
        struct fimc_is_device_sensor *sensor;
+#ifndef ENABLE_SENSOR_VC_FUNCTION
+       struct fimc_is_group *child_group;
        struct devicemgr_sensor_tag_data *tag_data;
        u32 stream;
+#endif
        int i;
 
        switch (type) {
        case FIMC_IS_DEVICE_SENSOR:
                sensor = (struct fimc_is_device_sensor *)device;
                group = &sensor->group_sensor;
-               child_group = GET_HEAD_GROUP_IN_DEVICE(FIMC_IS_DEVICE_ISCHAIN, group);
-               stream = group->instance;
 
                if (!test_bit(FIMC_IS_SENSOR_STAND_ALONE, &sensor->state) && sensor->ischain) {
                        ret = fimc_is_ischain_start_wrap(sensor->ischain, group);
@@ -308,6 +308,10 @@ int fimc_is_devicemgr_start(struct fimc_is_devicemgr *devicemgr,
                        }
                }
 
+#ifndef ENABLE_SENSOR_VC_FUNCTION
+               child_group = GET_HEAD_GROUP_IN_DEVICE(FIMC_IS_DEVICE_ISCHAIN, group);
+               stream = group->instance;
+
                /* Only in case of OTF case, used tasklet. */
                if (sensor->ischain && child_group) {
                        for (i = 0; i < TAG_DATA_MAX; i++) {
@@ -315,6 +319,7 @@ int fimc_is_devicemgr_start(struct fimc_is_devicemgr *devicemgr,
                                tasklet_init(&devicemgr->tasklet_sensor_tag[stream][i], tasklet_sensor_tag, (unsigned long)tag_data);
                        }
                }
+#endif
                break;
        case FIMC_IS_DEVICE_ISCHAIN:
                break;
@@ -333,21 +338,25 @@ int fimc_is_devicemgr_stop(struct fimc_is_devicemgr *devicemgr,
 {
        int ret = 0;
        struct fimc_is_group *group = NULL;
-       struct fimc_is_group *child_group;
        struct fimc_is_device_sensor *sensor;
+#ifndef ENABLE_SENSOR_VC_FUNCTION
+       struct fimc_is_group *child_group;
        u32 stream;
+#endif
        int i;
 
        switch (type) {
        case FIMC_IS_DEVICE_SENSOR:
                sensor = (struct fimc_is_device_sensor *)device;
                group = &sensor->group_sensor;
+#ifndef ENABLE_SENSOR_VC_FUNCTION
                child_group = GET_HEAD_GROUP_IN_DEVICE(FIMC_IS_DEVICE_ISCHAIN, group);
                stream = group->instance;
 
                if (sensor->ischain && child_group)
                        for (i = 0; i < TAG_DATA_MAX; i++)
                                tasklet_kill(&devicemgr->tasklet_sensor_tag[stream][i]);
+#endif
 
                if (!test_bit(FIMC_IS_SENSOR_STAND_ALONE, &sensor->state) && sensor->ischain) {
                        ret = fimc_is_ischain_stop_wrap(sensor->ischain, group);
@@ -475,7 +484,11 @@ int fimc_is_devicemgr_shot_callback(struct fimc_is_group *group,
                        group->head->device_type == FIMC_IS_DEVICE_SENSOR) {
                        mgrdbgs(1, " DEVICE TASKLET(%d) schedule\n", group->device, group,
                                                                frame, index);
+#ifndef ENABLE_SENSOR_VC_FUNCTION
                        tasklet_schedule(&devicemgr->tasklet_sensor_tag[stream][index]);
+#else
+                       tasklet_sensor_tag((unsigned long)tag_data);
+#endif
                }
                break;
        default: