drm/nouveau: fix incorrect conversion to dma_resv_wait_timeout()
authorJohn Ogness <john.ogness@linutronix.de>
Sat, 15 Apr 2023 02:02:50 +0000 (04:08 +0206)
committerKarol Herbst <kherbst@redhat.com>
Mon, 17 Apr 2023 12:53:36 +0000 (14:53 +0200)
commit7363d6bedc000f6f9d09cfe498da2f3aca653778
treec7fff7c985329f65594bc84150493dc3362e7f96
parentafa965a45e01e541cdbe5c8018226eff117610f0
drm/nouveau: fix incorrect conversion to dma_resv_wait_timeout()

Commit 41d351f29528 ("drm/nouveau: stop using ttm_bo_wait")
converted from ttm_bo_wait_ctx() to dma_resv_wait_timeout().
However, dma_resv_wait_timeout() returns greater than zero on
success as opposed to ttm_bo_wait_ctx(). As a result, relocs
will fail and log errors even when it was a success.

Change the return code handling to match that of
nouveau_gem_ioctl_cpu_prep(), which was already using
dma_resv_wait_timeout() correctly.

Fixes: 41d351f29528 ("drm/nouveau: stop using ttm_bo_wait")
Reported-by: Tanmay Bhushan <007047221b@gmail.com>
Link: https://lore.kernel.org/lkml/20230119225351.71657-1-007047221b@gmail.com
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/87edolaomt.fsf@jogness.linutronix.de
drivers/gpu/drm/nouveau/nouveau_gem.c