linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] firmware: dmi_scan: Always show system identification string
@ 2016-12-09  6:54 Kefeng Wang
  2016-12-09 14:55 ` Ard Biesheuvel
  2016-12-09 15:30 ` Jean Delvare
  0 siblings, 2 replies; 7+ messages in thread
From: Kefeng Wang @ 2016-12-09  6:54 UTC (permalink / raw)
  To: Jean Delvare; +Cc: Ard Biesheuvel, Mark Rutland, linux-kernel, 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.

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] firmware: dmi_scan: Always show system identification string
  2016-12-09  6:54 [PATCH] firmware: dmi_scan: Always show system identification string Kefeng Wang
@ 2016-12-09 14:55 ` Ard Biesheuvel
  2016-12-12  1:51   ` Kefeng Wang
  2016-12-09 15:30 ` Jean Delvare
  1 sibling, 1 reply; 7+ messages in thread
From: Ard Biesheuvel @ 2016-12-09 14:55 UTC (permalink / raw)
  To: Kefeng Wang; +Cc: Jean Delvare, Mark Rutland, linux-kernel

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
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] firmware: dmi_scan: Always show system identification string
  2016-12-09  6:54 [PATCH] firmware: dmi_scan: Always show system identification string Kefeng Wang
  2016-12-09 14:55 ` Ard Biesheuvel
@ 2016-12-09 15:30 ` Jean Delvare
  1 sibling, 0 replies; 7+ messages in thread
From: Jean Delvare @ 2016-12-09 15:30 UTC (permalink / raw)
  To: Kefeng Wang; +Cc: Ard Biesheuvel, Mark Rutland, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] firmware: dmi_scan: Always show system identification string
  2016-12-09 14:55 ` Ard Biesheuvel
@ 2016-12-12  1:51   ` Kefeng Wang
  2016-12-13 14:25     ` Ard Biesheuvel
  0 siblings, 1 reply; 7+ messages in thread
From: Kefeng Wang @ 2016-12-12  1:51 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: Jean Delvare, Mark Rutland, linux-kernel



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] firmware: dmi_scan: Always show system identification string
  2016-12-12  1:51   ` Kefeng Wang
@ 2016-12-13 14:25     ` Ard Biesheuvel
  2016-12-13 14:42       ` Jean Delvare
  0 siblings, 1 reply; 7+ messages in thread
From: Ard Biesheuvel @ 2016-12-13 14:25 UTC (permalink / raw)
  To: Kefeng Wang; +Cc: Jean Delvare, Mark Rutland, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] firmware: dmi_scan: Always show system identification string
  2016-12-13 14:25     ` Ard Biesheuvel
@ 2016-12-13 14:42       ` Jean Delvare
  2016-12-13 14:43         ` Ard Biesheuvel
  0 siblings, 1 reply; 7+ messages in thread
From: Jean Delvare @ 2016-12-13 14:42 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: Kefeng Wang, Mark Rutland, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] firmware: dmi_scan: Always show system identification string
  2016-12-13 14:42       ` Jean Delvare
@ 2016-12-13 14:43         ` Ard Biesheuvel
  0 siblings, 0 replies; 7+ messages in thread
From: Ard Biesheuvel @ 2016-12-13 14:43 UTC (permalink / raw)
  To: Jean Delvare; +Cc: Kefeng Wang, Mark Rutland, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-12-13 14:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-09  6:54 [PATCH] firmware: dmi_scan: Always show system identification string Kefeng Wang
2016-12-09 14:55 ` Ard Biesheuvel
2016-12-12  1:51   ` Kefeng Wang
2016-12-13 14:25     ` Ard Biesheuvel
2016-12-13 14:42       ` Jean Delvare
2016-12-13 14:43         ` Ard Biesheuvel
2016-12-09 15:30 ` Jean Delvare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).