drm/amd/display: don't print messages that contain %f in dml
Subsystems (3)
PATCH 1/1 drm/amd/display: don't print messages that contain %f in dml
Unfortunately, printk() doesn't currently support the printing of %f entries. So, print statements that contain "%f" should be removed. However, since DC is used on other OSes that can still benefit from the additional debugging information, we should instead remove the problematic print statements at compile time.
--- drivers/gpu/drm/amd/display/include/logger_types.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/include/logger_types.h +9 -2
@@ -30,6 +30,12 @@#define MAX_NAME_LEN 32 +#define __DC_LOG_IGNORE_FLOATS(fmt, args...) \ +do { \ + if (!strstr((fmt), "%f")) \ + pr_debug(fmt, ##args); \ +} while (0) +#define DC_LOG_ERROR (...) DRM_ERROR(__VA_ARGS__)#define DC_LOG_WARNING (...) DRM_WARN(__VA_ARGS__)#define DC_LOG_DEBUG (...) DRM_DEBUG_KMS(__VA_ARGS__)
@@ -48,7 +54,8 @@#define DC_LOG_MST (...) DRM_DEBUG_KMS(__VA_ARGS__)#define DC_LOG_SCALER (...) pr_debug("[SCALER]:"__VA_ARGS__)#define DC_LOG_BIOS (...) pr_debug("[BIOS]:"__VA_ARGS__) -#define DC_LOG_BANDWIDTH_CALCS (...) pr_debug("[BANDWIDTH_CALCS]:"__VA_ARGS__) +#define DC_LOG_BANDWIDTH_CALCS(args...) \ + __DC_LOG_IGNORE_FLOATS("[BANDWIDTH_CALCS]:" args)#define DC_LOG_BANDWIDTH_VALIDATION (...) DRM_DEBUG_KMS(__VA_ARGS__)#define DC_LOG_I2C_AUX (...) DRM_DEBUG_KMS(__VA_ARGS__)#define DC_LOG_SYNC (...) DRM_DEBUG_KMS(__VA_ARGS__)
@@ -57,7 +64,7 @@#define DC_LOG_DETECTION_EDID_PARSER (...) DRM_DEBUG_KMS(__VA_ARGS__)#define DC_LOG_DETECTION_DP_CAPS (...) DRM_DEBUG_KMS(__VA_ARGS__)#define DC_LOG_RESOURCE (...) DRM_DEBUG_KMS(__VA_ARGS__) -#define DC_LOG_DML (...) pr_debug("[DML]:"__VA_ARGS__) +#define DC_LOG_DML(args...) __DC_LOG_IGNORE_FLOATS("[DML]:" args)#define DC_LOG_EVENT_MODE_SET (...) DRM_DEBUG_KMS(__VA_ARGS__)#define DC_LOG_EVENT_DETECTION (...) DRM_DEBUG_KMS(__VA_ARGS__)#define DC_LOG_EVENT_LINK_TRAINING (...) DRM_DEBUG_KMS(__VA_ARGS__)
Signature · 1 line
2.38.0
Christian König
maintainerAm 21.10.22 um 18:34 schrieb Hamza Mahfooz:
Quoted 17 lines
Unfortunately,
printk()doesn't currently support the printing of %f entries. So, print statements that contain "%f" should be removed. However, since DC is used on other OSes that can still benefit from the additional debugging information, we should instead remove the problematic print statements at compile time.Reported-by Jim Cromie <[email protected]>Signed-off-by Hamza Mahfooz <[email protected]>--- drivers/gpu/drm/amd/display/include/logger_types.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/display/include/logger_types.h +0
-0
drivers/gpu/drm/amd/display/include/logger_types.h line 37
Quoted 8 lines
drivers/gpu/drm/amd/display/include/logger_types.h +5
-0@@ -30,6 +30,12 @@#define MAX_NAME_LEN 32 +#define __DC_LOG_IGNORE_FLOATS(fmt, args...) \ +do { \ + if (!strstr((fmt), "%f")) \ + pr_debug(fmt, ##args); \ +} while (0)
This is absolutely not sufficient.
Linux drivers must be made for Linux, see the documentation about porting drivers.
So just disabling the debug messages won't work in this case. Either completely remove or properly fix them.
Regards,
Christian.
Quoted 23 lines
drivers/gpu/drm/amd/display/include/logger_types.h +4
-2+#define DC_LOG_ERROR (...) DRM_ERROR(__VA_ARGS__)#define DC_LOG_WARNING (...) DRM_WARN(__VA_ARGS__)#define DC_LOG_DEBUG (...) DRM_DEBUG_KMS(__VA_ARGS__)@@ -48,7 +54,8 @@#define DC_LOG_MST (...) DRM_DEBUG_KMS(__VA_ARGS__)#define DC_LOG_SCALER (...) pr_debug("[SCALER]:"__VA_ARGS__)#define DC_LOG_BIOS (...) pr_debug("[BIOS]:"__VA_ARGS__) -#define DC_LOG_BANDWIDTH_CALCS (...) pr_debug("[BANDWIDTH_CALCS]:"__VA_ARGS__) +#define DC_LOG_BANDWIDTH_CALCS(args...) \ + __DC_LOG_IGNORE_FLOATS("[BANDWIDTH_CALCS]:" args)#define DC_LOG_BANDWIDTH_VALIDATION (...) DRM_DEBUG_KMS(__VA_ARGS__)#define DC_LOG_I2C_AUX (...) DRM_DEBUG_KMS(__VA_ARGS__)#define DC_LOG_SYNC (...) DRM_DEBUG_KMS(__VA_ARGS__)@@ -57,7 +64,7 @@#define DC_LOG_DETECTION_EDID_PARSER (...) DRM_DEBUG_KMS(__VA_ARGS__)#define DC_LOG_DETECTION_DP_CAPS (...) DRM_DEBUG_KMS(__VA_ARGS__)#define DC_LOG_RESOURCE (...) DRM_DEBUG_KMS(__VA_ARGS__) -#define DC_LOG_DML (...) pr_debug("[DML]:"__VA_ARGS__) +#define DC_LOG_DML(args...) __DC_LOG_IGNORE_FLOATS("[DML]:" args)#define DC_LOG_EVENT_MODE_SET (...) DRM_DEBUG_KMS(__VA_ARGS__)#define DC_LOG_EVENT_DETECTION (...) DRM_DEBUG_KMS(__VA_ARGS__)#define DC_LOG_EVENT_LINK_TRAINING (...) DRM_DEBUG_KMS(__VA_ARGS__)
Quoted 27 lines · Christian König
Am 21.10.22 um 18:34 schrieb Hamza Mahfooz:
Quoted 17 lines
Unfortunately,
printk()doesn't currently support the printing of %f entries. So, print statements that contain "%f" should be removed. However, since DC is used on other OSes that can still benefit from the additional debugging information, we should instead remove the problematic print statements at compile time.Reported-by Jim Cromie <[email protected]>Signed-off-by Hamza Mahfooz <[email protected]>---
drivers/gpu/drm/amd/display/include/logger_types.h| 11 +++++++++--1 file changed, 9 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/display/include/logger_types.h +0
-0drivers/gpu/drm/amd/display/include/logger_types.h line 35
Quoted 6 lines
drivers/gpu/drm/amd/display/include/logger_types.h +5
-0@@ -30,6 +30,12 @@ #define MAX_NAME_LEN 32 +#define __DC_LOG_IGNORE_FLOATS(fmt, args...) \ +do { \ + if (!strstr((fmt), "%f")) \ + pr_debug(fmt, ##args); \ +} while (0)This is absolutely not sufficient.
Quoted 3 lines
Linux drivers must be made for Linux, see the documentation about porting drivers.
So just disabling the debug messages won't work in this case. Either completely remove or properly fix them.
Hi Christian,
We have been discussing and working on better solutions for dealing with
FPU code, and we have recently improved a lot in this area (e.g., we
are isolating all FPU codes inside DML). However, we still have many other challenges, and improving the FPU support in the kernel is on our radar.
I know this patch does not represent the best solution for this problem yet, but it is one step to enable us to keep refining our FPU support while keeping all other ASICs working well. I see this patch as an ok trade-off to address some of the issues that we have now while enabling us to improve other areas.
Thanks
Siqueira
Quoted 30 lines
Regards,
Christian.Quoted 24 lines
drivers/gpu/drm/amd/display/include/logger_types.h +3
-1+ #define DC_LOG_ERROR(...) DRM_ERROR(__VA_ARGS__) #define DC_LOG_WARNING(...) DRM_WARN(__VA_ARGS__) #define DC_LOG_DEBUG(...) DRM_DEBUG_KMS(__VA_ARGS__)@@ -48,7 +54,8 @@ #define DC_LOG_MST(...) DRM_DEBUG_KMS(__VA_ARGS__) #define DC_LOG_SCALER(...) pr_debug("[SCALER]:"__VA_ARGS__) #define DC_LOG_BIOS(...) pr_debug("[BIOS]:"__VA_ARGS__) -#define DC_LOG_BANDWIDTH_CALCS (...) pr_debug("[BANDWIDTH_CALCS]:"__VA_ARGS__) +#define DC_LOG_BANDWIDTH_CALCS(args...) \ + __DC_LOG_IGNORE_FLOATS("[BANDWIDTH_CALCS]:" args) #define DC_LOG_BANDWIDTH_VALIDATION(...) DRM_DEBUG_KMS(__VA_ARGS__) #define DC_LOG_I2C_AUX(...) DRM_DEBUG_KMS(__VA_ARGS__)#define
DC_LOG_SYNC(...)DRM_DEBUG_KMS(__VA_ARGS__)drivers/gpu/drm/amd/display/include/logger_types.h +1
-1@@ -57,7 +64,7 @@ #define DC_LOG_DETECTION_EDID_PARSER(...) DRM_DEBUG_KMS(__VA_ARGS__) #define DC_LOG_DETECTION_DP_CAPS(...) DRM_DEBUG_KMS(__VA_ARGS__) #define DC_LOG_RESOURCE(...) DRM_DEBUG_KMS(__VA_ARGS__) -#define DC_LOG_DML (...) pr_debug("[DML]:"__VA_ARGS__) +#define DC_LOG_DML(args...) __DC_LOG_IGNORE_FLOATS("[DML]:" args) #define DC_LOG_EVENT_MODE_SET(...) DRM_DEBUG_KMS(__VA_ARGS__) #define DC_LOG_EVENT_DETECTION(...) DRM_DEBUG_KMS(__VA_ARGS__) #define DC_LOG_EVENT_LINK_TRAINING(...) DRM_DEBUG_KMS(__VA_ARGS__)