diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-12-28 19:29:38 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-01-03 13:30:35 +0300 |
commit | 6f0e5fd39143a59c22d60e7befc4f33f22aeed2f (patch) | |
tree | a7db014e7aead074ea4a72ab48057fcb2f04f0c0 /drivers/media/common | |
parent | 2e33dbb06da4078f94ed8e5fb596ddeca45a1099 (diff) | |
download | linux-6f0e5fd39143a59c22d60e7befc4f33f22aeed2f.tar.xz |
media: vb2: add a new warning about pending buffers
There's a logic at the VB2 core that produces a WARN_ON if
there are still buffers waiting to be filled. However, it doesn't
indicate what buffers are still opened, with makes harder to
identify issues inside caller drivers.
So, add a new pr_warn() pointing to such buffers. That, together
with debug instrumentation inside the drivers can make easier to
identify where the problem is.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r-- | drivers/media/common/videobuf/videobuf2-core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/common/videobuf/videobuf2-core.c b/drivers/media/common/videobuf/videobuf2-core.c index c9795f7837a7..f7109f827f6e 100644 --- a/drivers/media/common/videobuf/videobuf2-core.c +++ b/drivers/media/common/videobuf/videobuf2-core.c @@ -1658,8 +1658,11 @@ static void __vb2_queue_cancel(struct vb2_queue *q) */ if (WARN_ON(atomic_read(&q->owned_by_drv_count))) { for (i = 0; i < q->num_buffers; ++i) - if (q->bufs[i]->state == VB2_BUF_STATE_ACTIVE) + if (q->bufs[i]->state == VB2_BUF_STATE_ACTIVE) { + pr_warn("driver bug: stop_streaming operation is leaving buf %p in active state\n", + q->bufs[i]); vb2_buffer_done(q->bufs[i], VB2_BUF_STATE_ERROR); + } /* Must be zero now */ WARN_ON(atomic_read(&q->owned_by_drv_count)); } |