Skip to contentSkip to conversation

drm/amd/powerplay: revise Vega20 pptable version check

PATCH In review Evan Quan 3 participants 3 messages Oct 30, 2018 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/1 drm/amd/powerplay: revise Vega20 pptable version check

Tell the version numbers when the pptable versions do not match.

Change-Id I3ea8aac7493927281b14d28866fa87690621f0f0
---
 .../drm/amd/powerplay/hwmgr/vega20_processpptables.c   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c +8 -2
index 5eca2b7c78d5..8e70e806f639 100644
@@ -642,8 +642,14 @@ static int check_powerplay_tables(
 		"Unsupported PPTable format!", return -1);
 	PP_ASSERT_WITH_CODE(powerplay_table->sHeader.structuresize > 0,
 		"Invalid PowerPlay Table!", return -1);
-	PP_ASSERT_WITH_CODE(powerplay_table->smcPPTable.Version == PPTABLE_V20_SMU_VERSION,
-		"Unmatch PPTable version, vbios update may be needed!", return -1);
+
+	if (powerplay_table->smcPPTable.Version != PPTABLE_V20_SMU_VERSION) {
+		pr_info("Unmatch PPTable version: "
+			"pptable from VBIOS is V%d while driver supported is V%d!",
+			powerplay_table->smcPPTable.Version,
+			PPTABLE_V20_SMU_VERSION);
+		return -1;
+	}
 
 	//dump_pptable(&powerplay_table->smcPPTable);
 
Signature · 6 lines
2.19.1

_______________________________________________
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]

Reviewed-by
#2 lore raw
Quoted 16 lines · Evan Quan

Tell the version numbers when the pptable versions do not match.

Change-Id I3ea8aac7493927281b14d28866fa87690621f0f0
---
 .../drm/amd/powerplay/hwmgr/vega20_processpptables.c   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c +0 -0
index 5eca2b7c78d5..8e70e806f639 100644
@@ -642,8 +642,14 @@ static int check_powerplay_tables(
                "Unsupported PPTable format!", return -1);
        PP_ASSERT_WITH_CODE(powerplay_table->sHeader.structuresize > 0,

drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c static int check_powerplay_tables( · line 651

Quoted 10 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c +7 -2
                "Invalid PowerPlay Table!", return -1);
-       PP_ASSERT_WITH_CODE(powerplay_table->smcPPTable.Version == PPTABLE_V20_SMU_VERSION,
-               "Unmatch PPTable version, vbios update may be needed!", return -1);
+
+       if (powerplay_table->smcPPTable.Version != PPTABLE_V20_SMU_VERSION) {
+               pr_info("Unmatch PPTable version: "
+                       "pptable from VBIOS is V%d while driver supported is V%d!",
+                       powerplay_table->smcPPTable.Version,
+                       PPTABLE_V20_SMU_VERSION);
+               return -1;

Return a proper error codes here. E.g., -EINVAL. With that fixed:

Quoted 11 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c +1 -1
+       }
 
        //dump_pptable(&powerplay_table->smcPPTable);
 
--

2.19.1

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

#4 lore raw
Quoted 27 lines · Alex Deucher
Quoted 15 lines · Evan Quan

Tell the version numbers when the pptable versions do not match.

Change-Id I3ea8aac7493927281b14d28866fa87690621f0f0
---
  .../drm/amd/powerplay/hwmgr/vega20_processpptables.c   | 10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c +0 -0
index 5eca2b7c78d5..8e70e806f639 100644
@@ -642,8 +642,14 @@ static int check_powerplay_tables(
                 "Unsupported PPTable format!", return -1);
         PP_ASSERT_WITH_CODE(powerplay_table->sHeader.structuresize > 0,

drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c static int check_powerplay_tables( · line 651

Quoted 10 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c +7 -2
                 "Invalid PowerPlay Table!", return -1);
-       PP_ASSERT_WITH_CODE(powerplay_table->smcPPTable.Version == PPTABLE_V20_SMU_VERSION,
-               "Unmatch PPTable version, vbios update may be needed!", return -1);
+
+       if (powerplay_table->smcPPTable.Version != PPTABLE_V20_SMU_VERSION) {
+               pr_info("Unmatch PPTable version: "
+                       "pptable from VBIOS is V%d while driver supported is V%d!",
+                       powerplay_table->smcPPTable.Version,
+                       PPTABLE_V20_SMU_VERSION);
+               return -1;

Return a proper error codes here. E.g., -EINVAL. With that fixed:

Quoted 1 line

Doesn't "mismatched" sound like a much better word here?

Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c +1 -1
+       }
 
         //dump_pptable(&powerplay_table->smcPPTable);
 
--

2.19.1

Quoted 8 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7C%7C262cceca682f450fdb1908d63e08ea82%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636764605340766976&sdata=P1cJGaVlMLE2NJNgViqu9YLoxMsScNY9EEbPDQNM%2BWA%3D&reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7C%7C262cceca682f450fdb1908d63e08ea82%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636764605340766976&sdata=P1cJGaVlMLE2NJNgViqu9YLoxMsScNY9EEbPDQNM%2BWA%3D&reserved=0

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