Skip to contentSkip to conversation

drm/amd/powerplay: add ECC feature bit

PATCH In review Evan Quan 3 participants 6 messages Mar 22, 2019 – Mar 28, 2019 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/2 drm/amd/powerplay: add ECC feature bit

It's OK to have this feature bit with old SMU firmwares. But the feature should be disabled on them.

Change-Id I6fb4869ef454ea7b6d01cf368b457be01eeb5058
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c  | 10 +++++++++-
 drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.h  |  1 +
 drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h |  3 ++-
 3 files changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +9 -1
index fac7a5df7c27..49be888fcd50 100644
@@ -91,6 +91,12 @@ static void vega20_set_default_registry_data(struct pp_hwmgr *hwmgr)
 	 *   MP0CLK DS
 	 */
 	data->registry_data.disallowed_features = 0xE0041C00;
+	/* ECC feature should be disabled on old SMUs */
+	smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetSmuVersion);
+	hwmgr->smu_version = smum_get_argument(hwmgr);
+	if (hwmgr->smu_version < 0x282100)
+		data->registry_data.disallowed_features |= FEATURE_ECC_MASK;
+
 	data->registry_data.od_state_in_dc_support = 0;
 	data->registry_data.thermal_support = 1;
 	data->registry_data.skip_baco_hardware = 0;
@@ -357,6 +363,7 @@ static void vega20_init_dpm_defaults(struct pp_hwmgr *hwmgr)
 	data->smu_features[GNLD_DS_MP1CLK].smu_feature_id = FEATURE_DS_MP1CLK_BIT;
 	data->smu_features[GNLD_DS_MP0CLK].smu_feature_id = FEATURE_DS_MP0CLK_BIT;
 	data->smu_features[GNLD_XGMI].smu_feature_id = FEATURE_XGMI_BIT;
+	data->smu_features[GNLD_ECC].smu_feature_id = FEATURE_ECC_BIT;
 
 	for (i = 0; i < GNLD_FEATURES_MAX; i++) {
 		data->smu_features[i].smu_feature_bitmap =
@@ -3048,7 +3055,8 @@ static int vega20_get_ppfeature_status(struct pp_hwmgr *hwmgr, char *buf)
 				"FCLK_DS",
 				"MP1CLK_DS",
 				"MP0CLK_DS",
-				"XGMI"};
+				"XGMI",
+				"ECC"};
 	static const char *output_title[] = {
 				"FEATURES",
 				"BITMASK",
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.h +1 -0
index a46cdeb7da70..c3890b5e076c 100644
@@ -81,6 +81,7 @@ enum {
 	GNLD_DS_MP1CLK,
 	GNLD_DS_MP0CLK,
 	GNLD_XGMI,
+	GNLD_ECC,
 
 	GNLD_FEATURES_MAX
 };
drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h +2 -1
index 63d5cf691549..b90089a4fb6a 100644
@@ -99,7 +99,7 @@
 #define FEATURE_DS_MP1CLK_BIT           30
 #define FEATURE_DS_MP0CLK_BIT           31
 #define FEATURE_XGMI_BIT                32
-#define FEATURE_SPARE_33_BIT            33
+#define FEATURE_ECC_BIT                 33
 #define FEATURE_SPARE_34_BIT            34
 #define FEATURE_SPARE_35_BIT            35
 #define FEATURE_SPARE_36_BIT            36
@@ -166,6 +166,7 @@
 #define FEATURE_DS_MP1CLK_MASK          (1 << FEATURE_DS_MP1CLK_BIT          )
 #define FEATURE_DS_MP0CLK_MASK          (1 << FEATURE_DS_MP0CLK_BIT          )
 #define FEATURE_XGMI_MASK               (1 << FEATURE_XGMI_BIT               )
+#define FEATURE_ECC_MASK                (1ULL << FEATURE_ECC_BIT                )
 
 #define DPM_OVERRIDE_DISABLE_SOCCLK_PID             0x00000001
 #define DPM_OVERRIDE_DISABLE_UCLK_PID               0x00000002
Signature · 6 lines
2.21.0

_______________________________________________
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): [email protected]

author
#2 lore raw

