Skip to contentSkip to conversation

drm/amd/display: Align dcn314_smu logging with other DCNs

PATCH In review [email protected] 3 participants 5 messages Nov 14, 2022 – Nov 15, 2022

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

PATCH 1/1 drm/amd/display: Align dcn314_smu logging with other DCNs

From: Roman Li <[email protected]>

[Why]
Assert on non-OK response from SMU is unnecessary. It was replaced with respective log message on other asics in the past with commit:
"drm/amd/display: Removing assert statements for Linux"

[How]
Remove asert and add dbg logging as on other DCNs.

---
 .../drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c    | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +9 -2
index ef0795b14a1f..2db595672a46 100644
@@ -123,9 +123,10 @@ static int dcn314_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr,
 	uint32_t result;
 
 	result = dcn314_smu_wait_for_response(clk_mgr, 10, 200000);
-	ASSERT(result == VBIOSSMC_Result_OK);
 
-	smu_print("SMU response after wait: %d\n", result);
+	if (result != VBIOSSMC_Result_OK)
+		smu_print("SMU Response was not OK. SMU response after wait received is: %d\n",
+				result);
 
 	if (result == VBIOSSMC_Status_BUSY)
 		return -1;
@@ -216,6 +217,12 @@ int dcn314_smu_set_hard_min_dcfclk(struct clk_mgr_internal *clk_mgr, int request
 			VBIOSSMC_MSG_SetHardMinDcfclkByFreq,
 			khz_to_mhz_ceil(requested_dcfclk_khz));
 
+#ifdef DBG
+	smu_print("actual_dcfclk_set_mhz %d is set to : %d\n",
+			actual_dcfclk_set_mhz,
+			actual_dcfclk_set_mhz * 1000);
+#endif
+
 	return actual_dcfclk_set_mhz * 1000;
 }
 
Signature · 1 line
2.17.1
#1 lore raw

[Public]

Conceptually makes sense to me, but please see below comments:

Quoted 34 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Monday, November 14, 2022 15:07
To: [email protected]; Deucher, Alexander <[email protected]>; Wentland, Harry <[email protected]>; Limonciello, Mario <[email protected]>; Rizvi, Saaem <[email protected]>
Cc: Li, Roman <[email protected]>
Subject: [PATCH] drm/amd/display: Align dcn314_smu logging with other DCNs

From: Roman Li <[email protected]>

[Why]
Assert on non-OK response from SMU is unnecessary. It was replaced with respective log message on other asics in the past with commit:
"drm/amd/display: Removing assert statements for Linux"

[How]
Remove asert and add dbg logging as on other DCNs.

---
 .../drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c    | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +0 -0
index ef0795b14a1f..2db595672a46 100644

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c static int · line 127

Quoted 5 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +0 -1
@@ -123,9 +123,10 @@ static int
 dcn314_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr,
 	uint32_t result;
 
 	result = dcn314_smu_wait_for_response(clk_mgr, 10, 200000);
-	ASSERT(result == VBIOSSMC_Result_OK);

Does this flow actually happen still? I thought the assertion should have gone away as a result of 83293f7f3d15fc56e86bd5067a2c88b6b233ac3a.

Maybe we want to also undo the REG_WRITE() call there if pulling this in.

Quoted 9 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +3 -1
-	smu_print("SMU response after wait: %d\n", result);
+	if (result != VBIOSSMC_Result_OK)
+		smu_print("SMU Response was not OK. SMU response after
 wait received is: %d\n",
+				result);
 
 	if (result == VBIOSSMC_Status_BUSY)

return -1;

I think what is missing to clean up recent asserts is actually a little bit further in the code than this. It should be part of the error flow introduced by 03ad3093c7c069d6ab4403730009ebafeea9ee37

Quoted 16 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +0 -0
@@ -216,6 +217,12 @@ int dcn314_smu_set_hard_min_dcfclk(struct

clk_mgr_internal *clk_mgr, int request

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +6 -1
 			VBIOSSMC_MSG_SetHardMinDcfclkByFreq,
 			khz_to_mhz_ceil(requested_dcfclk_khz));
 
+#ifdef DBG
+	smu_print("actual_dcfclk_set_mhz %d is set to : %d\n",
+			actual_dcfclk_set_mhz,
+			actual_dcfclk_set_mhz * 1000);
+#endif
+
 	return actual_dcfclk_set_mhz * 1000;
 }
 
