Linux-MIPS Archive mirror
 help / color / mirror / Atom feed
From: kpursoty@proton.me
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Cc: "linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
	"tsbogend@alpha.franken.de" <tsbogend@alpha.franken.de>,
	"cjd@cjdns.fr" <cjd@cjdns.fr>,
	"naseefkm@gmail.com" <naseefkm@gmail.com>
Subject: Re: [PATCH v3 2/2] clocksource: timer-econet-en751221: fix IRQ ack storm on interrupt handler
Date: Thu, 16 Apr 2026 07:19:50 +0000	[thread overview]
Message-ID: <Ws8LqFgc1zMofsKAK9_Zn_EHeLpLjhdGqjHj7v4tshaQmNA9vlhdjWS5gQ-MbC0VNVYAwrlIbYhWPDoTt7_7jayaL3GOOYCahsMp4mdI94c=@proton.me> (raw)
In-Reply-To: <bshyYDAvwv9SWN7CjLfkE_DUQGLMssyTLFOlDYgGNi-nZGbqFC8sMbm8fP3I2q3Zwxb_5FFlCKqbt0kvs7x8Q3DqjDI675GUFYQF08-CoeQ=@proton.me>

Thanks for your notes. Patch withdrawn.

On Wednesday, 15 April 2026 at 08:53, kpursoty@proton.me <kpursoty@proton.me> wrote:

> The interrupt handler acked by writing the current count back to compare:
>
>   iowrite32(ioread32(reg_count(cpu)), reg_compare(cpu));
>
> Since the interrupt fires when count >= compare, and the counter advances
> past the written value before the MMIO write reaches the peripheral, the
> condition re-asserts on the same bus cycle. This causes a tight IRQ storm
> on CPU0, stalling boot at T=62s (measured: boot never progresses past
> clockevents registration).
>
> The EcoNet GPL kernel (arch/mips/econet/time2.c, cputmr_timer_ack()) acks
> by writing the *next* deadline, which puts count < compare and clears the
> pending condition. Write U32_MAX (unreachable before set_next_event()
> programs the real deadline), consistent with cevt_dev_init() which also
> writes U32_MAX to park the compare register at init.
>
> Fixes: 3b4c33ac87d0 ("clocksource/drivers: Add EcoNet Timer HPT driver")
> Signed-off-by: Kervin Pursoty <kpursoty@proton.me>
> Tested-by: Caleb James DeLisle <cjd@cjdns.fr>
> ---
> v3: Add Tested-by from Caleb James DeLisle (tested on EN755221 hardware).
>     No code changes since v2.
>
>  drivers/clocksource/timer-econet-en751221.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/timer-econet-en751221.c b/drivers/clocksource/timer-econet-en751221.c
> --- a/drivers/clocksource/timer-econet-en751221.c
> +++ b/drivers/clocksource/timer-econet-en751221.c
> @@ -68,6 +68,10 @@ static irqreturn_t cevt_interrupt(int irq, void *dev_id)
>  	if (!cevt_is_pending(cpu))
>  		return IRQ_NONE;
>
> -	iowrite32(ioread32(reg_count(cpu)), reg_compare(cpu));
> +	/*
> +	 * Ack: write a future value so count < compare, clearing the pending
> +	 * condition. set_next_event() will program the real deadline.
> +	 */
> +	iowrite32(U32_MAX, reg_compare(cpu));
>  	dev->event_handler(dev);
>  	return IRQ_HANDLED;
>  }
>

      reply	other threads:[~2026-04-16  7:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15  7:53 [PATCH v3 2/2] clocksource: timer-econet-en751221: fix IRQ ack storm on interrupt handler kpursoty
2026-04-16  7:19 ` kpursoty [this message]

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='Ws8LqFgc1zMofsKAK9_Zn_EHeLpLjhdGqjHj7v4tshaQmNA9vlhdjWS5gQ-MbC0VNVYAwrlIbYhWPDoTt7_7jayaL3GOOYCahsMp4mdI94c=@proton.me' \
    --to=kpursoty@proton.me \
    --cc=cjd@cjdns.fr \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=naseefkm@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=tsbogend@alpha.franken.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).