On Mon, Jun 10, 2024, at 11:24, Phil Elwell wrote: > On Mon, 10 Jun 2024 at 10:20, Arnd Bergmann <arnd@xxxxxxxx> wrote: >> >> My guess is that this will likely break existing applications, >> in which case we cannot. >> >> It's probably a good idea to take a look at what buffers >> are actually passed by userspace today. That would also >> help decide how we allocate bounce buffers if we have to. >> E.g. it's a big difference if the buffers are always >> within a few bytes, kilobytes or megabytes. > > vchiq sends partial cache lines at the start and of reads (as seen > from the ARM host) out of band, so the only misaligned DMA transfers > should be from ARM to VPU. This should not require a bounce buffer. Ok, so if the partial data is sent out of band already, it may be possible to just leave it out of the scatterlist so it doesn't get bounced by dma_map_sg(). I don't see where that case is handled but that shouldn't be too hard here. Arnd