Skip to contentSkip to conversation

drm/amdgpu: fix the nullptr issue as for PWR IP not existing in discovery table

PATCH In review Prike.Liang 3 participants 3 messages Jun 5, 2020 – Jun 10, 2020

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

PATCH 1/1 drm/amdgpu: fix the nullptr issue as for PWR IP not existing in discovery table

fix e467ab869f57 drm/amdgpu: use IP discovery table for renoir.

This nullptr issue should be specific on the Renoir series during try access the PWR_MISC_CNTL_STATUS when PWR IP not been detected by discovery table. Moreover the PWR IP not existing in Renoir series is expected therefore just avoid access PWR register in Renoir series.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -2
index 22943773..6b94587 100644
@@ -2856,8 +2856,8 @@ static void gfx_v9_0_init_gfx_power_gating(struct amdgpu_device *adev)
 		/* program GRBM_REG_SAVE_GFX_IDLE_THRESHOLD to 0x55f0 */
 		data |= (0x55f0 << RLC_AUTO_PG_CTRL__GRBM_REG_SAVE_GFX_IDLE_THRESHOLD__SHIFT);
 		WREG32(SOC15_REG_OFFSET(GC, 0, mmRLC_AUTO_PG_CTRL), data);
-
-		pwr_10_0_gfxip_control_over_cgpg(adev, true);
+		if (adev->asic_type != CHIP_RENOIR)
+			pwr_10_0_gfxip_control_over_cgpg(adev, true);
 	}
 }
 
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw
Quoted 16 lines · Prike.Liang

fix e467ab869f57 drm/amdgpu: use IP discovery table for renoir.

This nullptr issue should be specific on the Renoir series during try access the PWR_MISC_CNTL_STATUS when PWR IP not been detected by discovery table. Moreover the PWR IP not existing in Renoir series is expected therefore just avoid access PWR register in Renoir series.

---
  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -0
index 22943773..6b94587 100644

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_init_gfx_power_gating(struct amdgpu_device *adev) · line 2859

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -2
@@ -2856,8 +2856,8 @@ static void gfx_v9_0_init_gfx_power_gating(struct amdgpu_device *adev)
  		/* program GRBM_REG_SAVE_GFX_IDLE_THRESHOLD to 0x55f0 */
  		data |= (0x55f0 << RLC_AUTO_PG_CTRL__GRBM_REG_SAVE_GFX_IDLE_THRESHOLD__SHIFT);
  		WREG32(SOC15_REG_OFFSET(GC, 0, mmRLC_AUTO_PG_CTRL), data);
-
-		pwr_10_0_gfxip_control_over_cgpg(adev, true);
+		if (adev->asic_type != CHIP_RENOIR)

You should move that check inside pwr_10_0_gfxip_control_over_cgpg() for better understanding.

Otherwise Acked-by: Nirmoy Das <[email protected]>

Nirmoy

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_init_gfx_power_gating(struct amdgpu_device *adev) · line 2863

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -0
+			pwr_10_0_gfxip_control_over_cgpg(adev, true);
  	}
  }
 

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

Acked-by on v1 1/1
#2 lore raw
In reply to Prike.Liang
Quoted 30 lines · Prike.Liang

fix e467ab869f57 drm/amdgpu: use IP discovery table for renoir.

This nullptr issue should be specific on the Renoir series during try access the PWR_MISC_CNTL_STATUS when PWR IP not been detected by discovery table. Moreover the PWR IP not existing in Renoir series is expected therefore just avoid access PWR register in Renoir series.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -3
index 22943773..6b94587 100644
@@ -2856,8 +2856,8 @@ static void gfx_v9_0_init_gfx_power_gating(struct amdgpu_device *adev)
                /* program GRBM_REG_SAVE_GFX_IDLE_THRESHOLD to 0x55f0 */
                data |= (0x55f0 << RLC_AUTO_PG_CTRL__GRBM_REG_SAVE_GFX_IDLE_THRESHOLD__SHIFT);
                WREG32(SOC15_REG_OFFSET(GC, 0, mmRLC_AUTO_PG_CTRL), data);
-
-               pwr_10_0_gfxip_control_over_cgpg(adev, true);
+               if (adev->asic_type != CHIP_RENOIR)
+                       pwr_10_0_gfxip_control_over_cgpg(adev, true);
        }
 }
 
--

2.7.4

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