nouveau: Fix migrate_to_ram() for faulting page
authorAlistair Popple <apopple@nvidia.com>
Wed, 19 Oct 2022 12:29:34 +0000 (23:29 +1100)
committerLyude Paul <lyude@redhat.com>
Fri, 21 Oct 2022 20:02:35 +0000 (16:02 -0400)
commit1beca7f1471e14802f7f6730ac9ac0a3de7c8f8b
tree9139b53e524bce226557ce787dd9edcd668a689b
parent3facae0649648da1da6b1c36babc9b92998face0
nouveau: Fix migrate_to_ram() for faulting page

Commit 16ce101db85d ("mm/memory.c: fix race when faulting a device private
page") changed the migrate_to_ram() callback to take a reference on the
device page to ensure it can't be freed while handling the fault.
Unfortunately the corresponding update to Nouveau to accommodate this
change was inadvertently dropped from that patch causing GPU to CPU
migration to fail so add it here.

Signed-off-by: Alistair Popple <apopple@nvidia.com>
Fixes: 16ce101db85d ("mm/memory.c: fix race when faulting a device private page")
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221019122934.866205-1-apopple@nvidia.com
drivers/gpu/drm/nouveau/nouveau_dmem.c