Skip to contentSkip to conversation

drm/amdgpu/atomfirmware: add function to update engine hang status

PATCH In review Alex Deucher 4 participants 6 messages May 5, 2017 – May 9, 2017 4 messages not in the archive

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

PATCH 1/2 drm/amdgpu/atomfirmware: add function to update engine hang status

Update the scratch reg for when the engine is hung.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 13 +++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h |  2 ++
 2 files changed, 15 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +13 -0
index d735cd1..4bdda56 100644
@@ -88,6 +88,19 @@ void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev)
 		WREG32(adev->bios_scratch_reg_offset + i, adev->bios_scratch[i]);
 }
 
+void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev,
+						  bool hung)
+{
+	u32 tmp = RREG32(adev->bios_scratch_reg_offset + 3);
+
+	if (hung)
+		tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG;
+	else
+		tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG;
+
+	WREG32(adev->bios_scratch_reg_offset + 3, tmp);
+}
+
 int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev)
 {
 	struct atom_context *ctx = adev->mode_info.atom_context;
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h +2 -0
index d0c4dcd..a2c3ebe 100644
@@ -28,6 +28,8 @@ bool amdgpu_atomfirmware_gpu_supports_virtualization(struct amdgpu_device *adev)
 void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device *adev);
 void amdgpu_atomfirmware_scratch_regs_save(struct amdgpu_device *adev);
 void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev);
+void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev,
+						  bool hung);
 int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev);
 
 #endif
Signature · 6 lines
2.5.5

_______________________________________________
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): 1493994447-20285-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/2 drm/amdgpu/soc15: use atomfirmware for setting bios scratch for reset

Need to use the atomfirmware interface rather than atombios since soc15 is atomfirmware based.

---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +3 -3
index 79af896..b04f929 100644
@@ -25,7 +25,7 @@
 #include <linux/module.h>
 #include "drmP.h"
 #include "amdgpu.h"
-#include "amdgpu_atombios.h"
+#include "amdgpu_atomfirmware.h"
 #include "amdgpu_ih.h"
 #include "amdgpu_uvd.h"
 #include "amdgpu_vce.h"
@@ -392,11 +392,11 @@ static void soc15_gpu_pci_config_reset(struct amdgpu_device *adev)
 
 static int soc15_asic_reset(struct amdgpu_device *adev)
 {
-	amdgpu_atombios_scratch_regs_engine_hung(adev, true);
+	amdgpu_atomfirmware_scratch_regs_engine_hung(adev, true);
 
 	soc15_gpu_pci_config_reset(adev);
 
-	amdgpu_atombios_scratch_regs_engine_hung(adev, false);
+	amdgpu_atomfirmware_scratch_regs_engine_hung(adev, false);
 
 	return 0;
 }
Signature · 6 lines
2.5.5

_______________________________________________
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): 1493994447-20285-2-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#4 lore raw

Re: [PATCH 2/2] drm/amdgpu/soc15: use atomfirmware for setting bios scratch for reset

Quoted 4 lines · Alex Deucher

Need to use the atomfirmware interface rather than atombios since soc15 is atomfirmware based.

The series is Reviewed-by: Chunming Zhou <[email protected]>

Quoted 21 lines
---
  drivers/gpu/drm/amd/amdgpu/soc15.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -1
index 79af896..b04f929 100644
@@ -25,7 +25,7 @@
  #include <linux/module.h>
  #include "drmP.h"
  #include "amdgpu.h"
-#include "amdgpu_atombios.h"
+#include "amdgpu_atomfirmware.h"
  #include "amdgpu_ih.h"
  #include "amdgpu_uvd.h"
  #include "amdgpu_vce.h"
@@ -392,11 +392,11 @@ static void soc15_gpu_pci_config_reset(struct amdgpu_device *adev)
 
  static int soc15_asic_reset(struct amdgpu_device *adev)
  {

drivers/gpu/drm/amd/amdgpu/soc15.c static void soc15_gpu_pci_config_reset(struct amdgpu_device *adev) · line 402

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/soc15.c +2 -2
-	amdgpu_atombios_scratch_regs_engine_hung(adev, true);
+	amdgpu_atomfirmware_scratch_regs_engine_hung(adev, true);
 
  	soc15_gpu_pci_config_reset(adev);
 
-	amdgpu_atombios_scratch_regs_engine_hung(adev, false);
+	amdgpu_atomfirmware_scratch_regs_engine_hung(adev, false);
 
  	return 0;
  }

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

#5 lore raw
In reply to a message not in the archive
Quoted 3 lines · Alex Deucher

Update the scratch reg for when the engine is hung.

ping on this series.

Alex

Quoted 43 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 13 +++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h |  2 ++
 2 files changed, 15 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +13 -0
