From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DDACB606A32D for ; Fri, 4 Dec 2026 05:06:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=VNUi/py3; 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=7wCFcrp0MwNx7mVI1x8Zl+L8YDTD/D89TAMpD3f3W6I=; b=VNUi/py3hBi997 bxH28ahjOtE7MO0KB1qObfkc0ypUGPW0L6gCz8aGIK8U/i/Ym7+lbQ0m/N7cMSFLzhmG1/usgm8tT fanV1KE1ZEWjkPxQFR0NNB078kRCojhCyFEI+ozeuWl1B+qfWg6L2FgASq6yfpWds1x1B1Q6brxux cST2CDfHSlch7oJJN2vtoF2jykwK6jtob5SuyCv9v7urHh3c9HwEAaN5E4Hoedst1BoD2HcW8fTRT 8e7fjjfY1WuWpJabvF/fef/5fOlZTjq7Xt/cuaUt+SZwGlY1WUW8mX1a45ay7AyGppt0ICFlF+aNK AdPxztq6CeksrWQhLmLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZLUI-0000000GgC1-30K0; Fri, 04 Dec 2026 05:05:38 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZLTi-0000000Gg5b-2Vvq for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2026 05:05:35 +0000 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-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261203_210507_915790_7246637F X-CRM114-Status: GOOD ( 12.64 ) X-Spam-Score: -4.4 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" 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