Commit 468613a6 authored by Niklas Söderlund's avatar Niklas Söderlund Committed by Mauro Carvalho Chehab
Browse files

media: rcar-vin: Do not hold the group lock when unregistering notifier



There is no need to hold the group lock when unregistering the notifier,
but doing so triggers a warning about a possible cyclic lock dependency.

The lock warning cover the case where a subdevice is about to be bound
to the notifier at the same time as it's unregistered. The locking for
this scenario is handled in the v4l2-async framework so it's safe to
remove the lock in the driver. This match the locking logic in the
driver for when the notifier in question is registered.

Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent e37e8218
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -349,12 +349,10 @@ static int rvin_group_parse_of(struct rvin_dev *vin, unsigned int port,

static void rvin_group_notifier_cleanup(struct rvin_dev *vin)
{
	mutex_lock(&vin->group->lock);
	if (&vin->v4l2_dev == vin->group->notifier.v4l2_dev) {
		v4l2_async_nf_unregister(&vin->group->notifier);
		v4l2_async_nf_cleanup(&vin->group->notifier);
	}
	mutex_unlock(&vin->group->lock);
}

static int rvin_group_notifier_init(struct rvin_dev *vin, unsigned int port,