Skip to contentSkip to conversation

drm/amdgpu: skip ip dump if devcoredump flag is set

PATCH In review Sunil Khatri 4 participants 4 messages Apr 25, 2024

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

PATCH 1/1 drm/amdgpu: skip ip dump if devcoredump flag is set

Do not dump the ip registers during driver reload
in passthrough environment.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -4
index 869256394136..b50758482530 100644
@@ -5372,10 +5372,12 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,
 		amdgpu_reset_reg_dumps(tmp_adev);
 
 	/* Trigger ip dump before we reset the asic */
-	for (i = 0; i < tmp_adev->num_ip_blocks; i++)
-		if (tmp_adev->ip_blocks[i].version->funcs->dump_ip_state)
-			tmp_adev->ip_blocks[i].version->funcs->dump_ip_state(
-				(void *)tmp_adev);
+	if (!test_bit(AMDGPU_SKIP_COREDUMP, &reset_context->flags)) {
+		for (i = 0; i < tmp_adev->num_ip_blocks; i++)
+			if (tmp_adev->ip_blocks[i].version->funcs->dump_ip_state)
+				tmp_adev->ip_blocks[i].version->funcs
+				->dump_ip_state((void *)tmp_adev);
+	}
 
 	reset_context->reset_device_list = device_list_handle;
 	r = amdgpu_reset_perform_reset(tmp_adev, reset_context);
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Sunil Khatri

Do not dump the ip registers during driver reload
in passthrough environment.

Quoted 28 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -5
index 869256394136..b50758482530 100644
@@ -5372,10 +5372,12 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,
                amdgpu_reset_reg_dumps(tmp_adev);
 
        /* Trigger ip dump before we reset the asic */
-       for (i = 0; i < tmp_adev->num_ip_blocks; i++)
-               if (tmp_adev->ip_blocks[i].version->funcs->dump_ip_state)
-                       tmp_adev->ip_blocks[i].version->funcs->dump_ip_state(
-                               (void *)tmp_adev);
+       if (!test_bit(AMDGPU_SKIP_COREDUMP, &reset_context->flags)) {
+               for (i = 0; i < tmp_adev->num_ip_blocks; i++)
+                       if (tmp_adev->ip_blocks[i].version->funcs->dump_ip_state)
+                               tmp_adev->ip_blocks[i].version->funcs
+                               ->dump_ip_state((void *)tmp_adev);
+       }
 
        reset_context->reset_device_list = device_list_handle;
        r = amdgpu_reset_perform_reset(tmp_adev, reset_context);
--

2.34.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to Sunil Khatri
Quoted 13 lines · Sunil Khatri

Do not dump the ip registers during driver reload
in passthrough environment.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 869256394136..b50758482530 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_do_asic_reset(struct list_head *device_list_handle, · line 5372

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
@@ -5372,10 +5372,12 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,
 		amdgpu_reset_reg_dumps(tmp_adev);

Probably not related, can the above step be clubbed with what's being done below? Or, can we move all such to start with amdgpu_reset_dump_*?

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_do_asic_reset(struct list_head *device_list_handle, · line 5380

Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -4
 	/* Trigger ip dump before we reset the asic */
-	for (i = 0; i < tmp_adev->num_ip_blocks; i++)
-		if (tmp_adev->ip_blocks[i].version->funcs->dump_ip_state)
-			tmp_adev->ip_blocks[i].version->funcs->dump_ip_state(
-				(void *)tmp_adev);
+	if (!test_bit(AMDGPU_SKIP_COREDUMP, &reset_context->flags)) {
+		for (i = 0; i < tmp_adev->num_ip_blocks; i++)
+			if (tmp_adev->ip_blocks[i].version->funcs->dump_ip_state)
+				tmp_adev->ip_blocks[i].version->funcs
+				->dump_ip_state((void *)tmp_adev);
+	}

Anyway,

Thanks,
Lijo

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
 	reset_context->reset_device_list = device_list_handle;
 	r = amdgpu_reset_perform_reset(tmp_adev, reset_context);
#3 lore raw
Quoted 10 lines · Lijo
Quoted 8 lines · Sunil Khatri

Do not dump the ip registers during driver reload
in passthrough environment.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++----
  1 file changed, 6 insertions(+), 4 deletions(-)
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_do_asic_reset(struct list_head *device_list_handle, · line 5372

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 869256394136..b50758482530 100644
@@ -5372,10 +5372,12 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,
  		amdgpu_reset_reg_dumps(tmp_adev);

Probably not related, can the above step be clubbed with what's being done below? Or, can we move all such to start with amdgpu_reset_dump_*?

Sure lizo

I will club both dump_ip_state and amdgpu_reset_reg_dumps under one if condition in the patch to push.

Regards Sunil

Quoted 22 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_do_asic_reset(struct list_head *device_list_handle, · line 5380

Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -4
  	/* Trigger ip dump before we reset the asic */
-	for (i = 0; i < tmp_adev->num_ip_blocks; i++)
-		if (tmp_adev->ip_blocks[i].version->funcs->dump_ip_state)
-			tmp_adev->ip_blocks[i].version->funcs->dump_ip_state(
-				(void *)tmp_adev);
+	if (!test_bit(AMDGPU_SKIP_COREDUMP, &reset_context->flags)) {
+		for (i = 0; i < tmp_adev->num_ip_blocks; i++)
+			if (tmp_adev->ip_blocks[i].version->funcs->dump_ip_state)
+				tmp_adev->ip_blocks[i].version->funcs
+				->dump_ip_state((void *)tmp_adev);
+	}

Anyway,

Thanks,
Lijo

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
  	reset_context->reset_device_list = device_list_handle;
  	r = amdgpu_reset_perform_reset(tmp_adev, reset_context);