From a49c5efc5cfc97d0b6ecdb5447021d3f45a12eb4 Mon Sep 17 00:00:00 2001 From: Dohyun Kim Date: Sun, 24 Mar 2019 19:51:18 +0900 Subject: [PATCH] [COMMON] fimc-is2: change normal spin_lock to spin_lock_irqsave PR JIRA ID: CPR-863 Change-Id: I36667a8cd4c1765745f4e75c221f29397b9127ef Signed-off-by: Dohyun Kim --- .../exynos/fimc-is2/fimc-is-device-csi_v4.c | 20 +++++++++++-------- .../fimc-is2/fimc-is-device-sensor_v2.c | 17 +++++++++------- .../pafstat/fimc-is-pafstat.c | 5 +++-- .../sensor/module_framework/pdp/fimc-is-pdp.c | 5 +++-- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi_v4.c b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi_v4.c index 1db3380db143..f5eb8c9d3a77 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi_v4.c +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi_v4.c @@ -226,6 +226,7 @@ static void csis_s_vc_dma_multibuf(struct fimc_is_device_csi *csi) struct fimc_is_subdev *dma_subdev; struct fimc_is_framemgr *framemgr; struct fimc_is_frame *frame; + unsigned long flags; /* dma setting for several virtual ch 1 ~ 3 */ for (vc = CSI_VIRTUAL_CH_1; vc < CSI_VIRTUAL_CH_MAX; vc++) { @@ -244,7 +245,7 @@ static void csis_s_vc_dma_multibuf(struct fimc_is_device_csi *csi) if (test_bit((CSIS_SET_MULTIBUF_VC1 + (vc - 1)), &csi->state)) continue; - framemgr_e_barrier(framemgr, 0); + framemgr_e_barrier_irqs(framemgr, 0, flags); for (i = 0; i < framemgr->num_frames; i++) { frame = &framemgr->frames[i]; csi_s_multibuf_addr(csi, frame, i, vc); @@ -252,7 +253,7 @@ static void csis_s_vc_dma_multibuf(struct fimc_is_device_csi *csi) trans_frame(framemgr, frame, FS_FREE); } - framemgr_x_barrier(framemgr, 0); + framemgr_x_barrier_irqr(framemgr, 0, flags); set_bit((CSIS_SET_MULTIBUF_VC1 + (vc - 1)), &csi->state); } @@ -264,6 +265,7 @@ static void csis_check_vc_dma_buf(struct fimc_is_device_csi *csi) struct fimc_is_framemgr *framemgr; struct fimc_is_frame *frame; struct fimc_is_subdev *dma_subdev; + unsigned long flags; /* default disable dma setting for several virtual ch 0 ~ 3 */ for (vc = CSI_VIRTUAL_CH_0; vc < CSI_VIRTUAL_CH_MAX; vc++) { @@ -276,7 +278,7 @@ static void csis_check_vc_dma_buf(struct fimc_is_device_csi *csi) continue; framemgr = GET_SUBDEV_FRAMEMGR(dma_subdev); - framemgr_e_barrier(framemgr, 0); + framemgr_e_barrier_irqs(framemgr, 0, flags); if (likely(framemgr)) { /* process to NDONE if set to bad frame */ if (framemgr->queued_count[FS_PROCESS]) { @@ -319,7 +321,7 @@ static void csis_check_vc_dma_buf(struct fimc_is_device_csi *csi) merr("[VC%d] framemgr is NULL", csi, vc); } - framemgr_x_barrier(framemgr, 0); + framemgr_x_barrier_irqr(framemgr, 0, flags); } } @@ -335,6 +337,7 @@ static void csis_flush_vc_buf_done(struct fimc_is_device_csi *csi, u32 vc, struct fimc_is_frame *frame; struct fimc_is_video_ctx *vctx; u32 findex; + unsigned long flags; device = container_of(csi->subdev, struct fimc_is_device_sensor, subdev_csi); @@ -354,7 +357,7 @@ static void csis_flush_vc_buf_done(struct fimc_is_device_csi *csi, u32 vc, FIMC_BUG_VOID(!ldr_framemgr); FIMC_BUG_VOID(!framemgr); - framemgr_e_barrier(framemgr, 0); + framemgr_e_barrier_irqs(framemgr, 0, flags); frame = peek_frame(framemgr, target); while (frame) { @@ -369,7 +372,7 @@ static void csis_flush_vc_buf_done(struct fimc_is_device_csi *csi, u32 vc, frame = peek_frame(framemgr, target); } - framemgr_x_barrier(framemgr, 0); + framemgr_x_barrier_irqr(framemgr, 0, flags); } static void csis_flush_vc_multibuf(struct fimc_is_device_csi *csi, u32 vc) @@ -378,6 +381,7 @@ static void csis_flush_vc_multibuf(struct fimc_is_device_csi *csi, u32 vc) struct fimc_is_subdev *subdev; struct fimc_is_framemgr *framemgr; struct fimc_is_frame *frame; + unsigned long flags; subdev = csi->dma_subdev[vc]; @@ -390,7 +394,7 @@ static void csis_flush_vc_multibuf(struct fimc_is_device_csi *csi, u32 vc) framemgr = GET_SUBDEV_FRAMEMGR(subdev); if (framemgr) { - framemgr_e_barrier(framemgr, 0); + framemgr_e_barrier_irqs(framemgr, 0, flags); for (i = 0; i < framemgr->num_frames; i++) { frame = &framemgr->frames[i]; @@ -399,7 +403,7 @@ static void csis_flush_vc_multibuf(struct fimc_is_device_csi *csi, u32 vc) trans_frame(framemgr, frame, FS_FREE); } } - framemgr_x_barrier(framemgr, 0); + framemgr_x_barrier_irqr(framemgr, 0, flags); } clear_bit((CSIS_SET_MULTIBUF_VC1 + (vc - 1)), &csi->state); diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c index 0f074b97f261..06a0377ed677 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c @@ -1073,6 +1073,7 @@ static int fimc_is_sensor_notify_by_fstr(struct fimc_is_device_sensor *device, v struct fimc_is_subdev *dma_subdev; struct v4l2_control ctrl; u32 frameptr; + unsigned long flags; #if defined(MEASURE_TIME) && defined(MONITOR_TIME) struct fimc_is_group *group; #endif @@ -1125,14 +1126,14 @@ static int fimc_is_sensor_notify_by_fstr(struct fimc_is_device_sensor *device, v continue; } - framemgr_e_barrier(framemgr, 0); + framemgr_e_barrier_irqs(framemgr, 0, flags); if (test_bit(FIMC_IS_SUBDEV_INTERNAL_USE, &dma_subdev->state)) { ctrl.id = V4L2_CID_IS_G_VC1_FRAMEPTR + (i - 1); ret = v4l2_subdev_call(device->subdev_csi, core, g_ctrl, &ctrl); if (ret) { err("csi_g_ctrl fail"); - framemgr_x_barrier(framemgr, 0); + framemgr_x_barrier_irqr(framemgr, 0, flags); return -EINVAL; } frameptr = (ctrl.value + dma_subdev->vc_buffer_offset) % framemgr->num_frames; @@ -1143,7 +1144,7 @@ static int fimc_is_sensor_notify_by_fstr(struct fimc_is_device_sensor *device, v i, frameptr, frame->fcount); } - framemgr_x_barrier(framemgr, 0); + framemgr_x_barrier_irqr(framemgr, 0, flags); } return ret; @@ -1159,6 +1160,7 @@ static int fimc_is_sensor_notify_by_fend(struct fimc_is_device_sensor *device, v struct fimc_is_group *group; struct fimc_is_framemgr *framemgr; struct fimc_is_video_ctx *vctx; + unsigned long flags; FIMC_BUG(!device); @@ -1184,7 +1186,7 @@ static int fimc_is_sensor_notify_by_fend(struct fimc_is_device_sensor *device, v vctx = group->head->leader.vctx; - framemgr_e_barrier(framemgr, 0); + framemgr_e_barrier_irqs(framemgr, 0, flags); frame = peek_frame(framemgr, FS_PROCESS); /* @@ -1221,7 +1223,7 @@ static int fimc_is_sensor_notify_by_fend(struct fimc_is_device_sensor *device, v CALL_VOPS(vctx, done, frame->index, done_state); } - framemgr_x_barrier(framemgr, 0); + framemgr_x_barrier_irqr(framemgr, 0, flags); p_err: return ret; @@ -1277,6 +1279,7 @@ static int fimc_is_sensor_notify_by_line(struct fimc_is_device_sensor *device, struct fimc_is_group *group; struct fimc_is_framemgr *framemgr; struct fimc_is_frame *frame; + unsigned long flags; FIMC_BUG(!device); @@ -1286,9 +1289,9 @@ static int fimc_is_sensor_notify_by_line(struct fimc_is_device_sensor *device, framemgr = GET_SUBDEV_FRAMEMGR(&group->head->leader); FIMC_BUG(!framemgr); - framemgr_e_barrier(framemgr, 0); + framemgr_e_barrier_irqs(framemgr, 0, flags); frame = find_frame(framemgr, FS_PROCESS, frame_fcount, (void *)(ulong)device->line_fcount); - framemgr_x_barrier(framemgr, 0); + framemgr_x_barrier_irqr(framemgr, 0, flags); /* There's no shot */ if (!frame || diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/pafstat/fimc-is-pafstat.c b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/pafstat/fimc-is-pafstat.c index 963af5b7feeb..8f67d88df356 100644 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/pafstat/fimc-is-pafstat.c +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/pafstat/fimc-is-pafstat.c @@ -196,6 +196,7 @@ static void pafstat_tasklet_fwin_stat(unsigned long data) struct fimc_is_frame *frame; unsigned int frameptr; int ch; + unsigned long flags; pafstat = (struct fimc_is_pafstat *)data; if (!pafstat) { @@ -231,7 +232,7 @@ static void pafstat_tasklet_fwin_stat(unsigned long data) continue; } - framemgr_e_barrier(framemgr, FMGR_IDX_29); + framemgr_e_barrier_irqs(framemgr, FMGR_IDX_29, flags); frameptr = atomic_read(&pafstat->frameptr_fwin_stat) % framemgr->num_frames; frame = &framemgr->frames[frameptr]; @@ -242,7 +243,7 @@ static void pafstat_tasklet_fwin_stat(unsigned long data) atomic_inc(&pafstat->frameptr_fwin_stat); - framemgr_x_barrier(framemgr, FMGR_IDX_29); + framemgr_x_barrier_irqr(framemgr, FMGR_IDX_29, flags); } } diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/pdp/fimc-is-pdp.c b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/pdp/fimc-is-pdp.c index 444d092201d9..226e7cbd84b2 100644 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/pdp/fimc-is-pdp.c +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/pdp/fimc-is-pdp.c @@ -74,6 +74,7 @@ static void pdp_tasklet_stat0(unsigned long data) struct fimc_is_frame *frame; unsigned int frameptr; int ch; + unsigned long flags; pdp = (struct fimc_is_pdp *)data; if (!pdp) { @@ -109,7 +110,7 @@ static void pdp_tasklet_stat0(unsigned long data) continue; } - framemgr_e_barrier(framemgr, FMGR_IDX_29); + framemgr_e_barrier_irqs(framemgr, FMGR_IDX_29, flags); frameptr = atomic_read(&pdp->frameptr_stat0) % framemgr->num_frames; frame = &framemgr->frames[frameptr]; @@ -120,7 +121,7 @@ static void pdp_tasklet_stat0(unsigned long data) atomic_inc(&pdp->frameptr_stat0); - framemgr_x_barrier(framemgr, FMGR_IDX_29); + framemgr_x_barrier_irqr(framemgr, FMGR_IDX_29, flags); } } -- 2.20.1