drm/ttm/nouveau: don't call tt destroy callback on alloc failure.
authorDave Airlie <airlied@redhat.com>
Tue, 28 Jul 2020 04:17:36 +0000 (14:17 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 08:01:01 +0000 (09:01 +0100)
commit4a2cec066dc8d099d30c649ae7ed26771029e0b5
tree124f3cf81bf0c38d729872dc0bba4d607553adcc
parent70b5928f5cd289b2ccf34384ca83b1d9ee7a0fad
drm/ttm/nouveau: don't call tt destroy callback on alloc failure.

commit 5de5b6ecf97a021f29403aa272cb4e03318ef586 upstream.

This is confusing, and from my reading of all the drivers only
nouveau got this right.

Just make the API act under driver control of it's own allocation
failing, and don't call destroy, if the page table fails to
create there is nothing to cleanup here.

(I'm willing to believe I've missed something here, so please
review deeply).

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200728041736.20689-1-airlied@gmail.com
[bwh: Backported to 4.14:
 - Drop change in ttm_sg_tt_init()
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/nouveau/nouveau_sgdma.c
drivers/gpu/drm/ttm/ttm_tt.c