Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: atomisp: Drop atomisp_pipe_check() from atomisp_link_setup()

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.

Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Hans de Goede and committed by
Mauro Carvalho Chehab
e03a5d3e 1c3432df

+1 -7
+1 -7
drivers/staging/media/atomisp/pci/atomisp_subdev.c
··· 644 644 entity); 645 645 struct atomisp_sub_device *asd = v4l2_get_subdevdata(sd); 646 646 struct atomisp_device *isp = asd->isp; 647 - int i, ret; 647 + int i; 648 648 649 649 /* ISP's source is immutable */ 650 650 if (local != &asd->pads[ATOMISP_SUBDEV_PAD_SINK]) { ··· 662 662 v4l2_err(sd, "Error no sensor for selected CSI receiver\n"); 663 663 return -EINVAL; 664 664 } 665 - 666 - mutex_lock(&isp->mutex); 667 - ret = atomisp_pipe_check(&asd->video_out, true); 668 - mutex_unlock(&isp->mutex); 669 - if (ret) 670 - return ret; 671 665 672 666 /* Turn off the sensor on link disable */ 673 667 if (!(flags & MEDIA_LNK_FL_ENABLED)) {