]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
drm/amdgpu: Fix always_valid bos multiple LRU insertions.
authorBas Nieuwenhuizen <basni@chromium.org>
Wed, 31 Jan 2018 12:58:55 +0000 (13:58 +0100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 15:49:25 +0000 (11:49 -0400)
BugLink: http://bugs.launchpad.net/bugs/1773233
commit a20ee0b1f8b42e2568f3a4408003d22b2dfcc706 upstream.

If these bos are evicted and are in the validated list
things blow up, so do not put them in there. Notably,
that tries to add the bo to the LRU twice, which results
in a BUG_ON in ttm_bo.c.

While for the bo_list an alternative would be to not allow
always valid bos in there, that does not work for the user
fence.

v2: Fixed whitespace issue pointed out by checkpatch.pl

Signed-off-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

index 59089e027f4d8ac386f1174fe47eea5622ec182d..92be7f6de197372beb1a12a0ad1816bd62f738a1 100644 (file)
@@ -233,8 +233,10 @@ void amdgpu_bo_list_get_list(struct amdgpu_bo_list *list,
        for (i = 0; i < list->num_entries; i++) {
                unsigned priority = list->array[i].priority;
 
-               list_add_tail(&list->array[i].tv.head,
-                             &bucket[priority]);
+               if (!list->array[i].robj->parent)
+                       list_add_tail(&list->array[i].tv.head,
+                                     &bucket[priority]);
+
                list->array[i].user_pages = NULL;
        }
 
index b9cfcffbf80f56ad5537c647aa3ec7a39a9e242b..da3c0aa21ba0843d1729d427735d4a6cad65f767 100644 (file)
@@ -532,7 +532,7 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
        INIT_LIST_HEAD(&duplicates);
        amdgpu_vm_get_pd_bo(&fpriv->vm, &p->validated, &p->vm_pd);
 
-       if (p->uf_entry.robj)
+       if (p->uf_entry.robj && !p->uf_entry.robj->parent)
                list_add(&p->uf_entry.tv.head, &p->validated);
 
        while (1) {