Re: [PATCH 1/3] powerpc: mac: fix rtc read functions

2018-06-19 Thread Arnd Bergmann
On Mon, Jun 18, 2018 at 10:04 PM, Andreas Schwab wrote: > On Jun 18 2018, Mathieu Malaterre wrote: > >> Sadly, trying again today does not work anymore. Adding some printk >> just before WARN_ON: >> >> +printk(KERN_ERR " rtc DBG pmu_get_time1: %lld %d %lld \n", now, >> RTC_OFFSET, now - RTC_OFFSE

Re: [PATCH 1/3] powerpc: mac: fix rtc read functions

2018-06-18 Thread Mathieu Malaterre
On Mon, Jun 18, 2018 at 10:04 PM Andreas Schwab wrote: > > On Jun 18 2018, Mathieu Malaterre wrote: > > > Sadly, trying again today does not work anymore. Adding some printk > > just before WARN_ON: > > > > +printk(KERN_ERR " rtc DBG pmu_get_time1: %lld %d %lld \n", now, > > RTC_OFFSET, now - RTC

Re: [PATCH 1/3] powerpc: mac: fix rtc read functions

2018-06-18 Thread Andreas Schwab
On Jun 18 2018, Mathieu Malaterre wrote: > Sadly, trying again today does not work anymore. Adding some printk > just before WARN_ON: > > +printk(KERN_ERR " rtc DBG pmu_get_time1: %lld %d %lld \n", now, > RTC_OFFSET, now - RTC_OFFSET ); > +printk(KERN_ERR " rtc DBG pmu_get_time2: %x %x %x %x %d \

Re: [PATCH 1/3] powerpc: mac: fix rtc read functions

2018-06-18 Thread Mathieu Malaterre
On Mon, Jun 18, 2018 at 4:07 PM Arnd Bergmann wrote: > > As Mathieu pointed out, my conversion to time64_t was incorrect and resulted > in negative times to be read from the RTC. The problem is that during the > conversion from a byte array to a time64_t, the 'unsigned char' variable > holding the

[PATCH 1/3] powerpc: mac: fix rtc read functions

2018-06-18 Thread Arnd Bergmann
As Mathieu pointed out, my conversion to time64_t was incorrect and resulted in negative times to be read from the RTC. The problem is that during the conversion from a byte array to a time64_t, the 'unsigned char' variable holding the top byte gets turned into a negative signed 32-bit integer befo