drm/amdgpu: don't oops on failure to load
Subsystems (2)
Dave Airlie
maintainerPATCH 1/1 drm/amdgpu: don't oops on failure to load
From: Dave Airlie <[email protected]>
In two places amdgpu tries to tear down something it hasn't initalised when failing. This is what happens when you enable experimental support on topaz which then fails in ring init.
This patch allows it to fail cleanly.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 3 +++ drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +3 -0
@@ -69,6 +69,9 @@ void amdgpu_ctx_fini(struct amdgpu_ctx *ctx)struct amdgpu_device *adev = ctx->adev;unsigned i, j; +if (!adev) +return ; +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i)for (j =0 ; j <AMDGPU_CTX_MAX_CS_PENDING ; ++j)fence_put (ctx->rings[i].fences[j]);
drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +2 -1
@@ -462,5 +462,6 @@ int amd_sched_init(struct amd_gpu_scheduler *sched,*/ void amd_sched_fini (struct amd_gpu_scheduler *sched) { -kthread_stop (sched->thread); +if (sched->thread) +kthread_stop (sched->thread); }
Signature · 6 lines
2.5.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Thanks for catching. Reviewed-by: Chunming Zhou <[email protected]>
Regards,
David Zhou
Quoted 52 lines
-----Original Message-----
From: dri-devel [mailto:[email protected]] On Behalf Of Dave Airlie
Sent: Tuesday, November 03, 2015 7:35 AM
To: [email protected]
Subject: [PATCH] drm/amdgpu: don't oops on failure to loadFrom: Dave Airlie <[email protected]>
In two places amdgpu tries to tear down something it hasn't initalised when failing. This is what happens when you enable experimental support on topaz which then fails in ring init.
This patch allows it to fail cleanly.
Signed-off-by Dave Airlie <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 3 +++ drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +3
-0@@ -69,6 +69,9 @@ void amdgpu_ctx_fini(struct amdgpu_ctx *ctx)struct amdgpu_device *adev = ctx->adev;unsigned i, j; +if (!adev) +return ; +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i)for (j =0 ; j <AMDGPU_CTX_MAX_CS_PENDING ; ++j)fence_put (ctx->rings[i].fences[j]);drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +2
-2@@ -462,5 +462,6 @@ int amd_sched_init(struct amd_gpu_scheduler*sched, */ void amd_sched_fini (struct amd_gpu_scheduler *sched) { -kthread_stop (sched->thread); +if (sched->thread) +kthread_stop (sched->thread); } --2.5.0
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
We handle the scheduler and amdgpu as two different components (the scheduler could be used by other drivers as well). So would be nice to have two patches for this.
But that's only nice to have, either way patch is Reviewed-by: Christian König <[email protected]> as well.
Regards,
Christian.
Quoted 57 lines · David(ChunMing)
Thanks for catching. Reviewed-by: Chunming Zhou <[email protected]>
Regards,
David ZhouQuoted 52 lines
-----Original Message-----
From: dri-devel [mailto:[email protected]] On Behalf Of Dave Airlie
Sent: Tuesday, November 03, 2015 7:35 AM
To: [email protected]
Subject: [PATCH] drm/amdgpu: don't oops on failure to loadFrom: Dave Airlie <[email protected]>
In two places amdgpu tries to tear down something it hasn't initalised when failing. This is what happens when you enable experimental support on topaz which then fails in ring init.
This patch allows it to fail cleanly.
Signed-off-by Dave Airlie <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 3 +++ drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +3
-0@@ -69,6 +69,9 @@ void amdgpu_ctx_fini(struct amdgpu_ctx *ctx)struct amdgpu_device *adev = ctx->adev;unsigned i, j; +if (!adev) +return ; +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i)for (j =0 ; j <AMDGPU_CTX_MAX_CS_PENDING ; ++j)fence_put (ctx->rings[i].fences[j]);drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +2
-2@@ -462,5 +462,6 @@ int amd_sched_init(struct amd_gpu_scheduler*sched, */ void amd_sched_fini (struct amd_gpu_scheduler *sched) { -kthread_stop (sched->thread); +if (sched->thread) +kthread_stop (sched->thread); } --2.5.0
Quoted 8 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 6 lines · Christian König
We handle the scheduler and amdgpu as two different components (the scheduler could be used by other drivers as well). So would be nice to have two patches for this.
But that's only nice to have, either way patch is Reviewed-by: Christian König <[email protected]> as well.
Split into two patches and applied. Thanks!
Alex
Quoted 78 lines
Regards,
Christian.Quoted 61 lines · David(ChunMing)
Thanks for catching. Reviewed-by: Chunming Zhou <[email protected]>
Regards,
David ZhouQuoted 55 lines
-----Original Message-----
From: dri-devel [mailto:[email protected]] On Behalf
Of Dave Airlie
Sent: Tuesday, November 03, 2015 7:35 AM
To: [email protected]
Subject: [PATCH] drm/amdgpu: don't oops on failure to loadFrom: Dave Airlie <[email protected]>
In two places amdgpu tries to tear down something it hasn't initalised when
failing. This is what happens when you enable experimental support on topaz
which then fails in ring init.This patch allows it to fail cleanly.
Signed-off-by Dave Airlie <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 3 +++ drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +3
-0@@ -69,6 +69,9 @@ void amdgpu_ctx_fini(struct amdgpu_ctx *ctx)struct amdgpu_device *adev = ctx->adev;unsigned i, j; +if (!adev) +return ; +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i)for (j =0 ; j <AMDGPU_CTX_MAX_CS_PENDING ; ++j)fence_put (ctx->rings[i].fences[j]);drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +2
-2@@ -462,5 +462,6 @@ int amd_sched_init(struct amd_gpu_scheduler*sched, */ void amd_sched_fini (struct amd_gpu_scheduler *sched) { -kthread_stop (sched->thread); +if (sched->thread) +kthread_stop (sched->thread); } --2.5.0
Quoted 9 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel