Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Caleb James DeLisle" <cjd@cjdns.fr>
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v2 2/5] clocksource/timer-econet-en751221: Move generic logic out of cevt_init
Date: Thu, 14 May 2026 12:05:59 +0000	[thread overview]
Message-ID: <20260514120600.0492CC2BCB3@smtp.kernel.org> (raw)
In-Reply-To: <20260514000601.3430262-3-cjd@cjdns.fr>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] The return value of `cpuhp_setup_state()` is ignored, masking critical initialization failures.
- [High] The hardware clock is retrieved but never enabled before accessing memory-mapped registers.
- [High] Missing teardown callback for CPU hotplug leaves per-CPU IRQs enabled and the timer running when CPUs go offline.
--

commit c97af74688377fb3c996bd3eeeee07ce5a52eb15
Author: Caleb James DeLisle <cjd@cjdns.fr>

clocksource/timer-econet-en751221: Move generic logic out of cevt_init

This commit simplifies cevt_init by moving common generic logic out
into a new cevt_setup_clockevent function. This change prepares the driver
to support either a percpu IRQ or multiple IRQ numbers.

> 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

[ ... ]

> @@ -203,6 +206,10 @@ static int __init timer_init(struct device_node *np)
>  	if (ret < 0)
>  		return ret;
>  

This isn't a regression introduced by this patch, but does the hardware clock
retrieved via of_clk_get() earlier in timer_init() need to be enabled with
clk_prepare_enable() before memory-mapped registers are accessed?

> +	cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
> +			  "clockevents/econet/timer:starting",
> +			  cevt_init_cpu, NULL);
> +

Since cpuhp_setup_state() can fail and return a negative error code, should
the return value be checked here?

Also, because there is no teardown callback provided, does this leave per-CPU
IRQs enabled and the timer running when a CPU goes offline?

>  	sched_clock_register(sched_clock_read, ECONET_BITS,
>  			     econet_timer.freq_hz);
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260514000601.3430262-1-cjd@cjdns.fr?part=2

  reply	other threads:[~2026-05-14 12:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14  0:05 [PATCH v2 0/5] clocksource/timer-econet-en751221: Support irq number per timer Caleb James DeLisle
2026-05-14  0:05 ` [PATCH v2 1/5] dt-bindings: timer: econet: Update EN751627 for multi-IRQ Caleb James DeLisle
2026-05-14 11:42   ` sashiko-bot
2026-05-14 15:22     ` Caleb James DeLisle
2026-05-14 18:22       ` Conor Dooley
2026-05-14  0:05 ` [PATCH v2 2/5] clocksource/timer-econet-en751221: Move generic logic out of cevt_init Caleb James DeLisle
2026-05-14 12:05   ` sashiko-bot [this message]
2026-05-14 15:57     ` Caleb James DeLisle
2026-05-14  0:05 ` [PATCH v2 3/5] clocksource/timer-econet-en751221: Always map all membase blocks Caleb James DeLisle
2026-05-14 12:30   ` sashiko-bot
2026-05-14 16:52     ` Caleb James DeLisle
2026-05-14  0:06 ` [PATCH v2 4/5] clocksource/timer-econet-en751221: Unmap io mem on probe error Caleb James DeLisle
2026-05-14 12:56   ` sashiko-bot
2026-05-14 16:56     ` Caleb James DeLisle
2026-05-14  0:06 ` [PATCH v2 5/5] clocksource/timer-econet-en751221: Support irq number per timer Caleb James DeLisle
2026-05-14 16:18   ` sashiko-bot
2026-05-14 20:32     ` Caleb James DeLisle

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=20260514120600.0492CC2BCB3@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=cjd@cjdns.fr \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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