PATCH 2/2 drm/amd/powerplay: correct data type to avoid overflow

Avoid left shift overflow.

Change-Id If03f4f4d440b6d742d8eaa23d0bae6ddd21c01ea
---
 drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h +1 -1
index b90089a4fb6a..195c4ae67058 100644
@@ -165,7 +165,7 @@
 #define FEATURE_DS_FCLK_MASK            (1 << FEATURE_DS_FCLK_BIT            )
 #define FEATURE_DS_MP1CLK_MASK          (1 << FEATURE_DS_MP1CLK_BIT          )
 #define FEATURE_DS_MP0CLK_MASK          (1 << FEATURE_DS_MP0CLK_BIT          )
-#define FEATURE_XGMI_MASK               (1 << FEATURE_XGMI_BIT               )
+#define FEATURE_XGMI_MASK               (1ULL << FEATURE_XGMI_BIT               )
 #define FEATURE_ECC_MASK                (1ULL << FEATURE_ECC_BIT                )
 
 #define DPM_OVERRIDE_DISABLE_SOCCLK_PID             0x00000001
Signature · 6 lines
2.21.0

_______________________________________________
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): [email protected]

author
#4 lore raw

RE: [PATCH 2/2] drm/amd/powerplay: correct data type to avoid overflow

Ping..

Quoted 32 lines

-----Original Message-----
From: Evan Quan <[email protected]>
Sent: 2019年3月23日 2:07
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 2/2] drm/amd/powerplay: correct data type to avoid overflow

Avoid left shift overflow.

Change-Id If03f4f4d440b6d742d8eaa23d0bae6ddd21c01ea
---
 drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h +1 -1
index b90089a4fb6a..195c4ae67058 100644
@@ -165,7 +165,7 @@
 #define FEATURE_DS_FCLK_MASK            (1 << FEATURE_DS_FCLK_BIT            )
 #define FEATURE_DS_MP1CLK_MASK          (1 <<
 FEATURE_DS_MP1CLK_BIT          )
 #define FEATURE_DS_MP0CLK_MASK          (1 <<
 FEATURE_DS_MP0CLK_BIT          )
-#define FEATURE_XGMI_MASK               (1 << FEATURE_XGMI_BIT               )
+#define FEATURE_XGMI_MASK               (1ULL <<
 FEATURE_XGMI_BIT               )

#define FEATURE_ECC_MASK (1ULL << FEATURE_ECC_BIT )

Quoted 3 lines

#define DPM_OVERRIDE_DISABLE_SOCCLK_PID 0x00000001
--
2.21.0

_______________________________________________
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): MN2PR12MB3344F0FCFB363AA00DB5207BE45F0-rweVpJHSKToDMgCC8P//[email protected]

Reviewed-by
#6 lore raw

Re: [PATCH 2/2] drm/amd/powerplay: correct data type to avoid overflow

Series is:

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Quan, Evan <[email protected]>
Sent: Tuesday, March 26, 2019 6:15 AM
To: Quan, Evan; [email protected]
Subject: RE: [PATCH 2/2] drm/amd/powerplay: correct data type to avoid overflow

Ping..

Quoted 32 lines

-----Original Message-----
From: Evan Quan <[email protected]>
Sent: 2019年3月23日 2:07
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 2/2] drm/amd/powerplay: correct data type to avoid overflow

Avoid left shift overflow.

Change-Id If03f4f4d440b6d742d8eaa23d0bae6ddd21c01ea
---
 drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h +1 -1
index b90089a4fb6a..195c4ae67058 100644
@@ -165,7 +165,7 @@
 #define FEATURE_DS_FCLK_MASK            (1 << FEATURE_DS_FCLK_BIT            )
 #define FEATURE_DS_MP1CLK_MASK          (1 <<
 FEATURE_DS_MP1CLK_BIT          )
 #define FEATURE_DS_MP0CLK_MASK          (1 <<
 FEATURE_DS_MP0CLK_BIT          )
-#define FEATURE_XGMI_MASK               (1 << FEATURE_XGMI_BIT               )
+#define FEATURE_XGMI_MASK               (1ULL <<
 FEATURE_XGMI_BIT               )

#define FEATURE_ECC_MASK (1ULL << FEATURE_ECC_BIT )

