From nobody Sat Sep 26 11:02:12 2026 Received: from mail-m49198.qiye.163.com (mail-m49198.qiye.163.com [45.254.49.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBA4013AF2; Wed, 2 Sep 2026 07:23:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.254.49.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788333787; cv=none; b=a4vkgjkl8wiE0Tur7d+IswPPGccwo/kJrucqPEa2yKWRIWHQNlu/HMEkykwid8OYZ6tjR1byhfElRjlLEVy7xmUO757nVjIDnusnO4zfxkLnk3ThNZL6NebwUUqaSo6S5Zw4wSuHBUxcwmaO8oZAC4hjUlG3948f2eJ8nC69BPg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788333787; c=relaxed/simple; bh=23P8JVcvuA55hAU1+fNb8uyrSdC1Ccs1wn6x+fixPmo=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=WB7Dg650j2X72dQXz2Hu3AX38QRvCVpGywcchIQFfk+Cg8Z4twcKhcsCiMZkeuA++LJ3fNndJRQAH6Qgyscz0XEJVnOSqc8sIFWgy/Ichjj2Ussgd3WisiWE78rl+KuNsduyPLi40vYV9MWHYOf/veRVbfJItR8cA8R4CiN9ZcI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=seu.edu.cn; spf=pass smtp.mailfrom=seu.edu.cn; dkim=pass (1024-bit key) header.d=seu.edu.cn header.i=@seu.edu.cn header.b=DHd4u57s; arc=none smtp.client-ip=45.254.49.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=seu.edu.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=seu.edu.cn Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=seu.edu.cn header.i=@seu.edu.cn header.b="DHd4u57s" Received: from PC-202605011814.localdomain (unknown [222.191.246.242]) by smtp.qiye.163.com (Hmail) with ESMTP id 4c3ae27c0; Wed, 2 Sep 2026 15:22:49 +0800 (GMT+08:00) From: Runyu Xiao To: Khuong Dinh Cc: Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Runyu Xiao , Jianhao Xu Subject: [PATCH] perf: xgene: initialize lock before requesting IRQ Date: Wed, 2 Sep 2026 15:22:41 +0800 Message-Id: <20260902072241.3489222-1-runyu.xiao@seu.edu.cn> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-HM-Tid: 0aa060ffc45a03a1kunmc59ae71f19a9b3 X-HM-MType: 10 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVlDHkIeVkhCGU0ZTx8fH0JJT1YeHw 5VEwETFhoSFyQUDg9ZV1kYEgtZQVlJSUlVSkJKVUlPTVVJT0lZV1kWGg8SFR0UWUFZT0tIVUpLSE pPSExVSktLVUpCS0tZBg++ DKIM-Signature: a=rsa-sha256; b=DHd4u57ssBnKzKdav46DlB5cj7KC2LdnTpbE/giGCNhstfDQSV0yMswkbiZmoF4XP5Xd6F2E1a14tUfcfgtUXyYl9Vkd43x3y7qVET2Ps+M2Y3uoYm16GxRxT/mMogPl7xO7OwDZYk90T83Ee80HMTpflxZataU39gDY1MsaUVY=; s=default; c=relaxed/relaxed; d=seu.edu.cn; v=1; bh=tHRD4WxC/IaJcjkVhlf5WlP0bokX0W9deHxSA1TN92g=; h=date:mime-version:subject:message-id:from; Content-Type: text/plain; charset="utf-8" xgene_pmu_probe() requests the PMU IRQ before initializing xgene_pmu->lock. request_irq() enables IRQ handling before it returns, so xgene_pmu_isr() can run in this window and acquire the uninitialized raw spinlock. Initialize the lock before requesting the IRQ so the handler always sees a valid lock. Fixes: 832c927d119b ("perf: xgene: Add APM X-Gene SoC Performance Monitorin= g Unit driver") Cc: stable@vger.kernel.org Assisted-by: Codex:GPT-5 Signed-off-by: Runyu Xiao --- drivers/perf/xgene_pmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/perf/xgene_pmu.c b/drivers/perf/xgene_pmu.c index ab3623fab..0aa2b605f 100644 --- a/drivers/perf/xgene_pmu.c +++ b/drivers/perf/xgene_pmu.c @@ -1873,6 +1873,8 @@ static int xgene_pmu_probe(struct platform_device *pd= ev) if (irq < 0) return -EINVAL; =20 + raw_spin_lock_init(&xgene_pmu->lock); + rc =3D devm_request_irq(&pdev->dev, irq, xgene_pmu_isr, IRQF_NOBALANCING | IRQF_NO_THREAD, dev_name(&pdev->dev), xgene_pmu); @@ -1881,8 +1883,6 @@ static int xgene_pmu_probe(struct platform_device *pd= ev) =20 xgene_pmu->irq =3D irq; =20 - raw_spin_lock_init(&xgene_pmu->lock); - /* Check for active MCBs and MCUs */ rc =3D xgene_pmu_probe_active_mcb_mcu_l3c(xgene_pmu, pdev); if (rc) { --=20 2.34.1