mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] mailbox: zynqmp-ipi: Fix CPU hotplug state cleanup
@ 2026-11-03  6:20 Prasanna Kumar T S M
  2026-11-03  6:35 ` [PATCH 2/2] soc: xilinx: Fix event manager " Prasanna Kumar T S M
  2026-11-03 16:05 ` [PATCH 1/2] mailbox: zynqmp-ipi: Fix " kernel test robot
  0 siblings, 2 replies; 5+ messages in thread
From: Prasanna Kumar T S M @ 2026-11-03  6:20 UTC (permalink / raw)
  To: ptsm, jassisinghbrar, michal.simek, tanmay.shah, saeed.nowshadi,
	linux-kernel, linux-arm-kernel, ssengar, tgopinath, srivatsa

On driver removal, the CPUHP_AP_ONLINE_DYN CPU hotplug state is removed
instead of the its actual state. This can leave the mailbox driver
callbacks dangling. Use the actual CPU hotplug state during driver
removal.

Hotplug registration failures are also ignored, allowing probe to
succeed without the callbacks needed to enable interrupts on CPUs
brought online later.

Fixes: 6ffb1635341be ("mailbox: zynqmp: handle SGI for shared IPI")
Signed-off-by: Prasanna Kumar T S M <ptsm@linux.microsoft.com>
---
 drivers/mailbox/zynqmp-ipi-mailbox.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/mailbox/zynqmp-ipi-mailbox.c b/drivers/mailbox/zynqmp-ipi-mailbox.c
index 42d2583e44ca..b0643ee75db0 100644
--- a/drivers/mailbox/zynqmp-ipi-mailbox.c
+++ b/drivers/mailbox/zynqmp-ipi-mailbox.c
@@ -136,6 +136,7 @@ struct zynqmp_ipi_pdata {
 	unsigned int method;
 	u32 local_id;
 	int virq_sgi;
+	enum cpuhp_state hp_state;
 	int num_mboxes;
 	struct zynqmp_ipi_mbox ipi_mboxes[] __counted_by(num_mboxes);
 };
@@ -863,15 +864,22 @@ static int xlnx_mbox_init_sgi(struct platform_device *pdev,
 	irq_set_status_flags(pdata->virq_sgi, IRQ_PER_CPU);
 
 	/* Setup function for the CPU hot-plug cases */
-	cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "mailbox/sgi:starting",
-			  xlnx_mbox_cpuhp_start, xlnx_mbox_cpuhp_down);
+	pdata->hp_state = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
+			  "mailbox/sgi:starting", xlnx_mbox_cpuhp_start,
+			  xlnx_mbox_cpuhp_down);
+	if (pdata->hp_state < 0) {
+		irq_clear_status_flags(pdata->virq_sgi, IRQ_PER_CPU);
+		free_percpu_irq(pdata->virq_sgi, &per_cpu_pdata);
+		irq_dispose_mapping(pdata->virq_sgi);
+		return pdata->hp_state;
+	}
 
 	return ret;
 }
 
 static void xlnx_mbox_cleanup_sgi(struct zynqmp_ipi_pdata *pdata)
 {
-	cpuhp_remove_state(CPUHP_AP_ONLINE_DYN);
+	cpuhp_remove_state(pdata->hp_state);
 
 	on_each_cpu(xlnx_disable_percpu_irq, NULL, 1);
 
-- 
2.49.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-03 16:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03  6:20 [PATCH 1/2] mailbox: zynqmp-ipi: Fix CPU hotplug state cleanup Prasanna Kumar T S M
2026-11-03  6:35 ` [PATCH 2/2] soc: xilinx: Fix event manager " Prasanna Kumar T S M
2026-11-03 12:26   ` Jay Buddhabhatti
2026-11-03 15:18     ` Prasanna Kumar T S M
2026-11-03 16:05 ` [PATCH 1/2] mailbox: zynqmp-ipi: Fix " kernel test robot

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®