All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Release the mutex hold before backtracing for not supported mxgpu.
@ 2017-12-19  8:37 José Pekkarinen
       [not found] ` <20171219083732.18082-1-koalinux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: José Pekkarinen @ 2017-12-19  8:37 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: José Pekkarinen

This patch releases the mutex held soon before entering the initialization
function in case the device doesn't support mxgpu.

Signed-off-by: José Pekkarinen <koalinux@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
index c25a831f94ec..cac1d8b003e6 100644
--- a/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
@@ -307,6 +307,7 @@ void xgpu_vi_init_golden_registers(struct amdgpu_device *adev)
 						 xgpu_tonga_golden_common_all));
 		break;
 	default:
+		mutex_unlock(&adev->grbm_idx_mutex);
 		BUG_ON("Doesn't support chip type.\n");
 		break;
 	}
-- 
2.13.6

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] Release the mutex hold before backtracing for not supported mxgpu.
       [not found] ` <20171219083732.18082-1-koalinux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-12-20  2:44   ` Yu, Xiangliang
       [not found]     ` <BY2PR1201MB093521CE50B95283C8A047E2EB0C0-O28G1zQ8oGkaqtME6NEo1mrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Yu, Xiangliang @ 2017-12-20  2:44 UTC (permalink / raw)
  To: José Pekkarinen,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org

> This patch releases the mutex held soon before entering the initialization
> function in case the device doesn't support mxgpu.
> 
> Signed-off-by: José Pekkarinen <koalinux@gmail.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
> b/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
> index c25a831f94ec..cac1d8b003e6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
> @@ -307,6 +307,7 @@ void xgpu_vi_init_golden_registers(struct
> amdgpu_device *adev)
> 
> xgpu_tonga_golden_common_all));
>  		break;
>  	default:
> +		mutex_unlock(&adev->grbm_idx_mutex);
>  		BUG_ON("Doesn't support chip type.\n");
>  		break;
>  	}

The release mutex in here has no meaning as kernel will hang later. And Alex has submitted patch to check ASIC IP during detecting SRIOV, so we can't see the case anymore. Please drop the patch.

Thanks!

> --
> 2.13.6
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Release the mutex hold before backtracing for not supported mxgpu.
       [not found]     ` <BY2PR1201MB093521CE50B95283C8A047E2EB0C0-O28G1zQ8oGkaqtME6NEo1mrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
@ 2017-12-20  9:16       ` Christian König
  0 siblings, 0 replies; 3+ messages in thread
From: Christian König @ 2017-12-20  9:16 UTC (permalink / raw)
  To: Yu, Xiangliang, José Pekkarinen,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org

Am 20.12.2017 um 03:44 schrieb Yu, Xiangliang:
>> This patch releases the mutex held soon before entering the initialization
>> function in case the device doesn't support mxgpu.
>>
>> Signed-off-by: José Pekkarinen <koalinux@gmail.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
>> b/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
>> index c25a831f94ec..cac1d8b003e6 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
>> @@ -307,6 +307,7 @@ void xgpu_vi_init_golden_registers(struct
>> amdgpu_device *adev)
>>
>> xgpu_tonga_golden_common_all));
>>   		break;
>>   	default:
>> +		mutex_unlock(&adev->grbm_idx_mutex);
>>   		BUG_ON("Doesn't support chip type.\n");
>>   		break;
>>   	}
> The release mutex in here has no meaning as kernel will hang later.

A BUG_ON() results in killing the current process/thread. That usually 
results in a kernel hang *BECAUSE* you usually don't cleanly unlock all 
the taken locks.

So this patch is actually the first step on cleaning up the code.

BTW: Also please use BUG() + comment instead of BUG_ON() with a fixed text.

Thanks,
Christian.

> And Alex has submitted patch to check ASIC IP during detecting SRIOV, so we can't see the case anymore. Please drop the patch.
>
> Thanks!
>
>> --
>> 2.13.6
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-20  9:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-19  8:37 [PATCH] Release the mutex hold before backtracing for not supported mxgpu José Pekkarinen
     [not found] ` <20171219083732.18082-1-koalinux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-20  2:44   ` Yu, Xiangliang
     [not found]     ` <BY2PR1201MB093521CE50B95283C8A047E2EB0C0-O28G1zQ8oGkaqtME6NEo1mrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-12-20  9:16       ` Christian König

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.