Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Allwinner A64 non-monotonic clock



On Fri, Jan 25, 2019 at 07:14:15AM -0400, Jared McNeill wrote:
> Hi Artturi --
> 
> We have applied the workaround based on the information in the LKML thread
> but it doesn't seem to fix all cases:
> 
> https://nxr.netbsd.org/xref/src/sys/arch/arm/cortex/gtmr.c#164
> 
> Cheers,
> Jared
> 

I didn't find anything using gtmr_cntv_tval_read(), but their fixes[0]
does look a bit different for gtmr_cntvct_read() counter-part too.

-Artturi

ps. fwiw., images at invisible.ca/arm seem to be broken atm.:/

[0] https://lkml.org/lkml/2019/1/12/213

> On Fri, 25 Jan 2019, Artturi Alm wrote:
> 
> > Hi,
> > 
> > this is nothing new[0], but i tested it to be present here aswell,
> > while trying to decide whether i should go for pinebook, or not.
> > 
> > workaround for this should land in linux-next today, if not already,
> > just in case someone here does care.
> > 
> > -Artturi
> > 
> > [0] https://marc.info/?l=openbsd-bugs&m=152671143921366&w=2
> > 
> > ps. you can use this to verify it is indeed broken atm. as is,
> > and on my pine64 board this does take less than 10mins to trigger.
> > 
> > #include <stdio.h>
> > #include <stdlib.h>
> > #include <time.h>
> > 
> > void
> > ts_abort(struct timespec *ts0, struct timespec *ts1)
> > {
> > 	printf("ts0=(%lu,%lu)\nts1=(%lu,%lu)\n",
> > 	    ts0->tv_sec, ts0->tv_nsec,
> > 	    ts1->tv_sec, ts1->tv_nsec);
> > 	abort();
> > }
> > 
> > int
> > main(int argc, char *argv[])
> > {
> > 	struct timespec ts0, ts1;
> > 
> > 	clock_gettime(CLOCK_MONOTONIC, &ts0);
> > 	for(;;) {
> > 		clock_gettime(CLOCK_MONOTONIC, &ts1);
> > 
> > 		if ((ts0.tv_sec < ts1.tv_sec) ||
> > 		    ((ts0.tv_sec == ts1.tv_sec) &&
> > 		     (ts0.tv_nsec < ts1.tv_nsec))) {
> > 			ts0.tv_sec  = ts1.tv_sec;
> > 			ts0.tv_nsec = ts1.tv_nsec;
> > 		} else
> > 			ts_abort(&ts0, &ts1);
> > 	}
> > }
> > 
> > 
> > 



Home | Main Index | Thread Index | Old Index