Skip to contentSkip to conversation

drm/amdgpu: Always call kfd post reset after reset

PATCH In review Shaoyun Liu 4 participants 5 messages Apr 11, 2018 – Apr 24, 2018 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Always call kfd post reset after reset

Even reset failed, kfd post reset need to be called to make lock balance on kfd side

Change-Id I8b6ef29d7527915611be0b96a9cd039bc75bb0a9
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -4
index 78b7d39..90a37ed 100644
@@ -3231,12 +3231,11 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
 		/* bad news, how to tell it to userspace ? */
 		dev_info(adev->dev, "GPU reset(%d) failed\n", atomic_read(&adev->gpu_reset_counter));
 		amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_GPU_RESET_FAIL, 0, r);
-	} else {
+	} else
 		dev_info(adev->dev, "GPU reset(%d) successed!\n",atomic_read(&adev->gpu_reset_counter));
-		/*unlock kfd after a successfully recovery*/
-		amdgpu_amdkfd_post_reset(adev);
-	}
 
+	/*unlock kfd */
+	amdgpu_amdkfd_post_reset(adev);
 	amdgpu_vf_error_trans_all(adev);
 	adev->in_gpu_reset = 0;
 	mutex_unlock(&adev->lock_reset);
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1523476037-25006-1-git-send-email-Shaoyun.Liu-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 5 lines · Shaoyun Liu

Even reset failed, kfd post reset need to be called to make lock balance on kfd side

Change-Id I8b6ef29d7527915611be0b96a9cd039bc75bb0a9
Quoted 27 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -5
index 78b7d39..90a37ed 100644
@@ -3231,12 +3231,11 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
                /* bad news, how to tell it to userspace ? */
                dev_info(adev->dev, "GPU reset(%d) failed\n", atomic_read(&adev->gpu_reset_counter));
                amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_GPU_RESET_FAIL, 0, r);
-       } else {
+       } else
                dev_info(adev->dev, "GPU reset(%d) successed!\n",atomic_read(&adev->gpu_reset_counter));
-               /*unlock kfd after a successfully recovery*/
-               amdgpu_amdkfd_post_reset(adev);
-       }
 
+       /*unlock kfd */
+       amdgpu_amdkfd_post_reset(adev);
        amdgpu_vf_error_trans_all(adev);
        adev->in_gpu_reset = 0;
        mutex_unlock(&adev->lock_reset);
--

1.9.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw
In reply to a message not in the archive
Quoted 14 lines · Shaoyun Liu

Even reset failed, kfd post reset need to be called to make lock balance on kfd side

Change-Id I8b6ef29d7527915611be0b96a9cd039bc75bb0a9
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 78b7d39..90a37ed 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_gpu_recover(struct amdgpu_device *adev, · line 3238

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -4
@@ -3231,12 +3231,11 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
 		/* bad news, how to tell it to userspace ? */
 		dev_info(adev->dev, "GPU reset(%d) failed\n", atomic_read(&adev->gpu_reset_counter));
 		amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_GPU_RESET_FAIL, 0, r);
-	} else {
+	} else
 		dev_info(adev->dev, "GPU reset(%d) successed!\n",atomic_read(&adev->gpu_reset_counter));
-		/*unlock kfd after a successfully recovery*/
-		amdgpu_amdkfd_post_reset(adev);
-	}

Please leave the braces {...}. It's better style to make all branches of the same if-else-if-...-else use the same braces (or no-braces). With that fixed, this change is Reviewed-by: Felix Kuehling <[email protected]>

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_gpu_recover(struct amdgpu_device *adev, · line 3241

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -0
+	/*unlock kfd */
+	amdgpu_amdkfd_post_reset(adev);
 	amdgpu_vf_error_trans_all(adev);
 	adev->in_gpu_reset = 0;
 	mutex_unlock(&adev->lock_reset);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): f720599f-a34e-2214-a01c-c905af498dda-5C7GfCeVMHo@public.gmane.org

#5 lore raw
Quoted 37 lines · Felix Kuehling
Quoted 14 lines · Shaoyun Liu

Even reset failed, kfd post reset need to be called to make lock balance on kfd side

Change-Id I8b6ef29d7527915611be0b96a9cd039bc75bb0a9
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 78b7d39..90a37ed 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_gpu_recover(struct amdgpu_device *adev, · line 3238

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -4
@@ -3231,12 +3231,11 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
              /* bad news, how to tell it to userspace ? */
              dev_info(adev->dev, "GPU reset(%d) failed\n", atomic_read(&adev->gpu_reset_counter));
              amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_GPU_RESET_FAIL, 0, r);
-     } else {
+     } else
              dev_info(adev->dev, "GPU reset(%d) successed!\n",atomic_read(&adev->gpu_reset_counter));
-             /*unlock kfd after a successfully recovery*/
-             amdgpu_amdkfd_post_reset(adev);
-     }

Please leave the braces {...}. It's better style to make all branches of the same if-else-if-...-else use the same braces (or no-braces). With that fixed, this change is Reviewed-by: Felix Kuehling <[email protected]>

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_gpu_recover(struct amdgpu_device *adev, · line 3241

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -0
+     /*unlock kfd */
+     amdgpu_amdkfd_post_reset(adev);
      amdgpu_vf_error_trans_all(adev);
      adev->in_gpu_reset = 0;
      mutex_unlock(&adev->lock_reset);
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

I didn't find a function called "amdgpu_amdkfd_post_reset" anywhere in the code.
Maybe this patch for something internal, or is it for the Vega code that I haven't yet taken ?

Oded
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CAFCwf10kR=0vfqp5C6d6eEHz8GWXK+mT_G784dW0Se_2s+dG9g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#7 lore raw
Quoted 35 lines · Oded Gabbay
Quoted 34 lines · Felix Kuehling
Quoted 14 lines · Shaoyun Liu

Even reset failed, kfd post reset need to be called to make lock balance on kfd side

Change-Id I8b6ef29d7527915611be0b96a9cd039bc75bb0a9
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 78b7d39..90a37ed 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_gpu_recover(struct amdgpu_device *adev, · line 3238

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -4
@@ -3231,12 +3231,11 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
              /* bad news, how to tell it to userspace ? */
              dev_info(adev->dev, "GPU reset(%d) failed\n", atomic_read(&adev->gpu_reset_counter));
              amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_GPU_RESET_FAIL, 0, r);
-     } else {
+     } else
              dev_info(adev->dev, "GPU reset(%d) successed!\n",atomic_read(&adev->gpu_reset_counter));
-             /*unlock kfd after a successfully recovery*/
-             amdgpu_amdkfd_post_reset(adev);
-     }

Please leave the braces {...}. It's better style to make all branches of the same if-else-if-...-else use the same braces (or no-braces). With that fixed, this change is Reviewed-by: Felix Kuehling <[email protected]>

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -0
+     /*unlock kfd */
+     amdgpu_amdkfd_post_reset(adev);
      amdgpu_vf_error_trans_all(adev);
      adev->in_gpu_reset = 0;
      mutex_unlock(&adev->lock_reset);
Quoted 8 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

I didn't find a function called "amdgpu_amdkfd_post_reset" anywhere in the code.
Maybe this patch for something internal, or is it for the Vega code that I haven't yet taken ?

Yeah, this is related to some on-going work to support GPU hang-detection and reset. As more of our driver goes upstream, more changes will be reviewed here. Right now it's still hit and miss and people aren't sure what changes to review where.

Regards,
  Felix

Quoted 2 lines

Oded

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx