All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vítor Hugo Silva" <vitorhg20080@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH RFC 08/19] clocksource/drivers/timer-clint: Add Espressif ESP32-P4 support
Date: Thu, 26 Nov 2026 23:32:14 +0000	[thread overview]
Message-ID: <sashiko-outbox-236330@kernel.org> (raw)
In-Reply-To: <20261125233020.1380594-9-vitorhg20080@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] clocksource: timer-clint: mismatched IPI gating in
  clint_timer_starting_cpu()
--

commit ff948927794ebb2a7c5ef1defc24583fcf3b6ad3
Author: Vítor Hugo Silva <vitorhg20080@gmail.com>

clocksource/drivers/timer-clint: Add Espressif ESP32-P4 support

This commit adds CLINT timer support for the Espressif ESP32-P4, where
machine-mode timer interrupts are routed through the CLIC.

> diff --git a/drivers/clocksource/timer-clint.c b/drivers/clocksource/timer-clint.c
> index e56eee7e3781d..bf5bae077d7ab 100644
> --- a/drivers/clocksource/timer-clint.c
> +++ b/drivers/clocksource/timer-clint.c

[ ... ]

> @@ -130,13 +157,22 @@ static int clint_timer_starting_cpu(unsigned int cpu)
>  {
>  	struct clock_event_device *ce = per_cpu_ptr(&clint_clock_event, cpu);
>  
> +	if (clint_uses_clic) {
> +		ce->set_next_event = esp32p4_clint_next_event;
> +		ce->set_state_shutdown = esp32p4_clint_shutdown;
> +		ce->set_state_oneshot_stopped = esp32p4_clint_shutdown;
> +		esp32p4_clint_shutdown(ce);
> +	}
> +
>  	ce->cpumask = cpumask_of(cpu);
>  	clockevents_config_and_register(ce, clint_timer_freq, 100, ULONG_MAX);
>  
>  	enable_percpu_irq(clint_timer_irq,
>  			  irq_get_trigger_type(clint_timer_irq));
> -	enable_percpu_irq(clint_ipi_irq,
> -			  irq_get_trigger_type(clint_ipi_irq));
> +	if (!clint_uses_clic)
> +		enable_percpu_irq(clint_ipi_irq,
> +				  irq_get_trigger_type(clint_ipi_irq));
> +
>  	return 0;
>  }

[Severity: Medium]
Should enable_percpu_irq(clint_ipi_irq, ...) be gated on CONFIG_SMP
instead of !clint_uses_clic, or should the IPI setup in
clint_timer_init_dt() also be skipped when clint_uses_clic is set?

clint_timer_init_dt() still requires and maps clint_ipi_irq for
"esp,esp32p4-clint", and its IPI mux and handler setup is guarded only by
CONFIG_SMP:

drivers/clocksource/timer-clint.c:clint_timer_init_dt() {
	...
#ifdef CONFIG_SMP
	rc = ipi_mux_create(IPI_MAX, clint_send_ipi);
	if (rc <= 0) {
		pr_err("unable to create muxed IPIs\n");
		rc = (rc < 0) ? rc : -ENODEV;
		goto fail_free_irq;
	}

	irq_set_chained_handler(clint_ipi_irq, clint_ipi_interrupt);
	riscv_ipi_set_virq_range(rc, IPI_MAX);
	clint_clear_ipi();
#endif
	...
}

