|
@@ -514,6 +514,18 @@ static void vsp1_pipeline_run(struct vsp1_pipeline *pipe)
|
|
pipe->buffers_ready = 0;
|
|
pipe->buffers_ready = 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+bool vsp1_pipeline_stopped(struct vsp1_pipeline *pipe)
|
|
|
|
+{
|
|
|
|
+ unsigned long flags;
|
|
|
|
+ bool stopped;
|
|
|
|
+
|
|
|
|
+ spin_lock_irqsave(&pipe->irqlock, flags);
|
|
|
|
+ stopped = pipe->state == VSP1_PIPELINE_STOPPED,
|
|
|
|
+ spin_unlock_irqrestore(&pipe->irqlock, flags);
|
|
|
|
+
|
|
|
|
+ return stopped;
|
|
|
|
+}
|
|
|
|
+
|
|
static int vsp1_pipeline_stop(struct vsp1_pipeline *pipe)
|
|
static int vsp1_pipeline_stop(struct vsp1_pipeline *pipe)
|
|
{
|
|
{
|
|
struct vsp1_entity *entity;
|
|
struct vsp1_entity *entity;
|
|
@@ -525,7 +537,7 @@ static int vsp1_pipeline_stop(struct vsp1_pipeline *pipe)
|
|
pipe->state = VSP1_PIPELINE_STOPPING;
|
|
pipe->state = VSP1_PIPELINE_STOPPING;
|
|
spin_unlock_irqrestore(&pipe->irqlock, flags);
|
|
spin_unlock_irqrestore(&pipe->irqlock, flags);
|
|
|
|
|
|
- ret = wait_event_timeout(pipe->wq, pipe->state == VSP1_PIPELINE_STOPPED,
|
|
|
|
|
|
+ ret = wait_event_timeout(pipe->wq, vsp1_pipeline_stopped(pipe),
|
|
msecs_to_jiffies(500));
|
|
msecs_to_jiffies(500));
|
|
ret = ret == 0 ? -ETIMEDOUT : 0;
|
|
ret = ret == 0 ? -ETIMEDOUT : 0;
|
|
|
|
|
|
@@ -741,8 +753,7 @@ void vsp1_pipelines_suspend(struct vsp1_device *vsp1)
|
|
if (pipe == NULL)
|
|
if (pipe == NULL)
|
|
continue;
|
|
continue;
|
|
|
|
|
|
- ret = wait_event_timeout(pipe->wq,
|
|
|
|
- pipe->state == VSP1_PIPELINE_STOPPED,
|
|
|
|
|
|
+ ret = wait_event_timeout(pipe->wq, vsp1_pipeline_stopped(pipe),
|
|
msecs_to_jiffies(500));
|
|
msecs_to_jiffies(500));
|
|
if (ret == 0)
|
|
if (ret == 0)
|
|
dev_warn(vsp1->dev, "pipeline %u stop timeout\n",
|
|
dev_warn(vsp1->dev, "pipeline %u stop timeout\n",
|