All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Do gpu recovery when no job is running
@ 2020-09-09  8:56 Liu ChengZhe
  2020-09-09  9:13 ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: Liu ChengZhe @ 2020-09-09  8:56 UTC (permalink / raw)
  To: amd-gfx
  Cc: Jack Xiao, Feifei Xu, Kevin Wang, Liu ChengZhe, Tuikov Luben,
	Deucher Alexander, Xiaojie Yuan, Christian König,
	Hawking Zhang

In function flr_work, do gpu recovery when no job is running
instead of when some job is running. Because if there is job
in list, amdgpu_job_timedout will do the gpu recovery.

Signed-off-by: Liu ChengZhe <ChengZhe.Liu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 3 ++-
 drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
index 9c07014d9bd6..f5ce9a9f4cf5 100644
--- a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
+++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
@@ -262,7 +262,8 @@ static void xgpu_ai_mailbox_flr_work(struct work_struct *work)
 
 	/* Trigger recovery for world switch failure if no TDR */
 	if (amdgpu_device_should_recover_gpu(adev)
-		&& (amdgpu_device_has_job_running(adev) || adev->sdma_timeout == MAX_SCHEDULE_TIMEOUT))
+		&& (!amdgpu_device_has_job_running(adev) ||
+		adev->sdma_timeout == MAX_SCHEDULE_TIMEOUT))
 		amdgpu_device_gpu_recover(adev, NULL);
 }
 
diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c
index 9c23abf9b140..666ed99cc14b 100644
--- a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c
@@ -283,7 +283,7 @@ static void xgpu_nv_mailbox_flr_work(struct work_struct *work)
 
 	/* Trigger recovery for world switch failure if no TDR */
 	if (amdgpu_device_should_recover_gpu(adev)
-		&& (amdgpu_device_has_job_running(adev) ||
+		&& (!amdgpu_device_has_job_running(adev) ||
 		adev->sdma_timeout == MAX_SCHEDULE_TIMEOUT ||
 		adev->gfx_timeout == MAX_SCHEDULE_TIMEOUT ||
 		adev->compute_timeout == MAX_SCHEDULE_TIMEOUT ||
-- 
2.25.1

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

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

* Re: [PATCH] drm/amdgpu: Do gpu recovery when no job is running
  2020-09-09  8:56 [PATCH] drm/amdgpu: Do gpu recovery when no job is running Liu ChengZhe
@ 2020-09-09  9:13 ` Christian König
  2020-09-09 18:34   ` Luben Tuikov
  0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2020-09-09  9:13 UTC (permalink / raw)
  To: Liu ChengZhe, amd-gfx
  Cc: Jack Xiao, Feifei Xu, Kevin Wang, Tuikov Luben,
	Deucher Alexander, Xiaojie Yuan, Hawking Zhang

Am 09.09.20 um 10:56 schrieb Liu ChengZhe:
> In function flr_work, do gpu recovery when no job is running
> instead of when some job is running. Because if there is job
> in list, amdgpu_job_timedout will do the gpu recovery.

Maybe write something like "Fix the logic by inverting it".

With that the patch is Acked-by: Christian König <christian.koenig@amd.com>

>
> Signed-off-by: Liu ChengZhe <ChengZhe.Liu@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 3 ++-
>   drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c | 2 +-
>   2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
> index 9c07014d9bd6..f5ce9a9f4cf5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
> @@ -262,7 +262,8 @@ static void xgpu_ai_mailbox_flr_work(struct work_struct *work)
>   
>   	/* Trigger recovery for world switch failure if no TDR */
>   	if (amdgpu_device_should_recover_gpu(adev)
> -		&& (amdgpu_device_has_job_running(adev) || adev->sdma_timeout == MAX_SCHEDULE_TIMEOUT))
> +		&& (!amdgpu_device_has_job_running(adev) ||
> +		adev->sdma_timeout == MAX_SCHEDULE_TIMEOUT))
>   		amdgpu_device_gpu_recover(adev, NULL);
>   }
>   
> diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c
> index 9c23abf9b140..666ed99cc14b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c
> @@ -283,7 +283,7 @@ static void xgpu_nv_mailbox_flr_work(struct work_struct *work)
>   
>   	/* Trigger recovery for world switch failure if no TDR */
>   	if (amdgpu_device_should_recover_gpu(adev)
> -		&& (amdgpu_device_has_job_running(adev) ||
> +		&& (!amdgpu_device_has_job_running(adev) ||
>   		adev->sdma_timeout == MAX_SCHEDULE_TIMEOUT ||
>   		adev->gfx_timeout == MAX_SCHEDULE_TIMEOUT ||
>   		adev->compute_timeout == MAX_SCHEDULE_TIMEOUT ||

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

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

* Re: [PATCH] drm/amdgpu: Do gpu recovery when no job is running
  2020-09-09  9:13 ` Christian König
@ 2020-09-09 18:34   ` Luben Tuikov
  0 siblings, 0 replies; 4+ messages in thread
From: Luben Tuikov @ 2020-09-09 18:34 UTC (permalink / raw)
  To: Christian König, Liu ChengZhe, amd-gfx
  Cc: Jack Xiao, Feifei Xu, Kevin Wang, Deucher Alexander,
	Hawking Zhang, Xiaojie Yuan

On 2020-09-09 5:13 a.m., Christian König wrote:
> Am 09.09.20 um 10:56 schrieb Liu ChengZhe:
>> In function flr_work, do gpu recovery when no job is running
>> instead of when some job is running. Because if there is job
                                                           ^a
>> in list, amdgpu_job_timedout will do the gpu recovery.
     ^the                               ^remove "the".

To become: "is a job in the list", and "will do GPU recovery."

> 
> Maybe write something like "Fix the logic by inverting it".

Your commit message is fine, but as Christian pointed out,
_add_ a sentence to the commit message, possibly in a new
paragraph, simply stating that you're inverting the logic,
possibly just cutting and pasting what he wrote above.

Regards,
Luben

> 
> With that the patch is Acked-by: Christian König <christian.koenig@amd.com>
> 
>>
>> Signed-off-by: Liu ChengZhe <ChengZhe.Liu@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 3 ++-
>>   drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c | 2 +-
>>   2 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
>> index 9c07014d9bd6..f5ce9a9f4cf5 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
>> @@ -262,7 +262,8 @@ static void xgpu_ai_mailbox_flr_work(struct work_struct *work)
>>   
>>   	/* Trigger recovery for world switch failure if no TDR */
>>   	if (amdgpu_device_should_recover_gpu(adev)
>> -		&& (amdgpu_device_has_job_running(adev) || adev->sdma_timeout == MAX_SCHEDULE_TIMEOUT))
>> +		&& (!amdgpu_device_has_job_running(adev) ||
>> +		adev->sdma_timeout == MAX_SCHEDULE_TIMEOUT))
>>   		amdgpu_device_gpu_recover(adev, NULL);
>>   }
>>   
>> diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c
>> index 9c23abf9b140..666ed99cc14b 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c
>> @@ -283,7 +283,7 @@ static void xgpu_nv_mailbox_flr_work(struct work_struct *work)
>>   
>>   	/* Trigger recovery for world switch failure if no TDR */
>>   	if (amdgpu_device_should_recover_gpu(adev)
>> -		&& (amdgpu_device_has_job_running(adev) ||
>> +		&& (!amdgpu_device_has_job_running(adev) ||
>>   		adev->sdma_timeout == MAX_SCHEDULE_TIMEOUT ||
>>   		adev->gfx_timeout == MAX_SCHEDULE_TIMEOUT ||
>>   		adev->compute_timeout == MAX_SCHEDULE_TIMEOUT ||
> 

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

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

* [PATCH] drm/amdgpu: Do gpu recovery when no job is running
@ 2020-09-09  9:32 Liu ChengZhe
  0 siblings, 0 replies; 4+ messages in thread
From: Liu ChengZhe @ 2020-09-09  9:32 UTC (permalink / raw)
  To: amd-gfx
  Cc: Jack Xiao, Feifei Xu, Kevin Wang, Liu ChengZhe, Tuikov Luben,
	Deucher Alexander, Xiaojie Yuan, Christian König,
	Hawking Zhang

In function flr_work, we should do gpu recovery when no job
is running. Fix the logic by inverting it.

v2: modify the description

Signed-off-by: Liu ChengZhe <ChengZhe.Liu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 3 ++-
 drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
index 9c07014d9bd6..f5ce9a9f4cf5 100644
--- a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
+++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
@@ -262,7 +262,8 @@ static void xgpu_ai_mailbox_flr_work(struct work_struct *work)
 
 	/* Trigger recovery for world switch failure if no TDR */
 	if (amdgpu_device_should_recover_gpu(adev)
-		&& (amdgpu_device_has_job_running(adev) || adev->sdma_timeout == MAX_SCHEDULE_TIMEOUT))
+		&& (!amdgpu_device_has_job_running(adev) ||
+		adev->sdma_timeout == MAX_SCHEDULE_TIMEOUT))
 		amdgpu_device_gpu_recover(adev, NULL);
 }
 
diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c
index 9c23abf9b140..666ed99cc14b 100644
--- a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c
@@ -283,7 +283,7 @@ static void xgpu_nv_mailbox_flr_work(struct work_struct *work)
 
 	/* Trigger recovery for world switch failure if no TDR */
 	if (amdgpu_device_should_recover_gpu(adev)
-		&& (amdgpu_device_has_job_running(adev) ||
+		&& (!amdgpu_device_has_job_running(adev) ||
 		adev->sdma_timeout == MAX_SCHEDULE_TIMEOUT ||
 		adev->gfx_timeout == MAX_SCHEDULE_TIMEOUT ||
 		adev->compute_timeout == MAX_SCHEDULE_TIMEOUT ||
-- 
2.25.1

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

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

end of thread, other threads:[~2020-09-09 18:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-09  8:56 [PATCH] drm/amdgpu: Do gpu recovery when no job is running Liu ChengZhe
2020-09-09  9:13 ` Christian König
2020-09-09 18:34   ` Luben Tuikov
2020-09-09  9:32 Liu ChengZhe

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.