> Date: Fri, 12 Jan 2018 14:53:20 +1100
> From: Jonathan Gray <j...@jsg.id.au>
> 
> When trying to use alloc_page from ttm with radeon on an amd64
> machine with 8GB physmem the system would panic part way through
> taking over the console along the lines of
> 
> 'panic: Non dma-reachable buffer at paddr 0x1ef221000(raw)'
> 
> This adds the dma constraints ttm_uvm_alloc_page() has.

At some point it would be good if at least for the graphics stuff we
could allocate "high" memory, but for now this is better to be safe
than sorry.  Might have some impact on inteldrm(4) users on modern
hardware but we probably won't find out until this gets committed.

ok kettenis@

> Index: drm_linux.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/drm/drm_linux.c,v
> retrieving revision 1.15
> diff -u -p -r1.15 drm_linux.c
> --- drm_linux.c       12 Jul 2017 20:12:19 -0000      1.15
> +++ drm_linux.c       12 Jan 2018 03:36:20 -0000
> @@ -204,8 +204,8 @@ alloc_pages(unsigned int gfp_mask, unsig
>               flags |= UVM_PLA_ZERO;
>  
>       TAILQ_INIT(&mlist);
> -     if (uvm_pglistalloc(PAGE_SIZE << order, 0, -1, PAGE_SIZE, 0,
> -         &mlist, 1, flags))
> +     if (uvm_pglistalloc(PAGE_SIZE << order, dma_constraint.ucr_low,
> +         dma_constraint.ucr_high, PAGE_SIZE, 0, &mlist, 1, flags))
>               return NULL;
>       return TAILQ_FIRST(&mlist);
>  }
> 
> 

Reply via email to