Quoted 3 lines

#define DPM_OVERRIDE_DISABLE_SOCCLK_PID 0x00000001
--
2.21.0

_______________________________________________
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

author
#7 lore raw
In reply to a message not in the archive

Ping..

Quoted 96 lines

-----Original Message-----
From: Evan Quan <[email protected]>
Sent: 2019年3月23日 2:06
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 1/2] drm/amd/powerplay: add ECC feature bit

It's OK to have this feature bit with old SMU firmwares. But the feature should be disabled on them.

Change-Id I6fb4869ef454ea7b6d01cf368b457be01eeb5058
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c  | 10
+++++++++-  drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.h  |
1 +  drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h |  3 ++-
 3 files changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +6 -0
index fac7a5df7c27..49be888fcd50 100644
@@ -91,6 +91,12 @@ static void vega20_set_default_registry_data(struct
 pp_hwmgr *hwmgr)
 	 *   MP0CLK DS
 	 */
 	data->registry_data.disallowed_features = 0xE0041C00;
+	/* ECC feature should be disabled on old SMUs */
+	smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetSmuVersion);
+	hwmgr->smu_version = smum_get_argument(hwmgr);
+	if (hwmgr->smu_version < 0x282100)
+		data->registry_data.disallowed_features |=
 FEATURE_ECC_MASK;
+
 	data->registry_data.od_state_in_dc_support = 0;
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +0 -0
 	data->registry_data.thermal_support = 1;
 	data->registry_data.skip_baco_hardware = 0; @@ -357,6 +363,7 @@

static void vega20_init_dpm_defaults(struct pp_hwmgr *hwmgr)
data->smu_features[GNLD_DS_MP1CLK].smu_feature_id =
FEATURE_DS_MP1CLK_BIT;
data->smu_features[GNLD_DS_MP0CLK].smu_feature_id =
FEATURE_DS_MP0CLK_BIT;
data->smu_features[GNLD_XGMI].smu_feature_id =
FEATURE_XGMI_BIT;

drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +1 -0
+	data->smu_features[GNLD_ECC].smu_feature_id =

FEATURE_ECC_BIT;

drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +1 -0
 	for (i = 0; i < GNLD_FEATURES_MAX; i++) {
 		data->smu_features[i].smu_feature_bitmap = @@ -3048,7
+3055,8 @@ static int vega20_get_ppfeature_status(struct pp_hwmgr

*hwmgr, char *buf)

drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +2 -1
 				"FCLK_DS",
 				"MP1CLK_DS",
 				"MP0CLK_DS",
-				"XGMI"};
+				"XGMI",
+				"ECC"};
 	static const char *output_title[] = {
 				"FEATURES",
 				"BITMASK",
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.h +1 -0
index a46cdeb7da70..c3890b5e076c 100644
@@ -81,6 +81,7 @@ enum {
 	GNLD_DS_MP1CLK,
 	GNLD_DS_MP0CLK,
 	GNLD_XGMI,
+	GNLD_ECC,
 
 	GNLD_FEATURES_MAX
 };
drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h +2 -1
index 63d5cf691549..b90089a4fb6a 100644
@@ -99,7 +99,7 @@
 #define FEATURE_DS_MP1CLK_BIT           30
 #define FEATURE_DS_MP0CLK_BIT           31
 #define FEATURE_XGMI_BIT                32
-#define FEATURE_SPARE_33_BIT            33
+#define FEATURE_ECC_BIT                 33
 #define FEATURE_SPARE_34_BIT            34
 #define FEATURE_SPARE_35_BIT            35
 #define FEATURE_SPARE_36_BIT            36
@@ -166,6 +166,7 @@
 #define FEATURE_DS_MP1CLK_MASK          (1 <<
 FEATURE_DS_MP1CLK_BIT          )
 #define FEATURE_DS_MP0CLK_MASK          (1 <<
 FEATURE_DS_MP0CLK_BIT          )
 #define FEATURE_XGMI_MASK               (1 << FEATURE_XGMI_BIT               )
+#define FEATURE_ECC_MASK                (1ULL << FEATURE_ECC_BIT                )
 
Quoted 4 lines

