On Fri, 16 Aug 2024 at 06:45, Timur Tabi <ttabi@xxxxxxxxxx> wrote: > > On Fri, 2024-08-16 at 06:19 +1000, Dave Airlie wrote: > > Fix this by using the non-coherent allocator instead, I think there > > might be a better answer to this, but it involve ripping up some of > > APIs using sg lists. > > Thanks for fixing this, but what is the relationshio between non-coherent > DMA and sg_set_buf()? You're still calling sg_init_one() and hitting this > check: > > #ifdef CONFIG_DEBUG_SG > BUG_ON(!virt_addr_valid(buf)); > #endif > > Does a non-coherent DMA buffer have a different kind of virtual address than > a coherent DMA buffer? Yes, it has one that doesn't explode in the check. We should not be stuffing mapped dma_addr into sg tables at all, fixing that is a bit messier. Dave.