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

media: vsp1: Use lockdep assertions to enforce documented conventions

A few functions have documented locking conventions. Documentation is
nice, but runtime checks are better. Enforce the conventions with
lockdep assertions.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>

authored by

Laurent Pinchart and committed by
Hans Verkuil
9f0fb030 e5dd01ea

+8
+5
drivers/media/platform/renesas/vsp1/vsp1_dl.c
··· 10 10 #include <linux/device.h> 11 11 #include <linux/dma-mapping.h> 12 12 #include <linux/gfp.h> 13 + #include <linux/lockdep.h> 13 14 #include <linux/refcount.h> 14 15 #include <linux/slab.h> 15 16 #include <linux/workqueue.h> ··· 613 612 struct vsp1_dl_list *dl = NULL; 614 613 unsigned long flags; 615 614 615 + lockdep_assert_not_held(&dlm->lock); 616 + 616 617 spin_lock_irqsave(&dlm->lock, flags); 617 618 618 619 if (!list_empty(&dlm->free)) { ··· 641 638 642 639 if (!dl) 643 640 return; 641 + 642 + lockdep_assert_held(&dl->dlm->lock); 644 643 645 644 /* 646 645 * Release any linked display-lists which were chained for a single
+3
drivers/media/platform/renesas/vsp1/vsp1_pipe.c
··· 9 9 10 10 #include <linux/delay.h> 11 11 #include <linux/list.h> 12 + #include <linux/lockdep.h> 12 13 #include <linux/sched.h> 13 14 #include <linux/wait.h> 14 15 ··· 473 472 void vsp1_pipeline_run(struct vsp1_pipeline *pipe) 474 473 { 475 474 struct vsp1_device *vsp1 = pipe->output->entity.vsp1; 475 + 476 + lockdep_assert_held(&pipe->irqlock); 476 477 477 478 if (pipe->state == VSP1_PIPELINE_STOPPED) { 478 479 vsp1_write(vsp1, VI6_CMD(pipe->output->entity.index),