diff options
| author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-05-25 15:51:30 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-05-25 15:51:30 -0700 |
| commit | 8d009ce8adf37fa87ef2bad2d4e156a304254b6b (patch) | |
| tree | 53f83f58b46f300ca3e56f5fec7a493d186f3d88 | |
| parent | 09db61a0c013524c690b7b9c2147f9b9510a676d (diff) | |
| parent | cc12a0966bc5bbdafc5abace2279b4397dacb997 (diff) | |
Merge "msm: camera: isp : Fix race condition in close sequence"
| -rw-r--r-- | drivers/media/platform/msm/camera_v2/isp/msm_isp.c | 1 | ||||
| -rw-r--r-- | drivers/media/platform/msm/camera_v2/isp/msm_isp.h | 1 | ||||
| -rw-r--r-- | drivers/media/platform/msm/camera_v2/isp/msm_isp47.c | 7 |
3 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp.c index 737433209c2b..23f936258660 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp.c +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp.c @@ -638,6 +638,7 @@ int vfe_hw_probe(struct platform_device *pdev) spin_lock_init(&vfe_dev->shared_data_lock); spin_lock_init(&vfe_dev->reg_update_lock); spin_lock_init(&req_history_lock); + spin_lock_init(&vfe_dev->completion_lock); media_entity_init(&vfe_dev->subdev.sd.entity, 0, NULL, 0); vfe_dev->subdev.sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV; vfe_dev->subdev.sd.entity.group_id = MSM_CAMERA_SUBDEV_VFE; diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp.h b/drivers/media/platform/msm/camera_v2/isp/msm_isp.h index f37e183e35de..d64cee834bea 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp.h +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp.h @@ -795,6 +795,7 @@ struct vfe_device { struct mutex core_mutex; spinlock_t shared_data_lock; spinlock_t reg_update_lock; + spinlock_t completion_lock; /* Tasklet info */ atomic_t irq_cnt; diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c index b80ef1dc900b..03d1b3c22d61 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c @@ -437,9 +437,13 @@ void msm_vfe47_clear_status_reg(struct vfe_device *vfe_dev) void msm_vfe47_process_reset_irq(struct vfe_device *vfe_dev, uint32_t irq_status0, uint32_t irq_status1) { + unsigned long flags; + if (irq_status0 & (1 << 31)) { + spin_lock_irqsave(&vfe_dev->completion_lock, flags); complete(&vfe_dev->reset_complete); vfe_dev->reset_pending = 0; + spin_unlock_irqrestore(&vfe_dev->completion_lock, flags); } } @@ -750,8 +754,11 @@ long msm_vfe47_reset_hardware(struct vfe_device *vfe_dev, { long rc = 0; uint32_t reset; + unsigned long flags; + spin_lock_irqsave(&vfe_dev->completion_lock, flags); init_completion(&vfe_dev->reset_complete); + spin_unlock_irqrestore(&vfe_dev->completion_lock, flags); if (blocking_call) vfe_dev->reset_pending = 1; |