--

2.17.1

author
#2 lore raw

Hi Mario,

Thanks for your comments.
I replied inline.

Quoted 12 lines

-----Original Message-----
From: Limonciello, Mario <[email protected]>
Sent: Monday, November 14, 2022 4:16 PM
To: Li, Roman <[email protected]>; [email protected]; Deucher, Alexander <[email protected]>; Wentland, Harry <[email protected]>; Rizvi, Saaem <[email protected]>
Cc: Li, Roman <[email protected]>
Subject: RE: [PATCH] drm/amd/display: Align dcn314_smu logging with other DCNs

[Public]

Quoted 24 lines

Conceptually makes sense to me, but please see below comments:

Quoted 5 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Monday, November 14, 2022 15:07
To: [email protected]; Deucher, Alexander <[email protected]>; Wentland, Harry

<[email protected]>;

Quoted 16 lines

Limonciello, Mario <[email protected]>; Rizvi, Saaem <[email protected]>
Cc: Li, Roman <[email protected]>
Subject: [PATCH] drm/amd/display: Align dcn314_smu logging with other DCNs

From: Roman Li <[email protected]>

[Why]
Assert on non-OK response from SMU is unnecessary.
It was replaced with respective log message on other asics in the past with commit:
"drm/amd/display: Removing assert statements for Linux"

[How]
Remove asert and add dbg logging as on other DCNs.

I will fix "assert" spelling before merging.

Quoted 18 lines
Quoted 5 lines
---
 .../drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c    | 11 +++++++++-

-

Quoted 12 lines
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c index ef0795b14a1f..2db595672a46 100644

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +0 -0
@@ -123,9 +123,10 @@ static int
 dcn314_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr,
 	uint32_t result;
 
Quoted 6 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c static int dcn314_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr, · line 126

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +0 -1
 	result = dcn314_smu_wait_for_response(clk_mgr, 10, 200000);
-	ASSERT(result == VBIOSSMC_Result_OK);

Does this flow actually happen still? I thought the assertion should have gone away as a result of 83293f7f3d15fc56e86bd5067a2c88b6b233ac3a.

Happens or not, we don't assert here on other asics.
I don't try to fix any bugs with this patch, just align the dcn314 logging/bug reporting with other asics.

Quoted 9 lines

Maybe we want to also undo the REG_WRITE() call there if pulling this in.

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +3 -1
-	smu_print("SMU response after wait: %d\n", result);
+	if (result != VBIOSSMC_Result_OK)
+		smu_print("SMU Response was not OK. SMU response after
 wait received is: %d\n",
+				result);
 
Quoted 6 lines
Quoted 2 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +0 -0
 	if (result == VBIOSSMC_Status_BUSY)

return -1;

I think what is missing to clean up recent asserts is actually a little bit further in the code than this. It should be part of the error flow introduced by 03ad3093c7c069d6ab4403730009ebafeea9ee37

03ad3093c7c069d6a is for dcn3.1 initially.
If there's an issue with it (which I didn't experience) it should be addressed on all dcn3x, that reuse it, in a separate patch.

Quoted 14 lines
Quoted 14 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +0 -0
@@ -216,6 +217,12 @@ int dcn314_smu_set_hard_min_dcfclk(struct

clk_mgr_internal *clk_mgr, int request

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +6 -0
 			VBIOSSMC_MSG_SetHardMinDcfclkByFreq,
 			khz_to_mhz_ceil(requested_dcfclk_khz));
 
+#ifdef DBG
+	smu_print("actual_dcfclk_set_mhz %d is set to : %d\n",
+			actual_dcfclk_set_mhz,
+			actual_dcfclk_set_mhz * 1000);
+#endif
+
 	return actual_dcfclk_set_mhz * 1000;  }
Quoted 2 lines
Quoted 2 lines

--
2.17.1

Thanks,
Roman

#3 lore raw

[Public]

Quoted 80 lines

-----Original Message-----
From: Li, Roman <[email protected]>
Sent: Tuesday, November 15, 2022 11:52
To: Limonciello, Mario <[email protected]>; amd- [email protected]; Deucher, Alexander <[email protected]>; Wentland, Harry <[email protected]>; Rizvi, Saaem <[email protected]>
Subject: RE: [PATCH] drm/amd/display: Align dcn314_smu logging with other DCNs

Hi Mario,

Thanks for your comments.
I replied inline.

Quoted 8 lines

