diff mbox series

[09/23] media: atomisp: Drop atomisp_pipe_check() from atomisp_link_setup()

Message ID 20240415120220.219480-10-hdegoede@redhat.com
State Accepted
Commit e03a5d3e95f22d15d8dfd97b1d31ea6247931b48
Headers show
Series media: atomisp: Further media-controller related fixes + dead code removal | expand

Commit Message

Hans de Goede April 15, 2024, 12:02 p.m. UTC
The media-controller core (__media_entity_setup_link()) already checks
that the pads of the link are not streaming before calling the setup_link()
pad-op so calling atomisp_pipe_check() is not necessary;

and taking isp->mutex inside the setup_link() pad-op leads to a possible
ABBA deadlock vs the media-device graph_mutex which in the case of
the setup_link() pad-op is taken before calling the op, while in other
scenarios the graph_mutex is taken after the isp->mutex.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/staging/media/atomisp/pci/atomisp_subdev.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c
index 53225958c23b..1bb33460210c 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c
@@ -644,7 +644,7 @@  static int atomisp_link_setup(struct media_entity *entity,
 					      entity);
 	struct atomisp_sub_device *asd = v4l2_get_subdevdata(sd);
 	struct atomisp_device *isp = asd->isp;
-	int i, ret;
+	int i;
 
 	/* ISP's source is immutable */
 	if (local != &asd->pads[ATOMISP_SUBDEV_PAD_SINK]) {
@@ -663,12 +663,6 @@  static int atomisp_link_setup(struct media_entity *entity,
 		return -EINVAL;
 	}
 
-	mutex_lock(&isp->mutex);
-	ret = atomisp_pipe_check(&asd->video_out, true);
-	mutex_unlock(&isp->mutex);
-	if (ret)
-		return ret;
-
 	/* Turn off the sensor on link disable */
 	if (!(flags & MEDIA_LNK_FL_ENABLED)) {
 		atomisp_s_sensor_power(isp, i, 0);