[Letux-kernel] Timers (was Re: [PATCH 00/20] A bunch of JZ4730 fixups for letux-kernel)
paul at boddie.org.uk
Tue Jan 19 19:25:07 CET 2021
On Tuesday, 19 January 2021 17:14:08 CET H. Nikolaus Schaller wrote:
> > Am 18.01.2021 um 01:03 schrieb Paul Boddie <paul at boddie.org.uk>:
> > I was just reviewing the timer-related code, and I can only suggest the
> > improvements covered by the patch included here, with the casting to
> > 16-bit values removed, and with an adjustment setting the counter upon
> > reload appropriately remembering that the OST counts down, not up, unlike
> > the TCU on the JZ4740.
> Ah, sorry. I didn't understand that you essentially had the same finding as
> I had...
> So you deserve appreciation of the first to have found the key issue (which
> is setting both registers to "next").
> Expanding to 32 bit turned out to be not necessary.
Is the setting in ingenic_tcu_cevt_set_next really the issue after all? I
thought that this would only be called once and that any erroneous setting of
TCNT would cause a single but inconsequential discrepancy. If it is called
many times, however, not setting the correct value would be rather disruptive.
Still, it is good that you reached a similar conclusion, even if it was mostly
speculative on my part, not having looked into the mechanisms more deeply this
time round. I also think it was very helpful of Lubomir to have modified the
ingenic-timer.c file to subtract TCNT from TRDR to get a counter value
appropriate for the timer. (Here, I'm assuming it was Lubomir and not
something I did a while ago and forgot about!)
More information about the Letux-kernel