-----Original Message-----
From: Limonciello, Mario <[email protected]>
Sent: Monday, November 14, 2022 4:16 PM
To: Li, Roman <[email protected]>; [email protected]; Deucher, Alexander <[email protected]>; Wentland, Harry <[email protected]>; Rizvi, Saaem <[email protected]>
Cc: Li, Roman <[email protected]>
Subject: RE: [PATCH] drm/amd/display: Align dcn314_smu logging with

other

Quoted 4 lines

DCNs

[Public]

Quoted 24 lines

Conceptually makes sense to me, but please see below comments:

Quoted 5 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Monday, November 14, 2022 15:07
To: [email protected]; Deucher, Alexander <[email protected]>; Wentland, Harry

<[email protected]>;

Quoted 16 lines

Limonciello, Mario <[email protected]>; Rizvi, Saaem <[email protected]>
Cc: Li, Roman <[email protected]>
Subject: [PATCH] drm/amd/display: Align dcn314_smu logging with other DCNs

From: Roman Li <[email protected]>

[Why]
Assert on non-OK response from SMU is unnecessary.
It was replaced with respective log message on other asics in the past with commit:
"drm/amd/display: Removing assert statements for Linux"

[How]
Remove asert and add dbg logging as on other DCNs.

I will fix "assert" spelling before merging.

Quoted 5 lines
Quoted 5 lines
---
 .../drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c    | 11

+++++++++-

Quoted 13 lines

-

Quoted 12 lines
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c index ef0795b14a1f..2db595672a46 100644

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +0 -0
@@ -123,9 +123,10 @@ static int
 dcn314_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr,
 	uint32_t result;
 
Quoted 6 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c static int dcn314_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr, · line 126

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +0 -1
 	result = dcn314_smu_wait_for_response(clk_mgr, 10, 200000);
-	ASSERT(result == VBIOSSMC_Result_OK);

Does this flow actually happen still? I thought the assertion should have gone away as a result of 83293f7f3d15fc56e86bd5067a2c88b6b233ac3a.

Quoted 3 lines

Happens or not, we don't assert here on other asics.
I don't try to fix any bugs with this patch, just align the dcn314 logging/bug reporting with other asics.

Got it thanks.

Quoted 17 lines
Quoted 10 lines

Maybe we want to also undo the REG_WRITE() call there if pulling this in.

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +3 -1
-	smu_print("SMU response after wait: %d\n", result);
+	if (result != VBIOSSMC_Result_OK)
+		smu_print("SMU Response was not OK. SMU response after
 wait received is: %d\n",
+				result);
 
Quoted 6 lines
Quoted 2 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +0 -0
 	if (result == VBIOSSMC_Status_BUSY)

return -1;

I think what is missing to clean up recent asserts is actually a little bit further in the code than this. It should be part of the error flow introduced by 03ad3093c7c069d6ab4403730009ebafeea9ee37

Quoted 3 lines

03ad3093c7c069d6a is for dcn3.1 initially.
If there's an issue with it (which I didn't experience) it should be addressed on all dcn3x, that reuse it, in a separate patch.

OK.

Quoted 21 lines
Quoted 16 lines
Quoted 16 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +0 -0
@@ -216,6 +217,12 @@ int dcn314_smu_set_hard_min_dcfclk(struct

clk_mgr_internal *clk_mgr, int request

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +6 -0
 			VBIOSSMC_MSG_SetHardMinDcfclkByFreq,
 			khz_to_mhz_ceil(requested_dcfclk_khz));
 
+#ifdef DBG
+	smu_print("actual_dcfclk_set_mhz %d is set to : %d\n",
+			actual_dcfclk_set_mhz,
+			actual_dcfclk_set_mhz * 1000);
+#endif
+
 	return actual_dcfclk_set_mhz * 1000;  }
Quoted 2 lines
Quoted 2 lines

--
2.17.1

Thanks,
Roman

Reviewed-by
#4 lore raw

[Public]

From: Limonciello, Mario<mailto:[email protected]>
Sent: Tuesday, November 15, 2022 1:02 PM
To: Li, Roman<mailto:[email protected]>; [email protected]<mailto:[email protected]>; Deucher, Alexander<mailto:[email protected]>; Wentland, Harry<mailto:[email protected]>; Rizvi, Saaem<mailto:[email protected]>
Subject: RE: [PATCH] drm/amd/display: Align dcn314_smu logging with other DCNs

[Public]

Quoted 80 lines

-----Original Message-----
From: Li, Roman <[email protected]>
Sent: Tuesday, November 15, 2022 11:52
To: Limonciello, Mario <[email protected]>; amd- [email protected]; Deucher, Alexander <[email protected]>; Wentland, Harry <[email protected]>; Rizvi, Saaem <[email protected]>
Subject: RE: [PATCH] drm/amd/display: Align dcn314_smu logging with other DCNs

Hi Mario,

Thanks for your comments.
I replied inline.

Quoted 8 lines

-----Original Message-----
From: Limonciello, Mario <[email protected]>
Sent: Monday, November 14, 2022 4:16 PM
To: Li, Roman <[email protected]>; [email protected]; Deucher, Alexander <[email protected]>; Wentland, Harry <[email protected]>; Rizvi, Saaem <[email protected]>
Cc: Li, Roman <[email protected]>
Subject: RE: [PATCH] drm/amd/display: Align dcn314_smu logging with

other

Quoted 4 lines

DCNs

[Public]

Quoted 24 lines

Conceptually makes sense to me, but please see below comments:

Quoted 5 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Monday, November 14, 2022 15:07
To: [email protected]; Deucher, Alexander <[email protected]>; Wentland, Harry

<[email protected]>;

Quoted 16 lines

Limonciello, Mario <[email protected]>; Rizvi, Saaem <[email protected]>
Cc: Li, Roman <[email protected]>
Subject: [PATCH] drm/amd/display: Align dcn314_smu logging with other DCNs

From: Roman Li <[email protected]>

[Why]
Assert on non-OK response from SMU is unnecessary.
It was replaced with respective log message on other asics in the past with commit:
"drm/amd/display: Removing assert statements for Linux"

[How]
Remove asert and add dbg logging as on other DCNs.

I will fix "assert" spelling before merging.

Quoted 5 lines
Quoted 5 lines
---
 .../drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c    | 11

+++++++++-

Quoted 13 lines

-

Quoted 12 lines
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c index ef0795b14a1f..2db595672a46 100644

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +0 -0
@@ -123,9 +123,10 @@ static int
 dcn314_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr,
   uint32_t result;
 
Quoted 6 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c static int dcn314_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr, · line 126

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +0 -1
   result = dcn314_smu_wait_for_response(clk_mgr, 10, 200000);
- ASSERT(result == VBIOSSMC_Result_OK);

Does this flow actually happen still? I thought the assertion should have gone away as a result of 83293f7f3d15fc56e86bd5067a2c88b6b233ac3a.

Quoted 3 lines

Happens or not, we don't assert here on other asics.
I don't try to fix any bugs with this patch, just align the dcn314 logging/bug reporting with other asics.

Got it thanks.

Quoted 13 lines
Quoted 13 lines

Maybe we want to also undo the REG_WRITE() call there if pulling this in.

Quoted 9 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +3 -1
- smu_print("SMU response after wait: %d\n", result);
+ if (result != VBIOSSMC_Result_OK)
+         smu_print("SMU Response was not OK. SMU response after
 wait received is: %d\n",
+                         result);
 
   if (result == VBIOSSMC_Status_BUSY)
           return -1;
Quoted 7 lines
Quoted 3 lines

I think what is missing to clean up recent asserts is actually a little bit further in the code than this. It should be part of the error flow introduced by 03ad3093c7c069d6ab4403730009ebafeea9ee37

03ad3093c7c069d6a is for dcn3.1 initially.
If there's an issue with it (which I didn't experience) it should be addressed on all dcn3x, that reuse it, in a separate patch.

OK.

Quoted 21 lines
Quoted 16 lines
Quoted 16 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +0 -0
@@ -216,6 +217,12 @@ int dcn314_smu_set_hard_min_dcfclk(struct

clk_mgr_internal *clk_mgr, int request

                   VBIOSSMC_MSG_SetHardMinDcfclkByFreq,
                   khz_to_mhz_ceil(requested_dcfclk_khz));
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +6 -0
+#ifdef DBG
+ smu_print("actual_dcfclk_set_mhz %d is set to : %d\n",
+                 actual_dcfclk_set_mhz,
+                 actual_dcfclk_set_mhz * 1000);
+#endif
+
   return actual_dcfclk_set_mhz * 1000;  }
Quoted 2 lines
Quoted 2 lines

--
2.17.1

Thanks,
Roman