Skip to contentSkip to conversation

firmware: dmi_scan: Always show system identification string

PATCH In review Kefeng Wang 3 participants 7 messages Dec 9, 2016 – Dec 13, 2016 Dmi/smbios support

lore
Share & tools
lore
#0 lore raw

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
index 88bebe1..54be60e 100644
@@ -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
#1 lore raw
Quoted 4 lines · Kefeng Wang

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.

Are you saying the printk(KERN_DEBUG) was inconsistent with the pr_debug() before?

Quoted 30 lines
---
 drivers/firmware/dmi_scan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firmware/dmi_scan.c +2 -3
index 88bebe1..54be60e 100644
@@ -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

#2 lore raw
Quoted 8 lines · Ard Biesheuvel
Quoted 4 lines · Kefeng Wang

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.

Are you saying the printk(KERN_DEBUG) was inconsistent with the pr_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
---
 drivers/firmware/dmi_scan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firmware/dmi_scan.c +2 -3
index 88bebe1..54be60e 100644
@@ -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

.

#3 lore raw
Quoted 9 lines · Kefeng Wang
Quoted 6 lines · Ard Biesheuvel
Quoted 4 lines · Kefeng Wang

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.

Quoted 6 lines
Quoted 2 lines

Are you saying the printk(KERN_DEBUG) was inconsistent with the pr_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.

That's interesting. I would assume pr_debug and printk(KERN_DEBUG) to behave identically ...

Quoted 36 lines
Quoted 35 lines
Quoted 30 lines
---
 drivers/firmware/dmi_scan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firmware/dmi_scan.c +2 -3
index 88bebe1..54be60e 100644
@@ -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

.

#4 lore raw
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_string between 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 6 lines
Quoted 3 lines

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.

That's interesting. I would assume pr_debug and printk(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
#5 lore raw
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_string between 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 6 lines
Quoted 3 lines

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.

That's interesting. I would assume pr_debug and printk(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() 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

Quoted 5 lines

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.)

Good to know. Thanks for digging that up ...

#6 lore raw
In reply to Kefeng Wang

Hi Wang,

Quoted 23 lines · Kefeng Wang

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 +1 -1
index 88bebe1..54be60e 100644
@@ -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