From: Niklas Söderlund Date: Sun, 28 Nov 2021 13:24:59 +0000 (+0100) Subject: media: rcar-vin: Do not hold the group lock when unregistering notifier X-Git-Tag: v5.17-rc1~171^2~85 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=468613a67bcbc9ef63fe13ec7214c34e5c7b96ba;p=thirdparty%2Flinux.git 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: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c index 6d4cffdbf47a0..0186ae235113b 100644 --- a/drivers/media/platform/rcar-vin/rcar-core.c +++ b/drivers/media/platform/rcar-vin/rcar-core.c @@ -349,12 +349,10 @@ out: 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,