Skip to contentSkip to conversation

drm/amdgpu: Fix undue fallthroughs in golden registers initialization

PATCH Applied Jean Delvare 3 participants 3 messages Jul 30, 2017 – Jul 31, 2017

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

PATCH 1/1 drm/amdgpu: Fix undue fallthroughs in golden registers initialization

As I was staring at the si_init_golden_registers code, I noticed that the Pitcairn initialization silently falls through the Cape Verde initialization, and the Oland initialization falls through the Hainan initialization. However there is no comment stating that this is intentional, and the radeon driver doesn't have any such fallthrough, so I suspect this is not supposed to happen.

Fixes 62a37553414a ("drm/amdgpu: add si implementation v10")
Cc Ken Wang <[email protected]>
Cc Alex Deucher <[email protected]>
Cc "Marek Olšák" <[email protected]>
Cc "Christian König" <[email protected]>
Cc Flora Cui <[email protected]>

---
If the fallthroughs are really supposed to happen, comments should be added that say so. Surprisingly it doesn't seem to make any difference on my Oland card.

 drivers/gpu/drm/amd/amdgpu/si.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/si.c +2 -0
@@ -1385,6 +1385,7 @@ static void si_init_golden_registers(str
 		amdgpu_program_register_sequence(adev,
 						 pitcairn_mgcg_cgcg_init,
 						 (const u32)ARRAY_SIZE(pitcairn_mgcg_cgcg_init));
+		break;
 	case CHIP_VERDE:
 		amdgpu_program_register_sequence(adev,
 						 verde_golden_registers,
@@ -1409,6 +1410,7 @@ static void si_init_golden_registers(str
 		amdgpu_program_register_sequence(adev,
 						 oland_mgcg_cgcg_init,
 						 (const u32)ARRAY_SIZE(oland_mgcg_cgcg_init));
+		break;
 	case CHIP_HAINAN:
 		amdgpu_program_register_sequence(adev,
 						 hainan_golden_registers,
Signature · 6 lines
Jean Delvare
SUSE L3 Support
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

Marek

Quoted 46 lines · Jean Delvare

As I was staring at the si_init_golden_registers code, I noticed that the Pitcairn initialization silently falls through the Cape Verde initialization, and the Oland initialization falls through the Hainan initialization. However there is no comment stating that this is intentional, and the radeon driver doesn't have any such fallthrough, so I suspect this is not supposed to happen.

Fixes 62a37553414a ("drm/amdgpu: add si implementation v10")
Cc Ken Wang <[email protected]>
Cc Alex Deucher <[email protected]>
Cc "Marek Olšák" <[email protected]>
Cc "Christian König" <[email protected]>
Cc Flora Cui <[email protected]>

---
If the fallthroughs are really supposed to happen, comments should be added that say so. Surprisingly it doesn't seem to make any difference on my Oland card.

 drivers/gpu/drm/amd/amdgpu/si.c |    2 ++
 1 file changed, 2 insertions(+)

--- linux-4.12.orig/drivers/gpu/drm/amd/amdgpu/si.c 2017-07-30
09:25:46.891083334 +0200
+++ linux-4.12/drivers/gpu/drm/amd/amdgpu/si.c 2017-07-30 09:45:24.350188642 +0200

drivers/gpu/drm/amd/amdgpu/si.c +1 -0
@@ -1385,6 +1385,7 @@ static void si_init_golden_registers(str
                amdgpu_program_register_sequence(adev,
                                                 pitcairn_mgcg_cgcg_init,
                                                 (const
 u32)ARRAY_SIZE(pitcairn_mgcg_cgcg_init));
+               break;
        case CHIP_VERDE:
                amdgpu_program_register_sequence(adev,

verde_golden_registers,

drivers/gpu/drm/amd/amdgpu/si.c +1 -0
@@ -1409,6 +1410,7 @@ static void si_init_golden_registers(str
                amdgpu_program_register_sequence(adev,
                                                 oland_mgcg_cgcg_init,
                                                 (const
 u32)ARRAY_SIZE(oland_mgcg_cgcg_init));
+               break;
        case CHIP_HAINAN:
                amdgpu_program_register_sequence(adev,

hainan_golden_registers,

Quoted 4 lines

--
Jean Delvare
SUSE L3 Support

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

Applied
#2 lore raw
Quoted 20 lines · Marek Olšák

Marek

Quoted 15 lines · Jean Delvare

As I was staring at the si_init_golden_registers code, I noticed that the Pitcairn initialization silently falls through the Cape Verde initialization, and the Oland initialization falls through the Hainan initialization. However there is no comment stating that this is intentional, and the radeon driver doesn't have any such fallthrough, so I suspect this is not supposed to happen.

Fixes 62a37553414a ("drm/amdgpu: add si implementation v10")
Cc Ken Wang <[email protected]>
Cc Alex Deucher <[email protected]>
Cc "Marek Olšák" <[email protected]>
Cc "Christian König" <[email protected]>
Cc Flora Cui <[email protected]>

Applied. thanks!

Alex

Quoted 32 lines
Quoted 32 lines

---
If the fallthroughs are really supposed to happen, comments should be added that say so. Surprisingly it doesn't seem to make any difference on my Oland card.

 drivers/gpu/drm/amd/amdgpu/si.c |    2 ++
 1 file changed, 2 insertions(+)

--- linux-4.12.orig/drivers/gpu/drm/amd/amdgpu/si.c 2017-07-30
09:25:46.891083334 +0200
+++ linux-4.12/drivers/gpu/drm/amd/amdgpu/si.c 2017-07-30 09:45:24.350188642 +0200

drivers/gpu/drm/amd/amdgpu/si.c +1 -0
@@ -1385,6 +1385,7 @@ static void si_init_golden_registers(str
                amdgpu_program_register_sequence(adev,
                                                 pitcairn_mgcg_cgcg_init,
                                                 (const
 u32)ARRAY_SIZE(pitcairn_mgcg_cgcg_init));
+               break;
        case CHIP_VERDE:
                amdgpu_program_register_sequence(adev,

verde_golden_registers,

drivers/gpu/drm/amd/amdgpu/si.c +1 -0
@@ -1409,6 +1410,7 @@ static void si_init_golden_registers(str
                amdgpu_program_register_sequence(adev,
                                                 oland_mgcg_cgcg_init,
                                                 (const
 u32)ARRAY_SIZE(oland_mgcg_cgcg_init));
+               break;
        case CHIP_HAINAN:
                amdgpu_program_register_sequence(adev,

hainan_golden_registers,

Quoted 11 lines
Quoted 3 lines

--
Jean Delvare
SUSE L3 Support

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

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