diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c index 3fa0bc687851..8e4e941381d9 100644 --- a/drivers/media/mc/mc-entity.c +++ b/drivers/media/mc/mc-entity.c @@ -779,11 +779,17 @@ __must_check int __media_pipeline_start(struct media_pad *origin, lockdep_assert_held(&mdev->graph_mutex); /* - * If the pad is already part of a pipeline, that pipeline must be the - * same as the pipe given to media_pipeline_start(). + * If the pad is attached to a different pipeline than the one passed on + * to media_pipeline_start(), the pad must wait for the ongoing session + * on this previous pipeline to complete before it starts a new session. + * The request for starting the pipeline, although valid, cannot be + * served until the ongoing request finishes. */ - if (WARN_ON(origin->pipe && origin->pipe != pipe)) - return -EINVAL; + if (origin->pipe && origin->pipe != pipe) { + dev_dbg(mdev->dev, "Failed to start pipeline: pad '%s':%u busy\n", + origin->entity->name, origin->index); + return -EBUSY; + } /* * If the pipeline has already been started, it is guaranteed to be