[PATCH RFC v2 06/13] clocksource/drivers/timer-at550: add SiRF AT550 counter and match timer

Linus Walleij linusw at kernel.org
Mon Nov 30 13:45:47 PST 2026


Hi Yuugo,

thanks for your patch!

On Sat, Nov 21, 2026 at 1:43 PM Yuugo Yoneda via B4 Relay
<devnull+yogo.0917.sabu.gmail.com at kernel.org> wrote:

> +static int at550_next_event(unsigned long delta,
> +                           struct clock_event_device *event)
> +{
> +       u32 target;
> +
> +       writel(0, at550_timer + AT550_ENABLE);
> +       target = readl(at550_timer) + delta;
> +       writel(target, at550_timer + AT550_MATCH0);
> +       writel(1, at550_timer + AT550_STATUS);
> +       writel(1, at550_timer + AT550_ENABLE);
> +       if ((s32)(target - readl(at550_timer)) <= 0) {

When would this happen? If this ever happens then
minimum time should be bumped.

I think this is overzealous. Do other drivers do this?

> +static irqreturn_t at550_timer_interrupt(int irq, void *data)
> +{
> +       struct clock_event_device *event = data;
> +
> +       if (!(readl(at550_timer + AT550_STATUS) & 1))

Define bits in the header such as:

#include <linus/bits.h>

#define AT550_STATUS_IRQ_RAISED BIT(0)

if (!(readl(at550_timer + AT550_STATUS) & IRQ_RAISED))
...

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list