When CONFIG_SMP is enabled with clint_uses_clic, clint_timer_init_dt()
registers the IPI mux and chained handler on clint_ipi_irq while
clint_timer_starting_cpu() leaves the per-CPU IPI IRQ disabled.  In
Addition, the commit message does not explain why IPI enablement is
changed here.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125233020.1380594-1-vitorhg20080@gmail.com?part=8

  reply	other threads:[~2026-11-26 23:32 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 23:30 [PATCH RFC 00/19] riscv: Add initial support for Espressif ESP32-P4 Vítor Hugo Silva
2026-11-25 23:30 ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 01/19] riscv: Prepare ESP32-P4 early CLIC trap vectors Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 02/19] riscv: Handle ESP32-P4 CLIC trap context Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 03/19] dt-bindings: interrupt-controller: Add Espressif ESP32-P4 CLIC Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 04/19] irqchip: Add Espressif ESP32-P4 CLIC support Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 05/19] dt-bindings: interrupt-controller: Add Espressif ESP32-P4 interrupt matrix Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 06/19] irqchip: Add Espressif ESP32-P4 interrupt matrix support Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 07/19] dt-bindings: timer: Add Espressif ESP32-P4 CLINT Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 08/19] clocksource/drivers/timer-clint: Add Espressif ESP32-P4 support Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-26 23:32   ` sashiko-bot [this message]
2026-11-27 16:18   ` [PATCH RFC v2] " Vítor Hugo Silva
2026-11-27 16:18     ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 09/19] dt-bindings: serial: Add Espressif ESP32-P4 UART Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 10/19] serial: esp32: Restore the ESP32 UART driver Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-26 23:32   ` sashiko-bot
2026-11-27 16:55   ` [PATCH RFC 1/4] serial: esp32: Validate the baud rate before programming the UART Vítor Hugo Silva
2026-11-27 16:55     ` Vítor Hugo Silva
2026-11-27 16:55     ` [PATCH RFC 2/4] serial: esp32: Fix ESP32-S3 baud rate prescaler calculation Vítor Hugo Silva
2026-11-27 16:55       ` Vítor Hugo Silva
2026-11-27 16:55     ` [PATCH RFC 3/4] serial: esp32: Deliver and mask receive break interrupts Vítor Hugo Silva
2026-11-27 16:55       ` Vítor Hugo Silva
2026-11-27 16:55     ` [PATCH RFC 4/4] serial: esp32: Enable the UART clock during port registration Vítor Hugo Silva
2026-11-27 16:55       ` Vítor Hugo Silva
2026-11-27 19:25   ` [PATCH RFC 1/2] serial: esp32: Enable hardware RTS/CTS flow control Vítor Hugo Silva
2026-11-27 19:25     ` Vítor Hugo Silva
2026-11-27 19:25     ` [PATCH RFC 2/2] serial: esp32: Report active-low CTS correctly on ESP32-S3 and ESP32-P4 Vítor Hugo Silva
2026-11-27 19:25       ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 11/19] serial: esp32: Add support for the ESP32-P4 UART Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-26 23:32   ` sashiko-bot
2026-11-27 19:39   ` [PATCH RFC v2] " Vítor Hugo Silva
2026-11-27 19:39     ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 12/19] serial: esp32: Rearm TX interrupts when the FIFO is full Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-26 23:32   ` sashiko-bot
2026-11-27 15:40     ` Vítor Hugo Silva
2026-11-27 15:56   ` [PATCH RFC v2] " Vítor Hugo Silva
2026-11-27 15:56     ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 13/19] serial: esp32: Add early console support for ESP32-P4 Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 14/19] riscv: Synchronize instructions written to ESP32-P4 PSRAM Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-26 23:32   ` sashiko-bot
2026-11-27 22:13   ` [PATCH RFC v2] " Vítor Hugo Silva
2026-11-27 22:13     ` Vítor Hugo Silva
2026-11-28 22:16     ` sashiko-bot
2026-11-30 10:31       ` Vítor Hugo Silva
2026-11-30 12:23     ` [PATCH RFC v3] " Vítor Hugo Silva
2026-11-30 12:23       ` Vítor Hugo Silva
2026-12-01 12:24       ` sashiko-bot
2026-11-25 23:30 ` [PATCH RFC 15/19] riscv: Align init data to the ESP32-P4 PMP granularity Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 16/19] dt-bindings: riscv: Add Waveshare ESP32-P4-Module-DEV-KIT Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 17/19] dt-bindings: riscv: cpus: Document Espressif ESP32-P4 HP harts Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 18/19] riscv: dts: Add Waveshare ESP32-P4-Module-DEV-KIT Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-25 23:30 ` [PATCH RFC 19/19] MAINTAINERS: Add the Espressif ESP32-P4 platform Vítor Hugo Silva
2026-11-25 23:30   ` Vítor Hugo Silva
2026-11-26 23:32 ` [PATCH RFC 00/19] riscv: Add initial support for Espressif ESP32-P4 sashiko-bot

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=sashiko-outbox-236330@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vitorhg20080@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.