[COMMON] fimc-is2: fix prevent defects (CID 237152, 237199)
authorWooyeon Kim <wooy88.kim@samsung.com>
Wed, 8 Aug 2018 04:19:53 +0000 (13:19 +0900)
committerhskang <hs1218.kang@samsung.com>
Tue, 14 Aug 2018 01:14:18 +0000 (21:14 -0400)
 PR JIRA ID: CPR-139

Change-Id: I5fb7a834b8e414829230a45de26455d7715b25e5
Signed-off-by: Wooyeon Kim <wooy88.kim@samsung.com>
drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.c

index 59c4954b3eb1c3df14b401d00472f974a9ff64cb..98beabd3c57edbd0d6cba901b81d634513a64cd3 100644 (file)
@@ -107,9 +107,6 @@ static int fimc_is_hw_mcsc_handle_interrupt(u32 id, void *context)
 
                if (hw_ip->cur_e_int >= hw_ip->num_buffers) {
                        fimc_is_hw_mcsc_frame_done(hw_ip, NULL, IS_SHOT_SUCCESS);
-                       dbg_isr("[F:%d][S-E] %05llu us\n", hw_ip, hw_fcount,
-                               (hw_ip->debug_info[index].time[DEBUG_POINT_FRAME_END] -
-                               hw_ip->debug_info[index].time[DEBUG_POINT_FRAME_START]) / 1000);
 
                        if (!atomic_read(&hardware->streaming[hardware->sensor_position[instance]]))
                                sinfo_hw("[F:%d]F.E\n", hw_ip, hw_fcount);
@@ -226,6 +223,9 @@ struct fimc_is_hw_ip *get_mcsc_hw_ip(struct fimc_is_hw_ip *hw_ip)
        int hw_slot = -1;
        u32 hw_id;
 
+       if (!hw_ip)
+               return NULL;
+
        switch (hw_ip->id) {
        case DEV_HW_MCSC0:
                hw_id = DEV_HW_MCSC1;
@@ -1343,6 +1343,10 @@ void fimc_is_hw_mcsc_frame_done(struct fimc_is_hw_ip *hw_ip, struct fimc_is_fram
        hw_ip->debug_info[index].cpuid[dbg_pt] = raw_smp_processor_id();
        hw_ip->debug_info[index].time[dbg_pt] = cpu_clock(raw_smp_processor_id());
 
+       dbg_isr("[F:%d][S-E] %05llu us\n", hw_ip, atomic_read(&hw_ip->fcount),
+               (hw_ip->debug_info[index].time[dbg_pt] -
+               hw_ip->debug_info[index].time[DEBUG_POINT_FRAME_START]) / 1000);
+
        if (!flag_get_meta)
                atomic_inc(&hw_ip->count.dma);