From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=13.77.154.182 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796360695; b=xMaVT8IPgH1U6f9QukwGXWsIURF82RYNB2QNvvVmIM73fmrA8rlb327cvWAH+iVLI0i6 jFq/2PBBgGaQ5vczFEvUsTyKjea9d5oDDJDivALcAkhLsiGSoH9xXtGknaKnYrFt5eXpo CpuVRo2yro9GPXNbqK+E2fXYGL3BgrUetlWNR6bkpowchDUJOPiK4ssgYkaXRJ0UJLHnt Xh/qrsInXNMKUelOZaSrgY4/225gvHXWT+fTaMDwJIvANrTJaKvKIGe83tuIgA2pWY8bV ol3EJmC66azFMVroE1Q7EhW83qS9h+nlSlYd4IMaTY5FWLKQ2nLkmVt+fbpHKkGA5nQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796360695; h=DMARC-Filter:Received:DKIM-Filter:DKIM-Signature:From:To:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Spam-Status:X-Spam-Checker-Version; bh=7wCFcrp0MwNx7mVI1x8Zl+L8YDTD/D89TAMpD3f3W6I=; b=1CwbO6YOaTSsKQ7nwMBfgqtJDTW6VBkZFBDFFXdmGj1LDjGqu+WJNSbDAjX7eBokhfBo Je/EmH6q5xp+nBYGsBKty5FSnpPThlM5YqtzjACmpBTN9gQoS5YjzLkAFDNJirwIns2tU MbrJMHonBduuZq57WqxntViqn5LZpqex+qHxkG2p0vNoFrpfsIbkBCwe9+gT/LErm7GxT bH39906QGyX+jt5BxY4LZ//Cow0j4e7zsOWbvu921H6W+WBwXelKQws/3aGstioOLj31P TeIEEJ2BXJLL0qCvJJub6jm4sha6Xxa4VupVfggZjxvIwFBcxSVl/6NaWrMNXhINVBQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=DH5BDBGQ; arc=none smtp.remote-ip=13.77.154.182 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0BA21606A339 for ; Fri, 4 Dec 2026 05:04:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0BA21606A339 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=DH5BDBGQ Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 415C420B7168; Thu, 3 Dec 2026 21:04:54 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 415C420B7168 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1796360694; bh=7wCFcrp0MwNx7mVI1x8Zl+L8YDTD/D89TAMpD3f3W6I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DH5BDBGQgJGDn114nTVXWOYob6wk5lW2rfer5NMunnK7TRu+i1lE3tDkSwfG6O/ch UiQwtUfQKvgDJa+ytMWFQQM1V00CgHTb9uAbKa63dW3au6VHMccRDc8SkwMEdw/dJA Vj7lpbt9RugSkJ62zDqYqVd50WDqjFgutWQIP2sY= From: Prasanna Kumar T S M To: ptsm@linux.microsoft.com, jassisinghbrar@gmail.com, michal.simek@amd.com, tanmay.shah@amd.com, saeed.nowshadi@amd.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ssengar@linux.microsoft.com, tgopinath@linux.microsoft.com, srivatsa@csail.mit.edu, jay.buddhabhatti@amd.com, gregkh@linuxfoundation.org, radheys@amd.com Subject: [PATCH v3 1/5] mailbox: zynqmp-ipi: Fix CPU hotplug state cleanup Date: Thu, 3 Dec 2026 21:04:49 -0800 Message-ID: <20261204050453.18005-2-ptsm@linux.microsoft.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20261204050453.18005-1-ptsm@linux.microsoft.com> References: <20261204050453.18005-1-ptsm@linux.microsoft.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On driver removal, the CPUHP_AP_ONLINE_DYN CPU hotplug state is removed instead of 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: 6ffb1635341b ("mailbox: zynqmp: handle SGI for shared IPI") Cc: stable@vger.kernel.org Signed-off-by: Prasanna Kumar T S M --- drivers/mailbox/zynqmp-ipi-mailbox.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/zynqmp-ipi-mailbox.c b/drivers/mailbox/zynqmp-ipi-mailbox.c index 42d2583e44ca..179f361d04b3 100644 --- a/drivers/mailbox/zynqmp-ipi-mailbox.c +++ b/drivers/mailbox/zynqmp-ipi-mailbox.c @@ -126,6 +126,7 @@ struct zynqmp_ipi_mbox { * @method: IPI SMC or HVC is going to be used * @local_id: local IPI agent ID * @virq_sgi: IRQ number mapped to SGI + * @hp_state: CPU hotplug state for SGI callbacks * @num_mboxes: number of mailboxes of this IPI agent * @ipi_mboxes: IPI mailboxes of this IPI agent */ @@ -136,6 +137,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 +865,20 @@ 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) + return pdata->hp_state; - return ret; + return 0; } static void xlnx_mbox_cleanup_sgi(struct zynqmp_ipi_pdata *pdata) { - cpuhp_remove_state(CPUHP_AP_ONLINE_DYN); + if (pdata->hp_state >= CPUHP_AP_ONLINE_DYN) + cpuhp_remove_state(pdata->hp_state); on_each_cpu(xlnx_disable_percpu_irq, NULL, 1); -- 2.49.0