#define DPM_OVERRIDE_DISABLE_SOCCLK_PID 0x00000001
#define DPM_OVERRIDE_DISABLE_UCLK_PID 0x00000002
--
2.21.0

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

Reviewed-by Feifei Xu
#8 lore raw
In reply to a message not in the archive

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Evan Quan
Sent: Saturday, March 23, 2019 2:06 AM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 1/2] drm/amd/powerplay: add ECC feature bit

It's OK to have this feature bit with old SMU firmwares. But the feature should be disabled on them.

Change-Id I6fb4869ef454ea7b6d01cf368b457be01eeb5058
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c  | 10 +++++++++-  drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.h  |  1 +  drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h |  3 ++-
 3 files changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +6 -0
index fac7a5df7c27..49be888fcd50 100644
@@ -91,6 +91,12 @@ static void vega20_set_default_registry_data(struct pp_hwmgr *hwmgr)
 	 *   MP0CLK DS
 	 */
 	data->registry_data.disallowed_features = 0xE0041C00;
+	/* ECC feature should be disabled on old SMUs */
+	smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetSmuVersion);
+	hwmgr->smu_version = smum_get_argument(hwmgr);
+	if (hwmgr->smu_version < 0x282100)
+		data->registry_data.disallowed_features |= FEATURE_ECC_MASK;
+
 	data->registry_data.od_state_in_dc_support = 0;
 	data->registry_data.thermal_support = 1;
 	data->registry_data.skip_baco_hardware = 0; @@ -357,6 +363,7 @@ static void vega20_init_dpm_defaults(struct pp_hwmgr *hwmgr)

data->smu_features[GNLD_DS_MP1CLK].smu_feature_id = FEATURE_DS_MP1CLK_BIT; data->smu_features[GNLD_DS_MP0CLK].smu_feature_id = FEATURE_DS_MP0CLK_BIT; data->smu_features[GNLD_XGMI].smu_feature_id = FEATURE_XGMI_BIT;
+ data->smu_features[GNLD_ECC].smu_feature_id = FEATURE_ECC_BIT;

for (i = 0; i < GNLD_FEATURES_MAX; i++) {
data->smu_features[i].smu_feature_bitmap = @@ -3048,7 +3055,8 @@ static int vega20_get_ppfeature_status(struct pp_hwmgr *hwmgr, char *buf)
"FCLK_DS",
"MP1CLK_DS",
"MP0CLK_DS",
- "XGMI"};
+ "XGMI",
+ "ECC"};
static const char *output_title[] = {
"FEATURES",
"BITMASK",

drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.h +1 -0
index a46cdeb7da70..c3890b5e076c 100644
@@ -81,6 +81,7 @@ enum {
 	GNLD_DS_MP1CLK,
 	GNLD_DS_MP0CLK,
 	GNLD_XGMI,
+	GNLD_ECC,
 
 	GNLD_FEATURES_MAX
 };
drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h +2 -1
index 63d5cf691549..b90089a4fb6a 100644
@@ -99,7 +99,7 @@
 #define FEATURE_DS_MP1CLK_BIT           30
 #define FEATURE_DS_MP0CLK_BIT           31
 #define FEATURE_XGMI_BIT                32
-#define FEATURE_SPARE_33_BIT            33
+#define FEATURE_ECC_BIT                 33
 #define FEATURE_SPARE_34_BIT            34
 #define FEATURE_SPARE_35_BIT            35
 #define FEATURE_SPARE_36_BIT            36
@@ -166,6 +166,7 @@
 #define FEATURE_DS_MP1CLK_MASK          (1 << FEATURE_DS_MP1CLK_BIT          )
 #define FEATURE_DS_MP0CLK_MASK          (1 << FEATURE_DS_MP0CLK_BIT          )
 #define FEATURE_XGMI_MASK               (1 << FEATURE_XGMI_BIT               )
+#define FEATURE_ECC_MASK                (1ULL << FEATURE_ECC_BIT                )
 
 #define DPM_OVERRIDE_DISABLE_SOCCLK_PID             0x00000001
 #define DPM_OVERRIDE_DISABLE_UCLK_PID               0x00000002

--
2.21.0

_______________________________________________
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