Linux LED subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Srivatsa S. Bhat (Microsoft)" <srivatsa@csail.mit.edu>
Cc: linux-leds@vger.kernel.org, linux-perf-users@vger.kernel.org,
	linux-s390@vger.kernel.org, lee@kernel.org,
	wsa+renesas@sang-engineering.com,
	"Heiko Carstens" <hca@linux.ibm.com>,
	"Vasily Gorbik" <gor@linux.ibm.com>,
	"Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>
Subject: Re: [PATCH 08/14] irqchip/riscv-aplic, hotplug: Update name & callbacks to match their hotplug states
Date: Thu, 03 Dec 2026 19:41:41 +0000	[thread overview]
Message-ID: <sashiko-outbox-248534@kernel.org> (raw)
In-Reply-To: <20261204-fix-cpuhp-state-names-v1-8-32e62361ce1d@csail.mit.edu>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] irqchip/riscv-aplic: wrong-direction fix retains
  CPUHP_AP_ONLINE_DYN
--

commit 84983784b738af0974edc8b4024cb97a57bc84bd
Author: Srivatsa S. Bhat (Microsoft) <srivatsa@csail.mit.edu>

irqchip/riscv-aplic, hotplug: Update name & callbacks to match their hotplug states

This commit renames the RISC-V APLIC direct-mode CPU hotplug state and
callbacks to match their current registration at CPUHP_AP_ONLINE_DYN.

> diff --git a/drivers/irqchip/irq-riscv-aplic-direct.c b/drivers/irqchip/irq-riscv-aplic-direct.c
> index bfd11a8843164..2b58db452824e 100644
> --- a/drivers/irqchip/irq-riscv-aplic-direct.c
> +++ b/drivers/irqchip/irq-riscv-aplic-direct.c
> @@ -181,7 +181,7 @@ void aplic_direct_restore_states(struct aplic_priv *priv)
>  		aplic_idc_set_delivery(per_cpu_ptr(&aplic_idcs, cpu), true);
>  }
>  
> -static int aplic_direct_dying_cpu(unsigned int cpu)
> +static int aplic_direct_cpu_offline(unsigned int cpu)
>  {
>  	if (aplic_direct_parent_irq)
>  		disable_percpu_irq(aplic_direct_parent_irq);
> @@ -189,7 +189,7 @@ static int aplic_direct_dying_cpu(unsigned int cpu)
>  	return 0;
>  }
>  
> -static int aplic_direct_starting_cpu(unsigned int cpu)
> +static int aplic_direct_cpu_online(unsigned int cpu)
>  {
>  	if (aplic_direct_parent_irq) {
>  		enable_percpu_irq(aplic_direct_parent_irq,
> @@ -314,9 +314,9 @@ int aplic_direct_setup(struct device *dev, void __iomem *regs)
>  			 * interrupt on all CPUs
>  			 */
>  			cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
> -					  "irqchip/riscv/aplic:starting",
> -					  aplic_direct_starting_cpu,
> -					  aplic_direct_dying_cpu);
> +					  "irqchip/riscv/aplic:online",
> +					  aplic_direct_cpu_online,
> +					  aplic_direct_cpu_offline);
>  		}
>  	}

[Severity: High]
Should the state/name mismatch from 2333df5ae51e ("irqchip: Add RISC-V
advanced PLIC driver for direct-mode") be fixed by moving registration to
a static starting state instead of keeping CPUHP_AP_ONLINE_DYN?

On CPU offline, aplic_direct_cpu_offline() masks RV_IRQ_EXT at
CPUHP_AP_ONLINE_DYN while wired APLIC interrupts still target the CPU.
Migration only runs later at CPUHP_TEARDOWN_CPU (__cpu_disable() ->
irq_migrate_all_off_this_cpu()), risking I/O stalls or hotplug deadlocks.

Symmetrically, on CPU online, smp_callin() marks the CPU online and
CPUHP_AP_IRQ_AFFINITY_ONLINE can route APLIC interrupts to it before
aplic_direct_cpu_online() unmasks RV_IRQ_EXT at CPUHP_AP_ONLINE_DYN.

Adding a static CPUHP_AP_IRQ_RISCV_APLIC_STARTING state (as in
irq-sifive-plic.c, irq-riscv-imsic-early.c, and irq-aclint-sswi.c) would
fix the ordering and avoid consuming a CPUHP_AP_ONLINE_DYN slot whose
return value is ignored.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-fix-cpuhp-state-names-v1-0-32e62361ce1d@csail.mit.edu?part=8

  reply	other threads:[~2026-12-03 19:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 19:16 [PATCH 00/14] treewide, cpu/hotplug: Align state and callback names with their sections Srivatsa S. Bhat (Microsoft)
2026-12-03 19:16 ` [PATCH 01/14] mailbox/zynqmp, cpu/hotplug: Update name & callbacks to match their hotplug states Srivatsa S. Bhat (Microsoft)
2026-12-03 19:16 ` [PATCH 02/14] soc/xilinx, " Srivatsa S. Bhat (Microsoft)
2026-12-03 19:16 ` [PATCH 03/14] riscv, " Srivatsa S. Bhat (Microsoft)
2026-12-03 19:27   ` sashiko-bot
2026-12-03 19:16 ` [PATCH 04/14] clocksource/drivers, hotplug: " Srivatsa S. Bhat (Microsoft)
2026-12-03 19:40   ` sashiko-bot
2026-12-03 19:16 ` [PATCH 05/14] cpuidle, cpu/hotplug: " Srivatsa S. Bhat (Microsoft)
2026-12-03 19:16 ` [PATCH 06/14] firmware/arm_ffa, cpu/hotplug: Update name to match the hotplug state Srivatsa S. Bhat (Microsoft)
2026-12-03 19:16 ` [PATCH 07/14] coresight, cpu/hotplug: Update name & callbacks to match their hotplug states Srivatsa S. Bhat (Microsoft)
2026-12-03 19:16 ` [PATCH 08/14] irqchip/riscv-aplic, hotplug: " Srivatsa S. Bhat (Microsoft)
2026-12-03 19:41   ` sashiko-bot [this message]
2026-12-03 19:16 ` [PATCH 09/14] leds/trigger/cpu, " Srivatsa S. Bhat (Microsoft)
2026-12-03 19:39   ` sashiko-bot
2026-12-03 19:16 ` [PATCH 10/14] powercap/dtpm_cpu, hotplug: Update name & callback to match the hotplug state Srivatsa S. Bhat (Microsoft)
2026-12-03 19:16 ` [PATCH 11/14] optee, cpu/hotplug: Update name to match the CPU " Srivatsa S. Bhat (Microsoft)
2026-12-03 19:16 ` [PATCH 12/14] debugobjects, cpu/hotplug: Update name & callback to match the " Srivatsa S. Bhat (Microsoft)
2026-12-03 19:16 ` [PATCH 13/14] csky, cpu/hotplug: Update name & callbacks to match their " Srivatsa S. Bhat (Microsoft)
2026-12-03 19:16 ` [PATCH 14/14] cpuidle/s390, cpu/hotplug: Update teardown callback to match its " Srivatsa S. Bhat (Microsoft)
2026-12-03 19:52 ` [PATCH 00/14] treewide, cpu/hotplug: Align state and callback names with their sections 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-248534@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=srivatsa@csail.mit.edu \
    --cc=wsa+renesas@sang-engineering.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox