On Sun, 2025-11-09 at 16:19 +1000, David Airlie wrote:
> So this caused a regression, because the sysmem flush page has to be
> inside 40 bits.
> 
> look in openrm:
> src/nvidia/src/kernel/gpu/mem_sys/arch/maxwell/kern_mem_sys_gm107.c:kmemsysInitFlushSysmemBuffer_G
> M107
> 
> The prop driver tries to use GFP_DMA32, then use 40 bits and the code
> is all horrible. It's probably fine for use to just set the dma_bits
> to 40 here before and then the full range after.

I think I figured it out.  The problem is that nvkm_device_ctor() sets up 
pdev->device.mmu, which
means that 

        if (pdev->device.mmu && !pdev->device.pci->agp.bridge) {

fails if called before nvkm_device_ctor().

I should have done a better job examining the code flow.  

I'm testing it now, but maybe the real solution is to just do this:

        fb->sysmem.flush_page = alloc_page(GFP_KERNEL | GFP_DMA32 | __GFP_ZERO);

Reply via email to