Re: [PATCH v7 0/7] clocksource: rework Atmel TCB timer driver

From: Alexandre Belloni
Date: Tue Sep 25 2018 - 16:15:11 EST

On 22/09/2018 13:29:48+0200, Daniel Lezcano wrote:
> On 13/09/2018 13:30, Alexandre Belloni wrote:
> > Hi,
> >
> > This series reworks the Atmel TCB drivers. It introduces a new driver to handle
> > the clocksource and clockevent devices.
> >
> > This is necessary because:
> > - the current tcb_clksrc driver is probed too late to be able to be used at
> > boot and we now have SoCs that don't have a PIT. They currently are not able
> > to boot a mainline kernel.
> > - using the PIT doesn't work well with preempt-rt because its interrupt is
> > shared (in particular with the UART and their interrupt flags are
> > incompatible)
> You say for rt the PIT is not suitable because of the shared irq but in
> the driver, the interrupt is flagged as shared.

Well, it is not simply sharing the interrupt that is an issue, it is the
mismatch between the PIT and the UART interrupt flags and that only
happens when using preempt-rt.

But still, the TCB is flagged as shared because it may be shared between
multiple TCB channels (it is the case for the more recent SoCs).
However, what happens is that the DBGU UART is always enabled on the
boards so when using the PIT, the interrupt is always shared. But, for
the TCB, the only driver currently able to use the interrupt is the
clockevent driver so the interrupt as almost no chance to actually be

Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering