Re: [PATCH v3 2/3] ARM: bcm2835: Switch to use %ptT

From: Andy Shevchenko
Date: Tue Jun 16 2020 - 12:14:02 EST


On Tue, Jun 16, 2020 at 05:53:23PM +0200, Nicolas Saenz Julienne wrote:
> On Wed, 2020-04-15 at 20:00 +0300, Andy Shevchenko wrote:
> > Use %ptT instead of open coded variant to print content of
> > time64_t type in human readable format.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> > ---
>
> 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

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?

--- a/drivers/firmware/raspberrypi.c
+++ b/drivers/firmware/raspberrypi.c
@@ -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