lib/vsprintf: Introduce %ptT for time64_t
Subsystems (5)
Andy Shevchenko
reviewerPATCH v3 2/3 ARM: bcm2835: Switch to use %ptT
In reply to Andy ShevchenkoUse %ptT instead of open coded variant to print content of time64_t type in human readable format.
--- drivers/firmware/raspberrypi.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/firmware/raspberrypi.c +3 -9
@@ -182,16 +182,10 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw)RPI_FIRMWARE_GET_FIRMWARE_REVISION , &packet, sizeof(packet)); -if (ret ==0 ) { -struct tm tm; - -time64_to_tm (packet,0 , &tm); +if (ret) +return ; -dev_info (fw->cl.dev, -"Attached to firmware from %04ld-%02d-%02d %02d:%02d\n" , - tm.tm_year +1900 , tm.tm_mon +1 , tm.tm_mday, - tm.tm_hour, tm.tm_min); - } +dev_info (fw->cl.dev,"Attached to firmware from %ptT\n" , &packet); } static void
Signature · 1 line
2.25.1
Andy Shevchenko
reviewerPATCH v3 1/3 lib/vsprintf: Print time64_t in human readable format
In reply to Andy ShevchenkoThere are users which print time and date represented by content of time64_t type in human readable format.
Instead of open coding that each time introduce %ptT[dt][r] specifier.
Few test cases for %ptT specifier has been added as well.
--- Documentation/core-api/printk-formats.rst | 22 ++++++++-------- lib/test_printf.c | 13 +++++++--- lib/vsprintf.c | 31 +++++++++++++++++++++-- 3 files changed, 51 insertions(+), 15 deletions(-)
Documentation/core-api/printk-formats.rst +12 -10
@@ -468,21 +468,23 @@ Examples (OF):: %pfwf /ocp@68000000/i2c@48072000/camera@10/port/endpoint - Full name %pfwP endpoint - Node name -Time and date (struct rtc_time) -------------------------------- +Time and date +------------- :: - %ptR YYYY-mm-ddTHH:MM:SS - %ptRd YYYY-mm-dd - %ptRt HH:MM:SS - %ptR[dt][r] + %pt[RT] YYYY-mm-ddTHH:MM:SS + %pt[RT]d YYYY-mm-dd + %pt[RT]t HH:MM:SS + %pt[RT][dt][r] -For printing date and time as represented by struct rtc_time structure in -human readable format. +For printing date and time as represented by + R struct rtc_time structure + T time64_t type +in human readable format. -By default year will be incremented by 1900 and month by 1. Use %ptRr (raw) -to suppress this behaviour. +By default year will be incremented by 1900 and month by 1. +Use %pt[RT]r (raw) to suppress this behaviour. Passed by reference.
lib/test_printf.c +10 -3
@@ -478,7 +478,7 @@ struct_va_format(void) }static void __init -struct_rtc_time (void ) +time_and_date (void ) {/* 1543210543 */ const struct rtc_time tm = {
@@ -489,14 +489,21 @@ struct_rtc_time(void) .tm_mon = 10, .tm_year = 118, }; +/* 2019-01-04T15:32:23 */ +time64_t t =1546615943 ; -test ("(%ptR?)" ,"%pt" , &tm); +test ("(%pt?)" ,"%pt" , &tm);test ("2018-11-26T05:35:43" ,"%ptR" , &tm);test ("0118-10-26T05:35:43" ,"%ptRr" , &tm);test ("05:35:43|2018-11-26" ,"%ptRt|%ptRd" , &tm, &tm);test ("05:35:43|0118-10-26" ,"%ptRtr|%ptRdr" , &tm, &tm);test ("05:35:43|2018-11-26" ,"%ptRttr|%ptRdtr" , &tm, &tm);test ("05:35:43 tr|2018-11-26 tr" ,"%ptRt tr|%ptRd tr" , &tm, &tm); + +test ("2019-01-04T15:32:23" ,"%ptT" , &t); +test ("0119-00-04T15:32:23" ,"%ptTr" , &t); +test ("15:32:23|2019-01-04" ,"%ptTt|%ptTd" , &t, &t); +test ("15:32:23|0119-00-04" ,"%ptTtr|%ptTdr" , &t, &t); } static void __init
@@ -661,7 +668,7 @@ test_pointer(void)uuid ();dentry ();struct_va_format (); -struct_rtc_time (); +time_and_date ();struct_clk ();bitmap ();netdev_features ();
lib/vsprintf.c +29 -2
@@ -34,6 +34,7 @@#include <linux/dcache.h> #include <linux/cred.h> #include <linux/rtc.h> +#include <linux/time.h> #include <linux/uuid.h> #include <linux/of.h> #include <net/addrconf.h>
@@ -1819,6 +1820,29 @@ char *rtc_str(char *buf, char *end, const struct rtc_time *tm,return buf; } +static noinline_for_stack +char *time64_str(char *buf, char *end, const time64_t time, +struct printf_spec spec,const char *fmt) +{ +struct rtc_time rtc_time; +struct tm tm; + +time64_to_tm (time,0 , &tm); + + rtc_time.tm_sec = tm.tm_sec; + rtc_time.tm_min = tm.tm_min; + rtc_time.tm_hour = tm.tm_hour; + rtc_time.tm_mday = tm.tm_mday; + rtc_time.tm_mon = tm.tm_mon; + rtc_time.tm_year = tm.tm_year; + rtc_time.tm_wday = tm.tm_wday; + rtc_time.tm_yday = tm.tm_yday; + + rtc_time.tm_isdst =0 ; + +return rtc_str (buf, end, &rtc_time, spec, fmt); +} +static noinline_for_stack char *time_and_date(char *buf, char *end, void *ptr, struct printf_spec spec,const char *fmt)
@@ -1826,8 +1850,10 @@ char *time_and_date(char *buf, char *end, void *ptr, struct printf_spec spec,switch (fmt[1 ]) {case 'R' :return rtc_str (buf, end, (const struct rtc_time *)ptr, spec, fmt); +case 'T' : +return time64_str (buf, end, *(const time64_t *)ptr, spec, fmt);default : -return error_string (buf, end,"(%ptR?)" , spec); +return error_string (buf, end,"(%pt?)" , spec); } }
@@ -2143,8 +2169,9 @@ char *fwnode_string(char *buf, char *end, struct fwnode_handle *fwnode,* - 'd[234]' For a dentry name (optionally 2-4 last components) * - 'D[234]' Same as 'd' but for a struct file * - 'g' For block_device name (gendisk + partition number) -* - 't[R][dt][r]' For time and date as represented: +* - 't[RT][dt][r]' For time and date as represented by: * R struct rtc_time +* T time64_t * - 'C' For a clock, it prints the name (Common Clock Framework) or address * (legacy clock framework) of the clock * - 'Cn' For a clock, it prints the name (Common Clock Framework) or address
Signature · 1 line
2.25.1
Andy Shevchenko
reviewerv3 cover lib/vsprintf: Introduce %ptT for time64_t
It is a logical continuation of previously applied %ptR for struct rtc_time. We have few users of time64_t that would like to print it.
Andrew, since Petr can't pay attention on this perhaps it can be passed thru your tree?
Sergey, Steven, what do you think?
In v3:
- added tag (Alexandre)
- dropped for now USB Tegra patch (Thierry wasn't clear about)
In v2:
- drop #ifdef CONFIG_RTC_LIB with time64_to_rtc_time() altogether (Petr, Alexandre)
- update default error path message along with test case for it
- add Hans' Ack for patch 3
Andy Shevchenko (3):
lib/vsprintf: Print time64_t in human readable format
ARM: bcm2835: Switch to use %ptT
[media] usb: pulse8-cec: Switch to use %ptT
Documentation/core-api/printk-formats.rst | 22 ++++++++-------- drivers/firmware/raspberrypi.c | 12 +++------ drivers/media/usb/pulse8-cec/pulse8-cec.c | 6 +---- lib/test_printf.c | 13 +++++++--- lib/vsprintf.c | 31 +++++++++++++++++++++-- 5 files changed, 55 insertions(+), 29 deletions(-)
Signature · 1 line
2.25.1
Andy Shevchenko
reviewerPATCH v3 3/3 usb: pulse8-cec: Switch to use %ptT
Use %ptT instead of open coded variant to print content of time64_t type in human readable format.
--- drivers/media/usb/pulse8-cec/pulse8-cec.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/media/usb/pulse8-cec/pulse8-cec.c +1 -5
@@ -661,7 +661,6 @@ static int pulse8_setup(struct pulse8 *pulse8, struct serio *serio,u8 *data = pulse8->data +1 ;u8 cmd[2 ];int err; -struct tm tm;time64_t date; pulse8->vers =0 ;
@@ -682,10 +681,7 @@ static int pulse8_setup(struct pulse8 *pulse8, struct serio *serio,if (err)return err; date = (data[0 ] <<24 ) | (data[1 ] <<16 ) | (data[2 ] <<8 ) | data[3 ]; -time64_to_tm (date,0 , &tm); -dev_info (pulse8->dev,"Firmware build date %04ld.%02d.%02d %02d:%02d:%02d\n" , - tm.tm_year +1900 , tm.tm_mon +1 , tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec); +dev_info (pulse8->dev,"Firmware build date %ptT\n" , &date);dev_dbg (pulse8->dev,"Persistent config:\n" ); cmd[0 ] =MSGCODE_GET_AUTO_ENABLED ;
Signature · 1 line
2.25.1
Steven Rostedt
maintainerQuoted 7 lines · On Wed, 15 Apr 2020 20:00:43 +0300 Andy Shevchenko…
It is a logical continuation of previously applied %ptR for struct
rtc_time. We have few users oftime64_tthat would like to print it.Andrew, since Petr can't pay attention on this perhaps it can be passed thru your tree?
Sergey, Steven, what do you think?
I'm fine with these changes. Sergey, what do you think?
-- Steve
Re: [PATCH v3 1/3] lib/vsprintf: Print time64_t in human readable format
In reply to Andy ShevchenkoOn (20/04/15 20:00), Andy Shevchenko wrote:
[..]
Quoted 15 lines
#include <
linux/of.h>
#include <net/addrconf.h>lib/vsprintf.c +9
-0@@ -1819,6 +1820,29 @@ char *rtc_str(char *buf, char *end, const struct rtc_time *tm,return buf; } +static noinline_for_stack +char *time64_str(char *buf, char *end, const time64_t time, +struct printf_spec spec,const char *fmt) +{ +struct rtc_time rtc_time; +struct tm tm; + +time64_to_tm (time,0 , &tm); +
lib/vsprintf.c char *rtc_str(char *buf, char *end, const struct rtc_time *tm, · line 1841
Quoted 10 lines
lib/vsprintf.c +10
-0+ rtc_time.tm_sec = tm.tm_sec; + rtc_time.tm_min = tm.tm_min; + rtc_time.tm_hour = tm.tm_hour; + rtc_time.tm_mday = tm.tm_mday; + rtc_time.tm_mon = tm.tm_mon; + rtc_time.tm_year = tm.tm_year; + rtc_time.tm_wday = tm.tm_wday; + rtc_time.tm_yday = tm.tm_yday; + + rtc_time.tm_isdst =0 ;
Here you convert time64_t (signed, we also have unsigned version - timeu64_t) to tm first and then convert tm to rtc_time. Will rtc_time64_to_tm() do the trick?
-ss
Quoted 6 lines · Steven Rostedt
Quoted 3 lines · On Wed, 15 Apr 2020 20:00:43 +0300 Andy Shevchenko…
It is a logical continuation of previously applied %ptR for struct
rtc_time. We have few users oftime64_tthat would like to print it.
Quoted 6 lines
Quoted 4 lines
Andrew, since Petr can't pay attention on this perhaps it can be passed thru your tree?
Sergey, Steven, what do you think?
I'm fine with these changes. Sergey, what do you think?
I'm not against it in general, I'm slightly concerned if "two users" is enough of a justification for new vsprintf() specifier.
-ss
Quoted 10 lines · Sergey Senozhatsky
Quoted 9 lines · Steven Rostedt
Quoted 6 lines · On Wed, 15 Apr 2020 20:00:43 +0300 Andy Shevchenko…
It is a logical continuation of previously applied %ptR for struct
rtc_time. We have few users oftime64_tthat would like to print it.Andrew, since Petr can't pay attention on this perhaps it can be passed thru your tree?
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Sergey, Steven, what do you think?
I'm fine with these changes. Sergey, what do you think?
I'm not against it in general, I'm slightly concerned if "two users" is enough of a justification for new
vsprintf()specifier.
Me too as separate functions could be used here.
Re: [PATCH v3 2/3] ARM: bcm2835: Switch to use %ptT
In reply to Andy ShevchenkoOn (20/04/15 20:00), Andy Shevchenko wrote:
[..]
Quoted 12 lines
drivers/firmware/raspberrypi.c +0
-4@@ -182,16 +182,10 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw)RPI_FIRMWARE_GET_FIRMWARE_REVISION , &packet, sizeof(packet)); -if (ret ==0 ) { -struct tm tm; - -time64_to_tm (packet,0 , &tm);
drivers/firmware/raspberrypi.c rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) · line 189
Quoted 10 lines
drivers/firmware/raspberrypi.c +3
-5+if (ret) +return ; -dev_info (fw->cl.dev, -"Attached to firmware from %04ld-%02d-%02d %02d:%02d\n" , - tm.tm_year +1900 , tm.tm_mon +1 , tm.tm_mday, - tm.tm_hour, tm.tm_min); - } +dev_info (fw->cl.dev,"Attached to firmware from %ptT\n" , &packet); }
So can this be instead:
struct rtc_time tm; rtc_time64_to_tm(time, &tm); dev_info(.... "%ptR", &tm);
?
If it can, then I'd probably say something like "can we then just use rtc_time64_to_tm()"?
-ss
Re: [PATCH v3 2/3] ARM: bcm2835: Switch to use %ptT
Quoted 13 lines · Sergey Senozhatsky
drivers/firmware/raspberrypi.c rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) · line 189
Quoted 10 lines
drivers/firmware/raspberrypi.c +3
-5+if (ret) +return ; -dev_info (fw->cl.dev, -"Attached to firmware from %04ld-%02d-%02d %02d:%02d\n" , - tm.tm_year +1900 , tm.tm_mon +1 , tm.tm_mday, - tm.tm_hour, tm.tm_min); - } +dev_info (fw->cl.dev,"Attached to firmware from %ptT\n" , &packet); }So can this be instead:
Quoted 4 lines
struct rtc_time tm; rtc_time64_to_tm(time, &tm); dev_info(.... "%ptR", &tm);
^^^^ %ptRdt ?
P.S. I wonder what's the longest English word which can be constructed from a valid vsprintf() specifiers sequence (consecutive specifiers).
-ss
Andy Shevchenko
reviewerQuoted 11 lines · Joe Perches
Quoted 10 lines · Sergey Senozhatsky
Quoted 9 lines · Steven Rostedt
Quoted 6 lines · On Wed, 15 Apr 2020 20:00:43 +0300 Andy Shevchenko…
It is a logical continuation of previously applied %ptR for struct
rtc_time. We have few users oftime64_tthat would like to print it.Andrew, since Petr can't pay attention on this perhaps it can be passed thru your tree?
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Sergey, Steven, what do you think?
I'm fine with these changes. Sergey, what do you think?
I'm not against it in general, I'm slightly concerned if "two users" is enough of a justification for new
vsprintf()specifier.Me too as separate functions could be used here.
If we drop T in favour of ' ' (space) as delimiter, we will immediately get 5 or 6 users (I didn't check for new ones during last couple of years though).
Signature · 2 lines
With Best Regards, Andy Shevchenko
Andy Shevchenko
reviewerRe: [PATCH v3 1/3] lib/vsprintf: Print time64_t in human readable format
In reply to Sergey SenozhatskyQuoted 23 lines · Sergey Senozhatsky
On (20/04/15 20:00), Andy Shevchenko wrote:
[..]Quoted 21 lines
#include <
linux/of.h>
#include <net/addrconf.h>lib/vsprintf.c +15
-0@@ -1819,6 +1820,29 @@ char *rtc_str(char *buf, char *end, const struct rtc_time *tm,return buf; } +static noinline_for_stack +char *time64_str(char *buf, char *end, const time64_t time, +struct printf_spec spec,const char *fmt) +{ +struct rtc_time rtc_time; +struct tm tm; + +time64_to_tm (time,0 , &tm); + + rtc_time.tm_sec = tm.tm_sec; + rtc_time.tm_min = tm.tm_min; + rtc_time.tm_hour = tm.tm_hour; + rtc_time.tm_mday = tm.tm_mday; + rtc_time.tm_mon = tm.tm_mon; + rtc_time.tm_year = tm.tm_year;
Quoted 8 lines
lib/vsprintf.c char *rtc_str(char *buf, char *end, const struct rtc_time *tm, · line 1841
Quoted 4 lines
lib/vsprintf.c +4
-0+ rtc_time.tm_wday = tm.tm_wday; + rtc_time.tm_yday = tm.tm_yday; + + rtc_time.tm_isdst =0 ;Here you convert
time64_t(signed, we also have unsigned version -timeu64_t) to tm first and then convert tm tortc_time. Willrtc_time64_to_tm()do the trick?
You missed v2 round. The RTC is configuration dependent and Alexandre in favour of removing those from RTC completely by replacing with always enabled time64_to_tm().
Signature · 2 lines
With Best Regards, Andy Shevchenko
Andy Shevchenko
reviewerRe: [PATCH v3 2/3] ARM: bcm2835: Switch to use %ptT
In reply to Sergey SenozhatskyQuoted 32 lines · Sergey Senozhatsky
On (20/04/15 20:00), Andy Shevchenko wrote:
[..]Quoted 12 lines
drivers/firmware/raspberrypi.c +0
-4@@ -182,16 +182,10 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw)RPI_FIRMWARE_GET_FIRMWARE_REVISION , &packet, sizeof(packet)); -if (ret ==0 ) { -struct tm tm; - -time64_to_tm (packet,0 , &tm);drivers/firmware/raspberrypi.c rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) · line 189
Quoted 10 lines
drivers/firmware/raspberrypi.c +3
-5+if (ret) +return ; -dev_info (fw->cl.dev, -"Attached to firmware from %04ld-%02d-%02d %02d:%02d\n" , - tm.tm_year +1900 , tm.tm_mon +1 , tm.tm_mday, - tm.tm_hour, tm.tm_min); - } +dev_info (fw->cl.dev,"Attached to firmware from %ptT\n" , &packet); }So can this be instead:
struct rtc_time tm; rtc_time64_to_tm(time, &tm); dev_info(.... "%ptR", &tm);
Quoted 4 lines
?
If it can, then I'd probably say something like "can we then just use
rtc_time64_to_tm()"?
Same comment as per previous patch (TL;DR: no, it can't).
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v3 1/3] lib/vsprintf: Print time64_t in human readable format
In reply to Andy ShevchenkoOn (20/04/21 16:08), Andy Shevchenko wrote:
[..]
Quoted 7 lines
Quoted 3 lines
Here you convert
time64_t(signed, we also have unsigned version -timeu64_t) to tm first and then convert tm tortc_time. Willrtc_time64_to_tm()do the trick?You missed v2 round. The RTC is configuration dependent and Alexandre in favour of removing those from RTC completely by replacing with always enabled
time64_to_tm().
I see.
I don't think I was Cc-ed on v1/v2.
-ss
Andy Shevchenko
reviewerRe: [PATCH v3 1/3] lib/vsprintf: Print time64_t in human readable format
Quoted 6 lines · Sergey Senozhatsky
On (20/04/21 16:08), Andy Shevchenko wrote:
[..]Quoted 4 lines
Quoted 3 lines
Here you convert
time64_t(signed, we also have unsigned version -timeu64_t) to tm first and then convert tm tortc_time. Willrtc_time64_to_tm()do the trick?
Quoted 6 lines
Quoted 3 lines
You missed v2 round. The RTC is configuration dependent and Alexandre in favour of removing those from RTC completely by replacing with always enabled
time64_to_tm().I see.
I don't think I was Cc-ed on v1/v2.
It was in v1 [1], but yes, by some reason you were not in Cc, my apology.
[1]: https://lore.kernel.org/patchwork/patch/1029110/
Signature · 2 lines
With Best Regards, Andy Shevchenko
Petr Mladek
maintainerQuoted 2 lines · Andy Shevchenko
It is a logical continuation of previously applied %ptR for struct
rtc_time. We have few users oftime64_tthat would like to print it.
It seems that everything was explained and the patches look good to me. If we allowed %ptR then it makes sense to allow %ptT as well.
For all three patches:
Best Regards,
Petr
Sergey Senozhatsky
Acked-byQuoted 10 lines · Petr Mladek
Quoted 2 lines · Andy Shevchenko
It is a logical continuation of previously applied %ptR for struct
rtc_time. We have few users oftime64_tthat would like to print it.It seems that everything was explained and the patches look good to me. If we allowed %ptR then it makes sense to allow %ptT as well.
For all three patches:
Rewieved-by Petr Mladek <[email protected]>
-ss
Petr Mladek
maintainerQuoted 5 lines · Sergey Senozhatsky
Quoted 4 lines · Petr Mladek
Quoted 2 lines · Andy Shevchenko
It is a logical continuation of previously applied %ptR for struct
rtc_time. We have few users oftime64_tthat would like to print it.
Quoted 8 lines
Quoted 6 lines
It seems that everything was explained and the patches look good to me. If we allowed %ptR then it makes sense to allow %ptT as well.
For all three patches:
Rewieved-by Petr Mladek <[email protected]>
This patchset has been committed into printk/linux.git, branch for-5.8-printf-time64_t.
Note that it is a new git repo with shared write access.
Best Regards,
Petr
Re: [PATCH v3 2/3] ARM: bcm2835: Switch to use %ptT
In reply to Andy ShevchenkoHi,
Quoted 5 lines · Andy Shevchenko
Use %ptT instead of open coded variant to print content of
time64_ttype in human readable format.Signed-off-by Andy Shevchenko <[email protected]>---
as originally reported by Stefan Wahren, this patch is likely to be the cause for a regression on RPi3b+ 32bit mode (multi_v7_defconfig, 5.8.0-rc1-00019-ga5dc8300df75):
[ 3.759892] raspberrypi-firmware soc:firmware: Attached to firmware from 18446744073709048425-02-19T15:52:16
Whereas the same doesn't seem to happen in 64bit mode:
[ 1.584126] raspberrypi-firmware soc:firmware: Attached to firmware from 2020-02-12T12:39:27
Regards,
Nicolas
Andy Shevchenko
reviewerRe: [PATCH v3 2/3] ARM: bcm2835: Switch to use %ptT
Quoted 11 lines · Nicolas Saenz Julienne
Quoted 5 lines · Andy Shevchenko
Use %ptT instead of open coded variant to print content of
time64_ttype in human readable format.Signed-off-by Andy Shevchenko <[email protected]>---
as originally reported by Stefan Wahren, this patch is likely to be the cause for a regression on RPi3b+ 32bit mode (
multi_v7_defconfig, 5.8.0-rc1-00019-ga5dc8300df75):
Quoted 5 lines
[ 3.759892] raspberrypi-firmware soc:firmware: Attached to firmware from 18446744073709048425-02-19T15:52:16Whereas the same doesn't seem to happen in 64bit mode:
[ 1.584126] raspberrypi-firmware soc:firmware: Attached to firmware from 2020-02-12T12:39:27
Had you chance to run test_printf on that machine and see if it reports any failure? If no, can you provide a raw date which makes this happen?
Ah, I think I have an idea what is going on... stay tuned!
Does below fix it?
drivers/firmware/raspberrypi.c +3 -2
@@ -181,6 +181,7 @@ EXPORT_SYMBOL_GPL(rpi_firmware_property);static void rpi_firmware_print_firmware_revision (struct rpi_firmware *fw) { +time64_t date_and_time;u32 packet; int ret = rpi_firmware_property(fw, RPI_FIRMWARE_GET_FIRMWARE_REVISION,
@@ -189,7 +190,8 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw)if (ret)return ; -dev_info (fw->cl.dev,"Attached to firmware from %ptT\n" , &packet); + date_and_time = packet; +dev_info (fw->cl.dev,"Attached to firmware from %ptT\n" , &date_and_time); } --
With Best Regards,
Andy Shevchenko
Re: [PATCH v3 2/3] ARM: bcm2835: Switch to use %ptT
Quoted 21 lines · Andy Shevchenko
Quoted 12 lines · Nicolas Saenz Julienne
Quoted 5 lines · Andy Shevchenko
Use %ptT instead of open coded variant to print content of
time64_ttype in human readable format.Signed-off-by Andy Shevchenko <[email protected]>---
as originally reported by Stefan Wahren, this patch is likely to be the cause
for a regression on RPi3b+ 32bit mode (multi_v7_defconfig, 5.8.0-rc1-00019-ga5dc8300df75):Quoted 7 lines
[ 3.759892] raspberrypi-firmware soc:firmware: Attached to firmware from18446744073709048425-02-19T15:52:16
Whereas the same doesn't seem to happen in 64bit mode:
[ 1.584126] raspberrypi-firmware soc:firmware: Attached to firmware from2020-02-12T12:39:27
Quoted 7 lines
Had you chance to run
test_printfon that machine and see if it reports any failure?
If no, can you provide a raw date which makes this happen?Ah, I think I have an idea what is going on... stay tuned!
Does below fix it?
Yes :)
Quoted 21 lines
drivers/firmware/raspberrypi.c +3
-1@@ -181,6 +181,7 @@ EXPORT_SYMBOL_GPL(rpi_firmware_property);static void rpi_firmware_print_firmware_revision (struct rpi_firmware *fw) { +time64_t date_and_time;u32 packet; int ret = rpi_firmware_property(fw, RPI_FIRMWARE_GET_FIRMWARE_REVISION,@@ -189,7 +190,8 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw)if (ret)return ; -dev_info (fw->cl.dev,"Attached to firmware from %ptT\n" , &packet); + date_and_time = packet; +dev_info (fw->cl.dev,"Attached to firmware from %ptT\n" , &date_and_time); }
Andy Shevchenko
reviewerRe: [PATCH v3 2/3] ARM: bcm2835: Switch to use %ptT
Quoted 26 lines · Nicolas Saenz Julienne
Quoted 25 lines · Andy Shevchenko
Quoted 12 lines · Nicolas Saenz Julienne
Quoted 5 lines · Andy Shevchenko
Use %ptT instead of open coded variant to print content of
time64_ttype in human readable format.Signed-off-by Andy Shevchenko <[email protected]>---
as originally reported by Stefan Wahren, this patch is likely to be the cause
for a regression on RPi3b+ 32bit mode (multi_v7_defconfig, 5.8.0-rc1-00019-ga5dc8300df75):Quoted 7 lines
[ 3.759892] raspberrypi-firmware soc:firmware: Attached to firmware from18446744073709048425-02-19T15:52:16
Whereas the same doesn't seem to happen in 64bit mode:
[ 1.584126] raspberrypi-firmware soc:firmware: Attached to firmware from2020-02-12T12:39:27
Had you chance to run
test_printfon that machine and see if it reports any failure?
If no, can you provide a raw date which makes this happen?
Quoted 5 lines
Quoted 3 lines
Ah, I think I have an idea what is going on... stay tuned!
Does below fix it?
Yes :)
Patch has been just sent. I hope it can go via printk tree, because MAINTAINERS keeps silent for this file.
Signature · 2 lines
With Best Regards, Andy Shevchenko