Commit 5a9b06a2 authored by Koji Matsuoka's avatar Koji Matsuoka Committed by Mauro Carvalho Chehab

[media] media: soc_camera: rcar_vin: Fix wait_for_completion

When stopping abnormally, a driver can't return from wait_for_completion.
This patch resolved this problem by changing wait_for_completion_timeout
from wait_for_completion.
Signed-off-by: default avatarKoji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: default avatarYoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 2a700d8e
......@@ -135,6 +135,8 @@
#define VIN_MAX_WIDTH 2048
#define VIN_MAX_HEIGHT 2048
#define TIMEOUT_MS 100
enum chip_id {
RCAR_GEN2,
RCAR_H1,
......@@ -820,7 +822,10 @@ static void rcar_vin_wait_stop_streaming(struct rcar_vin_priv *priv)
if (priv->state == STOPPING) {
priv->request_to_stop = true;
spin_unlock_irq(&priv->lock);
wait_for_completion(&priv->capture_stop);
if (!wait_for_completion_timeout(
&priv->capture_stop,
msecs_to_jiffies(TIMEOUT_MS)))
priv->state = STOPPED;
spin_lock_irq(&priv->lock);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment