diff mbox

firmware: dmi_scan: Always show system identification string

Message ID 1481266447-51471-1-git-send-email-wangkefeng.wang@huawei.com
State Accepted
Commit d4af49f810db8b855b043615c3b4312e5ba8aedb
Headers show

Commit Message

Kefeng Wang Dec. 9, 2016, 6:54 a.m. UTC
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.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

---
 drivers/firmware/dmi_scan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
1.7.12.4

Comments

Ard Biesheuvel Dec. 9, 2016, 2:55 p.m. UTC | #1
On 9 December 2016 at 06:54, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
> 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?


> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

> ---

>  drivers/firmware/dmi_scan.c | 4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)

>

> diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c

> index 88bebe1..54be60e 100644

> --- a/drivers/firmware/dmi_scan.c

> +++ b/drivers/firmware/dmi_scan.c

> @@ -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

>
Jean Delvare Dec. 9, 2016, 3:30 p.m. UTC | #2
Hi Wang,

On Fri, 9 Dec 2016 14:54:07 +0800, Kefeng Wang wrote:
> 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.

> 

> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

> ---

>  drivers/firmware/dmi_scan.c | 4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c

> index 88bebe1..54be60e 100644

> --- a/drivers/firmware/dmi_scan.c

> +++ b/drivers/firmware/dmi_scan.c

> @@ -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;

>  		}

>  	}


I agree. Applied, thanks.

-- 
Jean Delvare
SUSE L3 Support
Kefeng Wang Dec. 12, 2016, 1:51 a.m. UTC | #3
On 2016/12/9 22:55, Ard Biesheuvel wrote:
> On 9 December 2016 at 06:54, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:

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

> 

> 

>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

>> ---

>>  drivers/firmware/dmi_scan.c | 4 ++--

>>  1 file changed, 2 insertions(+), 2 deletions(-)

>>

>> diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c

>> index 88bebe1..54be60e 100644

>> --- a/drivers/firmware/dmi_scan.c

>> +++ b/drivers/firmware/dmi_scan.c

>> @@ -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

>>

> 

> .

>
Ard Biesheuvel Dec. 13, 2016, 2:25 p.m. UTC | #4
On 12 December 2016 at 01:51, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>

>

> On 2016/12/9 22:55, Ard Biesheuvel wrote:

>> On 9 December 2016 at 06:54, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:

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

>


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

>>

>>

>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

>>> ---

>>>  drivers/firmware/dmi_scan.c | 4 ++--

>>>  1 file changed, 2 insertions(+), 2 deletions(-)

>>>

>>> diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c

>>> index 88bebe1..54be60e 100644

>>> --- a/drivers/firmware/dmi_scan.c

>>> +++ b/drivers/firmware/dmi_scan.c

>>> @@ -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

>>>

>>

>> .

>>

>
Jean Delvare Dec. 13, 2016, 2:42 p.m. UTC | #5
On mar., 2016-12-13 at 14:25 +0000, Ard Biesheuvel wrote:
> On 12 December 2016 at 01:51, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:

> >

> >

> > On 2016/12/9 22:55, Ard Biesheuvel wrote:

> >> On 9 December 2016 at 06:54, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:

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

> >

> 

> 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

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


-- 
Jean Delvare
SUSE L3 Support
Ard Biesheuvel Dec. 13, 2016, 2:43 p.m. UTC | #6
On 13 December 2016 at 14:42, Jean Delvare <jdelvare@suse.de> wrote:
> On mar., 2016-12-13 at 14:25 +0000, Ard Biesheuvel wrote:

>> On 12 December 2016 at 01:51, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:

>> >

>> >

>> > On 2016/12/9 22:55, Ard Biesheuvel wrote:

>> >> On 9 December 2016 at 06:54, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:

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

>> >

>>

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

>

> 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 ...
diff mbox

Patch

diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 88bebe1..54be60e 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -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;
 		}
 	}