On 12/21/2017 07:05 AM, He, Roger wrote: > > -----Original Message----- > From: Christian König [mailto:ckoenig.leichtzumerken at gmail.com] > Sent: Wednesday, December 20, 2017 9:36 PM > To: He, Roger <Hongbo.He at amd.com>; amd-gfx at lists.freedesktop.org; dri-devel at lists.freedesktop.org > Subject: Re: [PATCH 3/7] drm/ttm: use an operation ctx for ttm_mem_global_alloc_page > > Commit message! > > Am 20.12.2017 um 11:34 schrieb Roger He: >> Change-Id: I4104a12e09a374b6477a0dd5a8fce26dce27a746 >> Signed-off-by: Roger He <Hongbo.He at amd.com> >> --- >> drivers/gpu/drm/ttm/ttm_memory.c | 15 ++++++++------- >> drivers/gpu/drm/ttm/ttm_page_alloc.c | 6 +++++- >> drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 8 ++++++-- >> include/drm/ttm/ttm_memory.h | 3 ++- >> 4 files changed, 21 insertions(+), 11 deletions(-) >> >> diff --git a/drivers/gpu/drm/ttm/ttm_memory.c >> b/drivers/gpu/drm/ttm/ttm_memory.c >> index 525d3b6..8df0755 100644 >> --- a/drivers/gpu/drm/ttm/ttm_memory.c >> +++ b/drivers/gpu/drm/ttm/ttm_memory.c >> @@ -539,15 +539,14 @@ int ttm_mem_global_alloc(struct ttm_mem_global *glob, uint64_t memory, >> EXPORT_SYMBOL(ttm_mem_global_alloc); >> >> int ttm_mem_global_alloc_page(struct ttm_mem_global *glob, >> - struct page *page, uint64_t size) >> + struct page *page, uint64_t size, >> + struct ttm_operation_ctx *ctx) >> { >> - >> + int ret; >> struct ttm_mem_zone *zone = NULL; >> - struct ttm_operation_ctx ctx = { >> - .interruptible = false, >> - .no_wait_gpu = false >> - }; >> + bool tmp_no_wait_gpu = ctx->no_wait_gpu; > Mhm, please drop that. That the function might wait for the GPU even when the caller requested not to do so sounds like a bug to Yes, I agree. /Thomas