Merge branch 'linux-5.1' of git://github.com/skeggsb/linux into drm-fixes
authorDave Airlie <airlied@redhat.com>
Fri, 22 Mar 2019 00:39:27 +0000 (10:39 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 22 Mar 2019 00:39:35 +0000 (10:39 +1000)
Some minor nouveau dmem and other fixes.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Ben Skeggs <bskeggs@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/CABDvA==kMkD6n-cS9KpQBcTU1E8p7Wc+H1ZuOhSfD7yTFJVvkw@mail.gmail.com
1  2 
drivers/gpu/drm/nouveau/nouveau_dmem.c

index aa9fec80492d167f720a07ee58f8e0196d858c3a,61fc27d30ff2f54d30ca4e0e534007e98e17fb5d..40c47d6a7d783d72c869937b2a6ad946086a20cf
@@@ -100,12 -100,10 +100,10 @@@ static voi
  nouveau_dmem_free(struct hmm_devmem *devmem, struct page *page)
  {
        struct nouveau_dmem_chunk *chunk;
-       struct nouveau_drm *drm;
        unsigned long idx;
  
        chunk = (void *)hmm_devmem_page_get_drvdata(page);
        idx = page_to_pfn(page) - chunk->pfn_first;
-       drm = chunk->drm;
  
        /*
         * FIXME:
@@@ -261,7 -259,7 +259,7 @@@ static const struct migrate_vma_ops nou
        .finalize_and_map       = nouveau_dmem_fault_finalize_and_map,
  };
  
 -static int
 +static vm_fault_t
  nouveau_dmem_fault(struct hmm_devmem *devmem,
                   struct vm_area_struct *vma,
                   unsigned long addr,
@@@ -456,11 -454,6 +454,6 @@@ nouveau_dmem_resume(struct nouveau_drm 
                /* FIXME handle pin failure */
                WARN_ON(ret);
        }
-       list_for_each_entry (chunk, &drm->dmem->chunk_empty, list) {
-               ret = nouveau_bo_pin(chunk->bo, TTM_PL_FLAG_VRAM, false);
-               /* FIXME handle pin failure */
-               WARN_ON(ret);
-       }
        mutex_unlock(&drm->dmem->mutex);
  }
  
@@@ -479,9 -472,6 +472,6 @@@ nouveau_dmem_suspend(struct nouveau_dr
        list_for_each_entry (chunk, &drm->dmem->chunk_full, list) {
                nouveau_bo_unpin(chunk->bo);
        }
-       list_for_each_entry (chunk, &drm->dmem->chunk_empty, list) {
-               nouveau_bo_unpin(chunk->bo);
-       }
        mutex_unlock(&drm->dmem->mutex);
  }
  
@@@ -623,7 -613,7 +613,7 @@@ nouveau_dmem_init(struct nouveau_drm *d
         */
        drm->dmem->devmem = hmm_devmem_add(&nouveau_dmem_devmem_ops,
                                           device, size);
-       if (drm->dmem->devmem == NULL) {
+       if (IS_ERR(drm->dmem->devmem)) {
                kfree(drm->dmem);
                drm->dmem = NULL;
                return;