Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1539142 > unrolled thread

[PATCH] firmware: dmi_scan: Always show system identification string

Started byKefeng Wang <wangkefeng.wang@huawei.com>
First post2016-12-09 08:00 +0100
Last post2016-12-09 16:40 +0100
Articles 7 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] firmware: dmi_scan: Always show system identification string Kefeng Wang <wangkefeng.wang@huawei.com> - 2016-12-09 08:00 +0100
    Re: [PATCH] firmware: dmi_scan: Always show system identification string Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-12-09 16:00 +0100
      Re: [PATCH] firmware: dmi_scan: Always show system identification  string Kefeng Wang <wangkefeng.wang@huawei.com> - 2016-12-12 03:00 +0100
        Re: [PATCH] firmware: dmi_scan: Always show system identification string Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-12-13 15:30 +0100
          Re: [PATCH] firmware: dmi_scan: Always show system identification string Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-12-13 15:50 +0100
          Re: [PATCH] firmware: dmi_scan: Always show system identification  string Jean Delvare <jdelvare@suse.de> - 2016-12-13 15:50 +0100
    Re: [PATCH] firmware: dmi_scan: Always show system identification  string Jean Delvare <jdelvare@suse.de> - 2016-12-09 16:40 +0100

#1539142 — [PATCH] firmware: dmi_scan: Always show system identification string

FromKefeng Wang <wangkefeng.wang@huawei.com>
Date2016-12-09 08:00 +0100
Subject[PATCH] firmware: dmi_scan: Always show system identification string
Message-ID<sMnjY-8qN-15@gated-at.bofh.it>
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;
 		}
 	}
-- 
1.7.12.4

[toc] | [next] | [standalone]


#1539425

FromArd Biesheuvel <ard.biesheuvel@linaro.org>
Date2016-12-09 16:00 +0100
Message-ID<sMuOu-4x7-15@gated-at.bofh.it>
In reply to#1539142
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
>

[toc] | [prev] | [next] | [standalone]


#1540107 — Re: [PATCH] firmware: dmi_scan: Always show system identification string

FromKefeng Wang <wangkefeng.wang@huawei.com>
Date2016-12-12 03:00 +0100
SubjectRe: [PATCH] firmware: dmi_scan: Always show system identification string
Message-ID<sNo4h-6w8-1@gated-at.bofh.it>
In reply to#1539425

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

[toc] | [prev] | [next] | [standalone]


#1541103

FromArd Biesheuvel <ard.biesheuvel@linaro.org>
Date2016-12-13 15:30 +0100
Message-ID<sNWfD-2go-7@gated-at.bofh.it>
In reply to#1540107
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
>>>
>>
>> .
>>
>

[toc] | [prev] | [next] | [standalone]


#1541136

FromArd Biesheuvel <ard.biesheuvel@linaro.org>
Date2016-12-13 15:50 +0100
Message-ID<sNWyZ-2mS-9@gated-at.bofh.it>
In reply to#1541103
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 ...

[toc] | [prev] | [next] | [standalone]


#1541137 — Re: [PATCH] firmware: dmi_scan: Always show system identification string

FromJean Delvare <jdelvare@suse.de>
Date2016-12-13 15:50 +0100
SubjectRe: [PATCH] firmware: dmi_scan: Always show system identification string
Message-ID<sNWyZ-2mS-7@gated-at.bofh.it>
In reply to#1541103
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

[toc] | [prev] | [next] | [standalone]


#1539445 — Re: [PATCH] firmware: dmi_scan: Always show system identification string

FromJean Delvare <jdelvare@suse.de>
Date2016-12-09 16:40 +0100
SubjectRe: [PATCH] firmware: dmi_scan: Always show system identification string
Message-ID<sMvrc-4YR-25@gated-at.bofh.it>
In reply to#1539142
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web