index d735cd1..4bdda56 100644
@@ -88,6 +88,19 @@ void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev)
                WREG32(adev->bios_scratch_reg_offset + i, adev->bios_scratch[i]);
 }
 
+void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev,
+                                                 bool hung)
+{
+       u32 tmp = RREG32(adev->bios_scratch_reg_offset + 3);
+
+       if (hung)
+               tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG;
+       else
+               tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG;
+
+       WREG32(adev->bios_scratch_reg_offset + 3, tmp);
+}
+
 int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev)
 {
        struct atom_context *ctx = adev->mode_info.atom_context;
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h +2 -1
index d0c4dcd..a2c3ebe 100644
@@ -28,6 +28,8 @@ bool amdgpu_atomfirmware_gpu_supports_virtualization(struct amdgpu_device *adev)
 void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device *adev);
 void amdgpu_atomfirmware_scratch_regs_save(struct amdgpu_device *adev);
 void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev);
+void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev,
+                                                 bool hung);
 int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev);
 
 #endif
--
Quoted 2 lines

2.5.5

_______________________________________________
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): CADnq5_M4M47SvQdaC550Sc89Zu2oXRDXa2MjTEZuN4NsjqcXeA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#7 lore raw
Quoted 7 lines · Alex Deucher
Quoted 3 lines · Alex Deucher

Update the scratch reg for when the engine is hung.

ping on this series.

I'm not an expert on this and haven't had a chance to look up the atomfirmware definitions but this looks reasonable to me.

Harry

Quoted 43 lines

Alex

Quoted 41 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 13 +++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h |  2 ++
 2 files changed, 15 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +13 -0
index d735cd1..4bdda56 100644
@@ -88,6 +88,19 @@ void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev)
                WREG32(adev->bios_scratch_reg_offset + i, adev->bios_scratch[i]);
 }
 
+void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev,
+                                                 bool hung)
+{
+       u32 tmp = RREG32(adev->bios_scratch_reg_offset + 3);
+
+       if (hung)
+               tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG;
+       else
+               tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG;
+
+       WREG32(adev->bios_scratch_reg_offset + 3, tmp);
+}
+
 int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev)
 {
        struct atom_context *ctx = adev->mode_info.atom_context;
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h +2 -0
index d0c4dcd..a2c3ebe 100644
@@ -28,6 +28,8 @@ bool amdgpu_atomfirmware_gpu_supports_virtualization(struct amdgpu_device *adev)
 void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device *adev);
 void amdgpu_atomfirmware_scratch_regs_save(struct amdgpu_device *adev);
 void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev);
+void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev,
+                                                 bool hung);
 int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev);
 
Quoted 9 lines
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h +0 -1
 #endif
--

2.5.5

_______________________________________________
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

A message that is not in the archive (sent off-list or not yet received): 039ed304-e365-ba38-1501-4e81fee639d1-5C7GfCeVMHo@public.gmane.org

#9 lore raw

Am 08.05.2017 um 22:43 schrieb Harry Wentland:

Quoted 10 lines · Alex Deucher
Quoted 7 lines · Alex Deucher
Quoted 3 lines

Update the scratch reg for when the engine is hung.

ping on this series.

I'm not an expert on this and haven't had a chance to look up the atomfirmware definitions but this looks reasonable to me.

Dito. Problem is as far as I know nobody else is deeply into atombios and reviewing patches.

Quoted 1 line

Christian.

Quoted 66 lines

Harry

Quoted 53 lines

Alex

Quoted 51 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 13 +++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h |  2 ++
 2 files changed, 15 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +13 -0
index d735cd1..4bdda56 100644
@@ -88,6 +88,19 @@ void 
 amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev)
                WREG32(adev->bios_scratch_reg_offset + i, 
 adev->bios_scratch[i]);
 }
 
+void amdgpu_atomfirmware_scratch_regs_engine_hung(struct 
 amdgpu_device *adev,
+                                                 bool hung)
+{
+       u32 tmp = RREG32(adev->bios_scratch_reg_offset + 3);
+
+       if (hung)
+               tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG;
+       else
+               tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG;
+
+       WREG32(adev->bios_scratch_reg_offset + 3, tmp);
+}
+

int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device
*adev)

 {
        struct atom_context *ctx = adev->mode_info.atom_context;
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h +0 -0
index d0c4dcd..a2c3ebe 100644
@@ -28,6 +28,8 @@ bool 
 amdgpu_atomfirmware_gpu_supports_virtualization(struct amdgpu_device *adev)
 void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device 
 *adev);
 void amdgpu_atomfirmware_scratch_regs_save(struct amdgpu_device 
 *adev);
 void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device 

*adev);
+void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev,
+ bool hung);
int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device
*adev);

Quoted 9 lines
Quoted 4 lines

#endif

Signature · 1 line
2.5.5

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

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