Commit a791960d authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

media: imx: imx7_mipi_csis: Don't take state->lock in .link_setup()

The .link_setup() handler uses state->lock to protect the src_sd field.
This is only used in mipi_csis_s_stream(), which can't race
.link_setup() as the MC core prevents link setup when the pipeline is
streaming. Drop the lock.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarRui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 8f5586dc
...@@ -749,7 +749,6 @@ static int mipi_csis_link_setup(struct media_entity *entity, ...@@ -749,7 +749,6 @@ static int mipi_csis_link_setup(struct media_entity *entity,
struct v4l2_subdev *mipi_sd = media_entity_to_v4l2_subdev(entity); struct v4l2_subdev *mipi_sd = media_entity_to_v4l2_subdev(entity);
struct csi_state *state = mipi_sd_to_csis_state(mipi_sd); struct csi_state *state = mipi_sd_to_csis_state(mipi_sd);
struct v4l2_subdev *remote_sd; struct v4l2_subdev *remote_sd;
int ret = 0;
dev_dbg(state->dev, "link setup %s -> %s", remote_pad->entity->name, dev_dbg(state->dev, "link setup %s -> %s", remote_pad->entity->name,
local_pad->entity->name); local_pad->entity->name);
...@@ -760,22 +759,16 @@ static int mipi_csis_link_setup(struct media_entity *entity, ...@@ -760,22 +759,16 @@ static int mipi_csis_link_setup(struct media_entity *entity,
remote_sd = media_entity_to_v4l2_subdev(remote_pad->entity); remote_sd = media_entity_to_v4l2_subdev(remote_pad->entity);
mutex_lock(&state->lock);
if (flags & MEDIA_LNK_FL_ENABLED) { if (flags & MEDIA_LNK_FL_ENABLED) {
if (state->src_sd) { if (state->src_sd)
ret = -EBUSY; return -EBUSY;
goto out;
}
state->src_sd = remote_sd; state->src_sd = remote_sd;
} else { } else {
state->src_sd = NULL; state->src_sd = NULL;
} }
out: return 0;
mutex_unlock(&state->lock);
return ret;
} }
static struct v4l2_mbus_framefmt * static struct v4l2_mbus_framefmt *
......
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