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=1796031922; b=A8cmOpI864haZgKC39HytTPyCCeOrIbdr78zV/kmll+5Rtuu6aWYNEOKgiFKkoS34UeB dLBJXr3MlMocr4mUalSliFTk++yBdSGw9NI7+JUNoKjNovqHoeGqY2en2BWuHMj9ByWMv bCTW33qPk7wt9MGC+D3c7yq1gl+zpd9OhLJDzbn4Mj7cT5+0dFG3Xw3sGTMsOD+fJQXPK VOM9D83wYa+dVK+HVsKbJ/LXJnaIg2MlIjVxFfZngSouwGWneoOiMX+F0odCkyfqHW7iV 4K8GnAR/c1vjv9w6o/vqaI3PolFlTTzKRACl3bnz8in1hzjMScBOmQBSPHAnEeVa2Lg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796031922; 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=HB967Fr9qd4I79lXCczliVvLH0lMx5lwbWbqMsMH7eQ=; b=GVuOMx9wx3ixGsN/i99WGyci226wuaLSxutDr1LpYefJcd5OgRtJ46/Pyts7nSy1/cZR luk/VM/YkjRF0ZCmdsUxyNh1fdiyaCZEQbi4IPacU2KVAjDUS+L5hxE4DUNCNHKp5deT6 c1mwFtpfSfewCIZbdyjT9xidwD6pDHFVkN4j1ljt5oqJVAXRbyLoAx1yR5reRqmeB7xc5 WSy7YU4qfWJEGgS/wBEcYBH//dXx+xDfi+8T3tv0I/elxKInjHUQPGnNLyg9n9gRQb6+G GINpLbJzCMhBm3PI7OccY97ozWWhTNH/a9KYABhpXh/GBY+/lVvOadGNag0y9sifo3w== 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=L2JcYZKT; 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 5CA21606A32A for ; Mon, 30 Nov 2026 09:45:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5CA21606A32A 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=L2JcYZKT Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 81BF620B716A; Mon, 30 Nov 2026 01:45:14 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 81BF620B716A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1796031914; bh=HB967Fr9qd4I79lXCczliVvLH0lMx5lwbWbqMsMH7eQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=L2JcYZKTX1Ghj7K+kZ28XQhXEfP5X19x5bHalvNS5rIBREKML06mgIIUzUje2uWBs EAY3tqpLmRxCXAkDFHc98MlZm3WdJqTckSqnz/c0ctFgwY0o/AauVmg69fUmgzrSpP n/+xErkEc0TSXK8RkVKeqyumSE8U+3XREJXbWX3E= 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, tejas.patel@xilinx.com, rajan.vaja@xilinx.com, abhyuday.godhasara@xilinx.com, gregkh@linuxfoundation.org Subject: [PATCH v2 2/2] soc: xilinx: Fix event manager CPU hotplug state cleanup Date: Mon, 30 Nov 2026 01:45:13 -0800 Message-ID: <20261130094513.2454356-3-ptsm@linux.microsoft.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20261130094513.2454356-1-ptsm@linux.microsoft.com> References: <20261130094513.2454356-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. This is found by code inspection. 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 --- 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