Re: [RFC PATCH v2 09/14] m68k: hp300: Remove hp300_gettimeoffset()

2018-11-24 Thread Finn Thain
On Sun, 25 Nov 2018, Michael Schmitz wrote: > > We can benchmark gettimeofday syscalls on elgar but is that hardware > > representative of other relevant models? > > I suppose the CIA is on the main board, so running with the slower clock > speed that you'd see with a vanilla Amiga without 060

Re: [RFC PATCH v2 09/14] m68k: hp300: Remove hp300_gettimeoffset()

2018-11-24 Thread Michael Schmitz
Hi Finn, Am 25.11.2018 um 14:15 schrieb Finn Thain: Maybe the timer interrupt has a sufficiently high priority and latency is low? Maybe cia_set_irq() is really expensive? I don't know the platform well enough so I'm inclined to revert. We can benchmark gettimeofday syscalls on elgar but is tha

Re: [RFC PATCH v2 09/14] m68k: hp300: Remove hp300_gettimeoffset()

2018-11-24 Thread Finn Thain
On Wed, 21 Nov 2018, I wrote: > On Wed, 21 Nov 2018, Geert Uytterhoeven wrote: > > > > This suggests that either 0 or N (the latched value) would result > > > from a read from the counter immediately following an interrupt. Who > > > can say which? Just have to try it. The answer should allow u

Re: [RFC PATCH v2 09/14] m68k: hp300: Remove hp300_gettimeoffset()

2018-11-21 Thread Finn Thain
On Wed, 21 Nov 2018, Geert Uytterhoeven wrote: > > This suggests that either 0 or N (the latched value) would result from > > a read from the counter immediately following an interrupt. Who can > > say which? Just have to try it. The answer should allow us to avoid > > the risk of a clocksource

Re: [RFC PATCH v2 09/14] m68k: hp300: Remove hp300_gettimeoffset()

2018-11-21 Thread Geert Uytterhoeven
Hi Finn, On Wed, Nov 21, 2018 at 10:47 AM Finn Thain wrote: > On Wed, 21 Nov 2018, Geert Uytterhoeven wrote: > > The 8520 CIA is almost identical to the 6526 CIA, as used in the C64... > > The 6526 CIA datasheet says, "In continuous mode, the timer will count > from the latched value to zero, gen

Re: [RFC PATCH v2 09/14] m68k: hp300: Remove hp300_gettimeoffset()

2018-11-21 Thread Finn Thain
On Wed, 21 Nov 2018, Geert Uytterhoeven wrote: > The 8520 CIA is almost identical to the 6526 CIA, as used in the C64... > The 6526 CIA datasheet says, "In continuous mode, the timer will count from the latched value to zero, generate and interrupt, reload the latched value and repeat the proc

Re: [RFC PATCH v2 09/14] m68k: hp300: Remove hp300_gettimeoffset()

2018-11-21 Thread Geert Uytterhoeven
Hi Finn, On Wed, Nov 21, 2018 at 9:41 AM Finn Thain wrote: > On Wed, 21 Nov 2018, Geert Uytterhoeven wrote: > > On Wed, Nov 21, 2018 at 12:13 AM Finn Thain > > wrote: > > > On atari, the 68901 counts down to 0x01 and raises an interrupt. On > > > mac, the 6522 counts down to 0x then raises

Re: [RFC PATCH v2 09/14] m68k: hp300: Remove hp300_gettimeoffset()

2018-11-21 Thread Finn Thain
On Wed, 21 Nov 2018, Geert Uytterhoeven wrote: > Hi Finn, > > On Wed, Nov 21, 2018 at 12:13 AM Finn Thain > wrote: > > On atari, the 68901 counts down to 0x01 and raises an interrupt. On > > mac, the 6522 counts down to 0x then raises an interrupt. No idea > > about amiga (Geert?) -- this

Re: [RFC PATCH v2 09/14] m68k: hp300: Remove hp300_gettimeoffset()

2018-11-21 Thread Kars de Jong
Op wo 21 nov. 2018 om 00:13 schreef Finn Thain : > > On Tue, 20 Nov 2018, Kars de Jong wrote: > > > Op ma 19 nov. 2018 om 02:10 schreef Finn Thain : > > > > > > hp300_gettimeoffset() never checks the timer interrupt flag and will > > > fail to notice when the timer counter gets reloaded. That means

Re: [RFC PATCH v2 09/14] m68k: hp300: Remove hp300_gettimeoffset()

2018-11-21 Thread Geert Uytterhoeven
Hi Finn, On Wed, Nov 21, 2018 at 12:13 AM Finn Thain wrote: > On atari, the 68901 counts down to 0x01 and raises an interrupt. On mac, > the 6522 counts down to 0x then raises an interrupt. No idea about > amiga (Geert?) -- this has to be handled correctly to get a monotonic > clocksource. I'

Re: [RFC PATCH v2 09/14] m68k: hp300: Remove hp300_gettimeoffset()

2018-11-20 Thread Finn Thain
On Tue, 20 Nov 2018, Kars de Jong wrote: > Op ma 19 nov. 2018 om 02:10 schreef Finn Thain : > > > > hp300_gettimeoffset() never checks the timer interrupt flag and will > > fail to notice when the timer counter gets reloaded. That means the > > clock could jump backwards. > > > > Remove this code

Re: [RFC PATCH v2 09/14] m68k: hp300: Remove hp300_gettimeoffset()

2018-11-20 Thread Kars de Jong
Op ma 19 nov. 2018 om 02:10 schreef Finn Thain : > > hp300_gettimeoffset() never checks the timer interrupt flag and will > fail to notice when the timer counter gets reloaded. That means the > clock could jump backwards. > > Remove this code and leave this platform on the 'jiffies' clocksource. >