diff options
author | Koji Matsuoka <koji.matsuoka.xm@renesas.com> | 2015-03-29 09:04:56 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-27 14:41:22 -0400 |
commit | 5a9b06a27db6b006605421658418fb8943a6e217 (patch) | |
tree | 3db9f6a36e293581a32707925e6a82cf0849bfc5 /drivers/media | |
parent | 2a700d8edffdbfb8200332d96c3147e042b337f1 (diff) |
[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: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/soc_camera/rcar_vin.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index 9351f64dee7b..6460f8e1b07f 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c | |||
@@ -135,6 +135,8 @@ | |||
135 | #define VIN_MAX_WIDTH 2048 | 135 | #define VIN_MAX_WIDTH 2048 |
136 | #define VIN_MAX_HEIGHT 2048 | 136 | #define VIN_MAX_HEIGHT 2048 |
137 | 137 | ||
138 | #define TIMEOUT_MS 100 | ||
139 | |||
138 | enum chip_id { | 140 | enum chip_id { |
139 | RCAR_GEN2, | 141 | RCAR_GEN2, |
140 | RCAR_H1, | 142 | RCAR_H1, |
@@ -820,7 +822,10 @@ static void rcar_vin_wait_stop_streaming(struct rcar_vin_priv *priv) | |||
820 | if (priv->state == STOPPING) { | 822 | if (priv->state == STOPPING) { |
821 | priv->request_to_stop = true; | 823 | priv->request_to_stop = true; |
822 | spin_unlock_irq(&priv->lock); | 824 | spin_unlock_irq(&priv->lock); |
823 | wait_for_completion(&priv->capture_stop); | 825 | if (!wait_for_completion_timeout( |
826 | &priv->capture_stop, | ||
827 | msecs_to_jiffies(TIMEOUT_MS))) | ||
828 | priv->state = STOPPED; | ||
824 | spin_lock_irq(&priv->lock); | 829 | spin_lock_irq(&priv->lock); |
825 | } | 830 | } |
826 | } | 831 | } |