firmware: dmi_scan: Always show system identification string
PATCH 1/1 firmware: dmi_scan: Always show system identification string
Let's keep consistent when print dmi_ids_string between SMBIOS 2.x and SMBIOS 3.x, and always show the system identification string, like Vendor, Product/Board name and BIOS infos.
--- drivers/firmware/dmi_scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firmware/dmi_scan.c +2 -2
@@ -560,7 +560,7 @@ static int __init dmi_present(const u8 *buf) dmi_ver >> 16, (dmi_ver >> 8) & 0xFF); }dmi_format_ids (dmi_ids_string,sizeof (dmi_ids_string)); -printk (KERN_DEBUG "DMI: %s\n" , dmi_ids_string); +pr_info ("DMI: %s\n" , dmi_ids_string);return 0 ; } }
@@ -588,7 +588,7 @@ static int __init dmi_smbios3_present(const u8 *buf) dmi_ver >>16 , (dmi_ver >>8 ) &0xFF , dmi_ver & 0xFF);dmi_format_ids (dmi_ids_string,sizeof (dmi_ids_string)); -pr_debug ("DMI: %s\n" , dmi_ids_string); +pr_info ("DMI: %s\n" , dmi_ids_string);return 0 ; } }
Signature · 1 line
1.7.12.4
Quoted 4 lines · Kefeng Wang
Let's keep consistent when print
dmi_ids_stringbetween SMBIOS 2.x and SMBIOS 3.x, and always show the system identification string, like Vendor, Product/Board name and BIOS infos.
Are you saying the printk(KERN_DEBUG) was inconsistent with the pr_debug() before?
Quoted 30 lines
Signed-off-by Kefeng Wang <[email protected]>--- drivers/firmware/dmi_scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/firmware/dmi_scan.c +2
-3@@ -560,7 +560,7 @@ static int __init dmi_present(const u8 *buf) dmi_ver >> 16, (dmi_ver >> 8) & 0xFF); }dmi_format_ids (dmi_ids_string,sizeof (dmi_ids_string)); -printk (KERN_DEBUG "DMI: %s\n" , dmi_ids_string); +pr_info ("DMI: %s\n" , dmi_ids_string);return 0 ; } }@@ -588,7 +588,7 @@ static int __init dmi_smbios3_present(const u8 *buf) dmi_ver >>16 , (dmi_ver >>8 ) &0xFF , dmi_ver & 0xFF);dmi_format_ids (dmi_ids_string,sizeof (dmi_ids_string)); -pr_debug ("DMI: %s\n" , dmi_ids_string); +pr_info ("DMI: %s\n" , dmi_ids_string);return 0 ; } } --1.7.12.4
Quoted 8 lines · Ard Biesheuvel
Quoted 4 lines · Kefeng Wang
Let's keep consistent when print
dmi_ids_stringbetween SMBIOS 2.x and SMBIOS 3.x, and always show the system identification string, like Vendor, Product/Board name and BIOS infos.Are you saying the
printk(KERN_DEBUG)was inconsistent with thepr_debug()before?
Yes, found it when check the boot dmesg on qemu, there is no print using pr_debug with defconfig on ARM64( smbios3 present), but could shown with printk(KERN_DEBUG.
Quoted 35 lines
Quoted 30 lines
Signed-off-by Kefeng Wang <[email protected]>--- drivers/firmware/dmi_scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/firmware/dmi_scan.c +2
-3@@ -560,7 +560,7 @@ static int __init dmi_present(const u8 *buf) dmi_ver >> 16, (dmi_ver >> 8) & 0xFF); }dmi_format_ids (dmi_ids_string,sizeof (dmi_ids_string)); -printk (KERN_DEBUG "DMI: %s\n" , dmi_ids_string); +pr_info ("DMI: %s\n" , dmi_ids_string);return 0 ; } }@@ -588,7 +588,7 @@ static int __init dmi_smbios3_present(const u8 *buf) dmi_ver >>16 , (dmi_ver >>8 ) &0xFF , dmi_ver & 0xFF);dmi_format_ids (dmi_ids_string,sizeof (dmi_ids_string)); -pr_debug ("DMI: %s\n" , dmi_ids_string); +pr_info ("DMI: %s\n" , dmi_ids_string);return 0 ; } } --Quoted 2 lines
1.7.12.4
.
Quoted 9 lines · Kefeng Wang
Quoted 6 lines · Ard Biesheuvel
Quoted 4 lines · Kefeng Wang
Let's keep consistent when print
dmi_ids_stringbetween SMBIOS 2.x and SMBIOS 3.x, and always show the system identification string, like Vendor, Product/Board name and BIOS infos.
Quoted 6 lines
Quoted 2 lines
Are you saying the
printk(KERN_DEBUG)was inconsistent with thepr_debug()before?Yes, found it when check the boot dmesg on qemu, there is no print using
pr_debugwith defconfig on ARM64( smbios3 present), but could shown with printk(KERN_DEBUG.
That's interesting. I would assume pr_debug and printk(KERN_DEBUG) to behave identically ...
Quoted 36 lines
Quoted 35 lines
Quoted 30 lines
Signed-off-by Kefeng Wang <[email protected]>--- drivers/firmware/dmi_scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/firmware/dmi_scan.c +2
-3@@ -560,7 +560,7 @@ static int __init dmi_present(const u8 *buf) dmi_ver >> 16, (dmi_ver >> 8) & 0xFF); }dmi_format_ids (dmi_ids_string,sizeof (dmi_ids_string)); -printk (KERN_DEBUG "DMI: %s\n" , dmi_ids_string); +pr_info ("DMI: %s\n" , dmi_ids_string);return 0 ; } }@@ -588,7 +588,7 @@ static int __init dmi_smbios3_present(const u8 *buf) dmi_ver >>16 , (dmi_ver >>8 ) &0xFF , dmi_ver & 0xFF);dmi_format_ids (dmi_ids_string,sizeof (dmi_ids_string)); -pr_debug ("DMI: %s\n" , dmi_ids_string); +pr_info ("DMI: %s\n" , dmi_ids_string);return 0 ; } } --Quoted 2 lines
1.7.12.4
.
Quoted 13 lines · Ard Biesheuvel
Quoted 12 lines · Kefeng Wang
Quoted 8 lines · Ard Biesheuvel
Quoted 4 lines · Kefeng Wang
Let's keep consistent when print
dmi_ids_stringbetween SMBIOS 2.x and SMBIOS 3.x, and always show the system identification string, like Vendor, Product/Board name and BIOS infos.Are you saying the
printk(KERN_DEBUG)was inconsistent with thepr_debug()before?
Quoted 6 lines
Quoted 3 lines
Yes, found it when check the boot dmesg on qemu, there is no print using
pr_debugwith defconfig on ARM64( smbios3 present), but could shown with printk(KERN_DEBUG.That's interesting. I would assume
pr_debugandprintk(KERN_DEBUG)to behave identically ...
And you'd be wrong ;-)
Quoted 1 line
From
include/linux/printk.h:
304 #if defined(CONFIG_DYNAMIC_DEBUG)
305 #include <linux/dynamic_debug.h>
306
307 /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ 308 #define pr_debug(fmt, ...) \
309 dynamic_pr_debug(fmt, ##__VA_ARGS__)
310 #elif defined(DEBUG)
311 #define pr_debug(fmt, ...) \
312 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
313 #else
314 #define pr_debug(fmt, ...) \
315 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
316 #endif
Which basically means that pr_debug() has no effect unless debugging is actually enabled, while printk(KERN_DEBUG ...) is always printed by the kernel (with a log level which may or may not make it to a specific output.)
Signature · 2 lines
Jean Delvare SUSE L3 Support
Quoted 39 lines · Jean Delvare
Quoted 13 lines · Ard Biesheuvel
Quoted 12 lines · Kefeng Wang
Quoted 8 lines · Ard Biesheuvel
Quoted 4 lines · Kefeng Wang
Let's keep consistent when print
dmi_ids_stringbetween SMBIOS 2.x and SMBIOS 3.x, and always show the system identification string, like Vendor, Product/Board name and BIOS infos.Are you saying the
printk(KERN_DEBUG)was inconsistent with thepr_debug()before?Quoted 6 lines
Quoted 3 lines
Yes, found it when check the boot dmesg on qemu, there is no print using
pr_debugwith defconfig on ARM64( smbios3 present), but could shown with printk(KERN_DEBUG.That's interesting. I would assume
pr_debugandprintk(KERN_DEBUG)to behave identically ...And you'd be wrong ;-)
From
include/linux/printk.h:304 #if
defined(CONFIG_DYNAMIC_DEBUG)
305 #include <linux/dynamic_debug.h>
306
307 /*dynamic_pr_debug()usespr_fmt()internally so we don't need it here */ 308 #definepr_debug(fmt, ...)\
309dynamic_pr_debug(fmt, ##__VA_ARGS__)
310 #elif defined(DEBUG)
311 #definepr_debug(fmt, ...)\
312printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
313 #else
314 #definepr_debug(fmt, ...)\
315no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
316 #endif
Quoted 5 lines
Which basically means that
pr_debug()has no effect unless debugging is actually enabled, whileprintk(KERN_DEBUG ...)is always printed by the kernel (with a log level which may or may not make it to a specific output.)
Good to know. Thanks for digging that up ...
Hi Wang,
Quoted 23 lines · Kefeng Wang
Let's keep consistent when print
dmi_ids_stringbetween SMBIOS 2.x and SMBIOS 3.x, and always show the system identification string, like Vendor, Product/Board name and BIOS infos.Signed-off-by Kefeng Wang <[email protected]>--- drivers/firmware/dmi_scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/firmware/dmi_scan.c +1
-1@@ -560,7 +560,7 @@ static int __init dmi_present(const u8 *buf) dmi_ver >> 16, (dmi_ver >> 8) & 0xFF); }dmi_format_ids (dmi_ids_string,sizeof (dmi_ids_string)); -printk (KERN_DEBUG "DMI: %s\n" , dmi_ids_string); +pr_info ("DMI: %s\n" , dmi_ids_string);return 0 ; } }
drivers/firmware/dmi_scan.c static int __init dmi_smbios3_present(const u8 *buf) · line 594
Quoted 8 lines
drivers/firmware/dmi_scan.c +1
-1@@ -588,7 +588,7 @@ static int __init dmi_smbios3_present(const u8 *buf) dmi_ver >>16 , (dmi_ver >>8 ) &0xFF , dmi_ver & 0xFF);dmi_format_ids (dmi_ids_string,sizeof (dmi_ids_string)); -pr_debug ("DMI: %s\n" , dmi_ids_string); +pr_info ("DMI: %s\n" , dmi_ids_string);return 0 ; } }
I agree. Applied, thanks.
Signature · 2 lines
Jean Delvare SUSE L3 Support