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=1796360697; b=UY2600qx0cuh6H3xqZ5uSfknplMh8rOCZ931PyO1tCZeC87eMG/4Jk3ajNhh/4Uf/IX5 kWpjNolvQnDUJzvmklMRzgfECNqyAM8Yyokq/8xmfAdfbIQzxewundaK2UYRyDrv/8Kez T2rlKbjjQgHro+PuFiWOzNI82I43BlcrZynjQ531OHGTYMZYAyh5R/jQ3Xpd+CykSg7tl baGKZJgOB1HqQd+P6clYMYolHd8fvMno+QpCDEcLSXAVO0GwwPheI1h9KB+mmf/BMrDkk 86ADL1PC5aW/srGT3ZmUOt4xshpau76LNkuqo1RCTKkEDuD8KjfFEA267qs3+733fFQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796360697; 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=N6BQx84MEEj2HsIdH75co8gx9t98dorH/c+HU/2CpFs=; b=NUQchG1KxQ4Y1adrE3nBvZ+EgFhQifH6PF09WI2Rf8cnBR0hisz6IGqJDjC1hD91Q9A5 JoYW5RsBSUlRjxsysBqI8/5/M434v3XVofspDKlnlEaalR7AdS3s/Oa3y39xjn2fGulCu uCsQLLB+MFPXLALIqmd8hADSjqN5Qn8ypPf4Wi0eIV3CeL+beDBR6swld/nBwvL5cT7dV dlPCbLBvKwO9qgdC8JwB+RHzheqJsR8ADzw1WcUHNf082kq63I161Kq5oZeRDrq1h7Uwz OuZoto7N578JbnOMFPgUpR0pF63PGZi6gPaJTaXjJJID0lbeiASaywyuXkLdZs9aEyA== 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=rPKFfe0+; 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 E8DF3606A698 for ; Fri, 4 Dec 2026 05:04:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E8DF3606A698 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=rPKFfe0+ Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id E1AF320B716D; Thu, 3 Dec 2026 21:04:55 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E1AF320B716D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1796360695; bh=N6BQx84MEEj2HsIdH75co8gx9t98dorH/c+HU/2CpFs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rPKFfe0+n4rG3qgSztfVq5K6NyBiRapedxXp/KTaTM5zyRIDxNLhBsTQGb/fT9Wi+ 4o/eor7M+eBJY/dZpGiGnELGU9CGe5teCDL9a5wp6tHqZznYO8ivSkFv0QpxdN7PfQ gJHYE9EpJzVQlWVjWLr1kdymQSQIDm3LuHYt4wvQ= 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 4/5] soc: xilinx: Fix event manager CPU hotplug state cleanup Date: Thu, 3 Dec 2026 21:04:52 -0800 Message-ID: <20261204050453.18005-5-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 event manager removes the CPUHP_AP_ONLINE_DYN CPU hotplug state instead of its actual state. This can leave the event manager 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 event interrupts on CPUs brought online later. Fixes: c7fdb2404f66 ("drivers: soc: xilinx: add xilinx event management driver") Cc: stable@vger.kernel.org Signed-off-by: Prasanna Kumar T S M Reviewed-by: Jay Buddhabhatti Reviewed-by: Srivatsa S. Bhat (Microsoft) --- drivers/soc/xilinx/xlnx_event_manager.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/soc/xilinx/xlnx_event_manager.c b/drivers/soc/xilinx/xlnx_event_manager.c index f733dc42b3b1..e09a315b65a6 100644 --- a/drivers/soc/xilinx/xlnx_event_manager.c +++ b/drivers/soc/xilinx/xlnx_event_manager.c @@ -24,6 +24,7 @@ static DEFINE_PER_CPU_READ_MOSTLY(int, dummy_cpu_number); static int virq_sgi; static int event_manager_availability = -EACCES; +static enum cpuhp_state hp_state; /* SGI number used for Event management driver */ #define XLNX_EVENT_SGI_NUM (15) @@ -625,8 +626,6 @@ static int xlnx_event_init_sgi(struct platform_device *pdev) static void xlnx_event_cleanup_sgi(struct platform_device *pdev) { - cpuhp_remove_state(CPUHP_AP_ONLINE_DYN); - on_each_cpu(xlnx_disable_percpu_irq, NULL, 1); irq_clear_status_flags(virq_sgi, IRQ_PER_CPU); @@ -660,8 +659,14 @@ static int xlnx_event_manager_probe(struct platform_device *pdev) } /* Setup function for the CPU hot-plug cases */ - cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "soc/event:starting", - xlnx_event_cpuhp_start, xlnx_event_cpuhp_down); + hp_state = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, + "soc/event:starting", + xlnx_event_cpuhp_start, + xlnx_event_cpuhp_down); + if (hp_state < 0) { + xlnx_event_cleanup_sgi(pdev); + return hp_state; + } ret = zynqmp_pm_register_sgi(sgi_num, 0); if (ret) { @@ -670,6 +675,7 @@ static int xlnx_event_manager_probe(struct platform_device *pdev) else dev_err(&pdev->dev, "SGI %d registration failed, err %d\n", sgi_num, ret); + cpuhp_remove_state(hp_state); xlnx_event_cleanup_sgi(pdev); return ret; } @@ -704,6 +710,7 @@ static void xlnx_event_manager_remove(struct platform_device *pdev) if (ret) dev_err(&pdev->dev, "SGI unregistration over TF-A failed with %d\n", ret); + cpuhp_remove_state(hp_state); xlnx_event_cleanup_sgi(pdev); event_manager_availability = -EACCES; -- 2.49.0