LinuxTV Patchwork [11/13] media: coda: add lockdep asserts

login
register
mail settings
Submitter Philipp Zabel
Date April 12, 2019, 3:51 p.m.
Message ID <20190412155135.13907-11-p.zabel@pengutronix.de>
Download mbox | patch
Permalink /patch/55646/
State New
Headers show

Comments

Philipp Zabel - April 12, 2019, 3:51 p.m.
coda_command_sync, coda_hw_reset, and __coda_start_decoding
all expect to be called under the coda_mutex device lock.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/media/platform/coda/coda-bit.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch

diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c
index d774a5aaa422..2b73e023b191 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -102,6 +102,8 @@  static int coda_command_sync(struct coda_ctx *ctx, int cmd)
 	struct coda_dev *dev = ctx->dev;
 	int ret;
 
+	lockdep_assert_held(&dev->coda_mutex);
+
 	coda_command_async(ctx, cmd);
 	ret = coda_wait_timeout(dev);
 	trace_coda_bit_done(ctx);
@@ -116,6 +118,8 @@  int coda_hw_reset(struct coda_ctx *ctx)
 	unsigned int idx;
 	int ret;
 
+	lockdep_assert_held(&dev->coda_mutex);
+
 	if (!dev->rstc)
 		return -ENOENT;
 
@@ -1676,6 +1680,8 @@  static int __coda_start_decoding(struct coda_ctx *ctx)
 	u32 val;
 	int ret;
 
+	lockdep_assert_held(&dev->coda_mutex);
+
 	coda_dbg(1, ctx, "Video Data Order Adapter: %s\n",
 		 ctx->use_vdoa ? "Enabled" : "Disabled");
 

Privacy Policy