New issue
Advanced search Search tips

Issue 903087 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

vb2: The finish memop must be called before the buf_finish qop

Project Member Reported by tfiga@google.com, Nov 8

Issue description

We picked a FROMLIST patch that moves cache synchronization from vb2_buffer_done() to DQBUF:
https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/422719/
(cherry picked to 4.4, 4.14 and 4.19 later)

On its own it's a good idea, but unfortunately there is a bug in the patch, which makes the cache synchronization happen after the .buf_finish queue op is called, while the latter may want to access the buffer through a CPU mapping to do some fixups on the contents.

From a quick look, it sounds like we should be okay with moving the call to the finish memop from __vb2_dqbuf() to vb2_core_dqbuf(), before the buf_finish qop is called.

I believe we haven't observed any failures due to it, because we don't have any driver that allows cached mapping and also accesses the buffers from the CPU. We should fix it anyway to avoid surprises in the future.
 
Cc: acourbot@chromium.org

Sign in to add a comment