lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <X8ENifLanjYuhF/r@jagdpanzerIV.localdomain>
Date:   Fri, 27 Nov 2020 23:30:33 +0900
From:   Sergey Senozhatsky <sergey.senozhatsky@...il.com>
To:     Hans Verkuil <hverkuil@...all.nl>
Cc:     Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Tomasz Figa <tfiga@...omium.org>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        Sergey Senozhatsky <senozhatsky@...omium.org>
Subject: Re: [PATCH] media: vb2: always set buffer cache sync hints

On (20/11/27 13:59), Hans Verkuil wrote:
> 
> I think this needs a comment, basically explaining what you said in
> the commit log. It's not obvious from the code that this is a
> workaround.

Something like this?

---

diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c
index 5499013cf82e..21b2b0ae3629 100644
--- a/drivers/media/common/videobuf2/videobuf2-core.c
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
@@ -414,6 +414,16 @@ static int __vb2_queue_alloc(struct vb2_queue *q, enum vb2_memory memory,
                vb->index = q->num_buffers + buffer;
                vb->type = q->type;
                vb->memory = memory;
+               /*
+                * A workaround fix. We need to set these flags here so that
+                * videobuf2 core will always call ->prepare()/->finish()
+                * cache sync/flush on vb2 buffers. Otherwise, for backends
+                * that don't rely on V4L2 (perhaps dvb) these flags will
+                * always be false and, hence, videobuf2 core will skip cache
+                * sync/flush operations.
+                */
+               vb->need_cache_sync_on_prepare = 1;
+               vb->need_cache_sync_on_finish = 1;
                for (plane = 0; plane < num_planes; ++plane) {
                        vb->planes[plane].length = plane_sizes[plane];
                        vb->planes[plane].min_length = plane_sizes[plane];

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