Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4e6cc44 authored by Yiduo Wang's avatar Yiduo Wang
Browse files

msm: camera: Make wait functions in camera driver not interruptible



With interruptible wait, when system goes into suspend, the wait
returns with ERESTARTSYS. This code path may cause camera daemon
to run away due to bad state.

Change-Id: I01bc47918e553cee1c8ef497ebef032dd5f2ba0e
Signed-off-by: default avatarYiduo Wang <yiduow@codeaurora.org>
parent 2d3171d7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -694,7 +694,7 @@ static long msm_vfe40_reset_hardware(struct vfe_device *vfe_dev,


	if (blocking_call) {
		rc = wait_for_completion_interruptible_timeout(
		rc = wait_for_completion_timeout(
			&vfe_dev->reset_complete, msecs_to_jiffies(50));
	}
	return rc;
+2 −2
Original line number Diff line number Diff line
@@ -552,7 +552,7 @@ static long msm_vfe44_reset_hardware(struct vfe_device *vfe_dev,
	}

	if (blocking_call) {
		rc = wait_for_completion_interruptible_timeout(
		rc = wait_for_completion_timeout(
			&vfe_dev->reset_complete, msecs_to_jiffies(50));
		if (rc <= 0) {
			pr_err("%s:%d failed: reset timeout\n", __func__,
@@ -1272,7 +1272,7 @@ static int msm_vfe44_axi_halt(struct vfe_device *vfe_dev,
		init_completion(&vfe_dev->halt_complete);
		/* Halt AXI Bus Bridge */
		msm_camera_io_w_mb(0x1, vfe_dev->vfe_base + 0x2C0);
		rc = wait_for_completion_interruptible_timeout(
		rc = wait_for_completion_timeout(
			&vfe_dev->halt_complete, msecs_to_jiffies(500));
	} else {
		/* Halt AXI Bus Bridge */
+2 −2
Original line number Diff line number Diff line
@@ -501,7 +501,7 @@ static long msm_vfe46_reset_hardware(struct vfe_device *vfe_dev,
	}

	if (blocking_call) {
		rc = wait_for_completion_interruptible_timeout(
		rc = wait_for_completion_timeout(
			&vfe_dev->reset_complete, msecs_to_jiffies(50));
		if (rc <= 0) {
			pr_err("%s:%d failed: reset timeout\n", __func__,
@@ -1235,7 +1235,7 @@ static int msm_vfe46_axi_halt(struct vfe_device *vfe_dev,
		init_completion(&vfe_dev->halt_complete);
		/* Halt AXI Bus Bridge */
		msm_camera_io_w_mb(0x1, vfe_dev->vfe_base + 0x374);
		rc = wait_for_completion_interruptible_timeout(
		rc = wait_for_completion_timeout(
			&vfe_dev->halt_complete, msecs_to_jiffies(500));
	} else {
		/* Halt AXI Bus Bridge */
+2 −2
Original line number Diff line number Diff line
@@ -499,7 +499,7 @@ static long msm_vfe47_reset_hardware(struct vfe_device *vfe_dev,
	}

	if (blocking_call) {
		rc = wait_for_completion_interruptible_timeout(
		rc = wait_for_completion_timeout(
			&vfe_dev->reset_complete, msecs_to_jiffies(50));
		if (rc <= 0) {
			pr_err("%s:%d failed: reset timeout\n", __func__,
@@ -1079,7 +1079,7 @@ static int msm_vfe47_axi_halt(struct vfe_device *vfe_dev,
		init_completion(&vfe_dev->halt_complete);
		/* Halt AXI Bus Bridge */
		msm_camera_io_w_mb(0x1, vfe_dev->vfe_base + 0x374);
		rc = wait_for_completion_interruptible_timeout(
		rc = wait_for_completion_timeout(
			&vfe_dev->halt_complete, msecs_to_jiffies(500));
	} else {
		/* Halt AXI Bus Bridge */
+2 −2
Original line number Diff line number Diff line
@@ -838,7 +838,7 @@ static int msm_ispif_restart_frame_boundary(struct ispif_device *ispif,
	}

	if (vfe_mask & (1 << VFE0)) {
		timeout = wait_for_completion_interruptible_timeout(
		timeout = wait_for_completion_timeout(
			&ispif->reset_complete[VFE0], msecs_to_jiffies(500));
		if (timeout <= 0) {
			pr_err("%s: VFE0 reset wait timeout\n", __func__);
@@ -848,7 +848,7 @@ static int msm_ispif_restart_frame_boundary(struct ispif_device *ispif,
	}

	if (ispif->hw_num_isps > 1  && (vfe_mask & (1 << VFE1))) {
		timeout = wait_for_completion_interruptible_timeout(
		timeout = wait_for_completion_timeout(
				&ispif->reset_complete[VFE1],
				msecs_to_jiffies(500));
		if (timeout <= 0) {
Loading