mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: markus.stockhausen@gmx.de, tglx@linutronix.de
Cc: howels@allthatwemight.be, bjorn@mork.no, linux-kernel@vger.kernel.org
Subject: Re: AW: AW: [PATCH 1/4] clocksource/drivers/timer-rtl-otto: work around dying timers
Date: Wed, 10 Sep 2025 22:53:59 +0200	[thread overview]
Message-ID: <63ee2dae-7d9d-4838-9fcc-6a15273fc987@linaro.org> (raw)
In-Reply-To: <020f01dc227f$03e40b60$0bac2220$@gmx.de>

On 10/09/2025 20:16, markus.stockhausen@gmx.de wrote:
>> Von: Daniel Lezcano <daniel.lezcano@linaro.org>
>> Gesendet: Mittwoch, 10. September 2025 18:39
>>
>>> What I tried:
>>>
>>> 1. Read out the current (remaining) timer value: In the error cases
>>> this can give any value between 1 (=320ns) and 15 (=4800ns).
>>>
>>> 2. Check if IRQ flag is already set and IRQ might trigger next. This was
>>> never the case.
>>
>> It would have been interesting to check if we are in the time bug range
>> to wait with a delay (5us), check the IRQ flag as the current timer
>> should have expired, then set the counter and recheck the IRQ flag.
> 
> It's been 2 months that I dived deep into this case. Finding a
> reproducer, adding lightweight logging and try&error a solution
> was really hard. In the end I was happy to have a fix that was
> intensively tested.

I understand. No worries I applied the series, it is in the compilation 
batch.

> For some notes see
> https://github.com/openwrt/openwrt/pull/19468#issuecomment-3095570297
> 
>  From what I remember:
> 
> - I started on a multithreading SoC and went over to a single
> core SoC to reduce side effects during analysis.
> 
> - The timer never died when it was reprogrammed from
> an interrupt of a just finished timer. The reason was always
> a reprogramming from outside the interrupt->reprogram
> call sequence.
> 
> - Reprogramming always worked fine. A timer with <5us left, was
> restarted with a timer >5us. The new timer started to count.
> No interrupt flag seemed to be magically toggled during this
> process. There was no active IRQ notification directly after the
> reprogramming. That was how I expected it.
> 
> - But in rare cases the new timer did not trigger the subsequent
> interrupt. I was totally confused that the future interrupt of
> a newly started timer did not work.
> 
> Graphically:
> 
> - timer run ---+-------------------->|
>                 | issue stop & start
>                 | timer run ------------------>|
>                                                | no IRQ here
> 
> Conclusion was for me: If we "kill" a running timer and restart
> it and it will not fire an interrupt after the newly set time,
> then something must be somehow broken. The ending timer and
> the stop/start sequence (that consists of two register writes)
> have some interference. Whatever it might be.

Mmh, I think I misunderstood initially the problem. Thanks for clarifying.



-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

  reply	other threads:[~2025-09-10 20:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-04  8:03 [PATCH 0/4] clocksource/drivers/timer-rtl-otto: enhancements Markus Stockhausen
2025-08-04  8:03 ` [PATCH 1/4] clocksource/drivers/timer-rtl-otto: work around dying timers Markus Stockhausen
2025-09-10  9:02   ` Daniel Lezcano
2025-09-10 10:16     ` AW: " markus.stockhausen
2025-09-10 16:39       ` Daniel Lezcano
2025-09-10 18:16         ` AW: " markus.stockhausen
2025-09-10 20:53           ` Daniel Lezcano [this message]
2025-08-04  8:03 ` [PATCH 2/4] clocksource/drivers/timer-rtl-otto: drop set_counter function Markus Stockhausen
2025-08-04  8:03 ` [PATCH 3/4] clocksource/drivers/timer-rtl-otto: do not interfere with interrupts Markus Stockhausen
2025-08-04  8:03 ` [PATCH 4/4] clocksource/drivers/timer-rtl-otto: simplify documentation Markus Stockhausen
2025-09-10 20:54 ` [PATCH 0/4] clocksource/drivers/timer-rtl-otto: enhancements Daniel Lezcano
2025-09-10 21:15   ` AW: " markus.stockhausen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63ee2dae-7d9d-4838-9fcc-6a15273fc987@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=bjorn@mork.no \
    --cc=howels@allthatwemight.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.stockhausen@gmx.de \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®