media: atomisp: Avoid deadlock with sensor subdevs with state_lock set
When a (sensor) v4l2_subdev has its state_lock member set to non NULL, then all v4l2_subdev_state-s for the sensor share the same lock. atomisp_init_sensor() calls v4l2_subdev_lock_and_get_active_state() and then later on also tries to lock a separate v4l2_subdev_state used for try calls (rather then changing the active state), while still holding the active state lock. Since this try v4l2_subdev_state shares a lock with the active state this results in a deadlock. Skip locking try_sd_state when sensor->state_lock is set to avoid this. Signed-off-by:Hans de Goede <hdegoede@redhat.com> Reviewed-by:
Andy Shevchenko <andy@kernel.org> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Loading
Please sign in to comment