* [PATCH] drm/amdgpu: don't oops on failure to load
@ 2015-11-02 23:35 Dave Airlie
2015-11-03 2:33 ` Zhou, David(ChunMing)
0 siblings, 1 reply; 4+ messages in thread
From: Dave Airlie @ 2015-11-02 23:35 UTC (permalink / raw)
To: dri-devel
From: Dave Airlie <airlied@redhat.com>
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 <airlied@redhat.com>
---
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(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index e0b80cc..fec65f0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -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]);
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
index 7fa1d7a..d3b9eb7 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
@@ -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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread* RE: [PATCH] drm/amdgpu: don't oops on failure to load
2015-11-02 23:35 [PATCH] drm/amdgpu: don't oops on failure to load Dave Airlie
@ 2015-11-03 2:33 ` Zhou, David(ChunMing)
2015-11-03 8:43 ` Christian König
0 siblings, 1 reply; 4+ messages in thread
From: Zhou, David(ChunMing) @ 2015-11-03 2:33 UTC (permalink / raw)
To: Dave Airlie, dri-devel@lists.freedesktop.org
Thanks for catching. Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Regards,
David Zhou
> -----Original Message-----
> From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf
> Of Dave Airlie
> Sent: Tuesday, November 03, 2015 7:35 AM
> To: dri-devel@lists.freedesktop.org
> Subject: [PATCH] drm/amdgpu: don't oops on failure to load
>
> From: Dave Airlie <airlied@redhat.com>
>
> 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 <airlied@redhat.com>
> ---
> 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(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> index e0b80cc..fec65f0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> @@ -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]);
> diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
> b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
> index 7fa1d7a..d3b9eb7 100644
> --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
> +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
> @@ -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
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] drm/amdgpu: don't oops on failure to load
2015-11-03 2:33 ` Zhou, David(ChunMing)
@ 2015-11-03 8:43 ` Christian König
2015-11-03 16:12 ` Alex Deucher
0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2015-11-03 8:43 UTC (permalink / raw)
To: Zhou, David(ChunMing), Dave Airlie,
dri-devel@lists.freedesktop.org
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 <christian.koenig@amd.com> as well.
Regards,
Christian.
On 03.11.2015 03:33, Zhou, David(ChunMing) wrote:
> Thanks for catching. Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
>
> Regards,
> David Zhou
>
>> -----Original Message-----
>> From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf
>> Of Dave Airlie
>> Sent: Tuesday, November 03, 2015 7:35 AM
>> To: dri-devel@lists.freedesktop.org
>> Subject: [PATCH] drm/amdgpu: don't oops on failure to load
>>
>> From: Dave Airlie <airlied@redhat.com>
>>
>> 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 <airlied@redhat.com>
>> ---
>> 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(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
>> index e0b80cc..fec65f0 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
>> @@ -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]);
>> diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
>> b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
>> index 7fa1d7a..d3b9eb7 100644
>> --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
>> +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
>> @@ -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
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] drm/amdgpu: don't oops on failure to load
2015-11-03 8:43 ` Christian König
@ 2015-11-03 16:12 ` Alex Deucher
0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2015-11-03 16:12 UTC (permalink / raw)
To: Christian König; +Cc: dri-devel@lists.freedesktop.org
On Tue, Nov 3, 2015 at 3:43 AM, Christian König <deathsimple@vodafone.de> wrote:
> 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 <christian.koenig@amd.com> as well.
Split into two patches and applied. Thanks!
Alex
>
> Regards,
> Christian.
>
>
> On 03.11.2015 03:33, Zhou, David(ChunMing) wrote:
>>
>> Thanks for catching. Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
>>
>> Regards,
>> David Zhou
>>
>>> -----Original Message-----
>>> From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On
>>> Behalf
>>> Of Dave Airlie
>>> Sent: Tuesday, November 03, 2015 7:35 AM
>>> To: dri-devel@lists.freedesktop.org
>>> Subject: [PATCH] drm/amdgpu: don't oops on failure to load
>>>
>>> From: Dave Airlie <airlied@redhat.com>
>>>
>>> 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 <airlied@redhat.com>
>>> ---
>>> 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(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
>>> index e0b80cc..fec65f0 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
>>> @@ -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]);
>>> diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
>>> b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
>>> index 7fa1d7a..d3b9eb7 100644
>>> --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
>>> +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
>>> @@ -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
>>>
>>> _______________________________________________
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-11-03 16:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-02 23:35 [PATCH] drm/amdgpu: don't oops on failure to load Dave Airlie
2015-11-03 2:33 ` Zhou, David(ChunMing)
2015-11-03 8:43 ` Christian König
2015-11-03 16:12 ` Alex Deucher
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.