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.
Comment 1 by acourbot@chromium.org
, Nov 8