From nobody Sun Feb 8 23:26:21 2026 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) (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 1061F165F1A for ; Mon, 26 Jan 2026 03:30:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=222.66.158.135 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769398257; cv=none; b=PSNRtfjZK6iljveUDTDiE0Cyn8nt1Rqm5e0MpShkgMHzYxow67+QgFvIAwBotIVu/2KIE++1KWeJgzTEHOGaoI3nap70VBHp4kbGG5gedmAMLxYS5Ra0zk2YJMqrQ5UcrXPx43VCBETie4py9sDOpLrXVNt4Io9NciLA9t5FLTs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769398257; c=relaxed/simple; bh=IoL0BUFyWJmCBdkGKItuiDBMIbQjg6mvYgMEI6krK/Y=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dTeFjj2QoiT2/JFNFgT75o/vmR/D9EPYJxh4Vh0PKOM/XVK4xQZUB77KEvE26/4yprW6yDVRI6TwCOKmlkYF6+Ya1itWCSpoCvuzHxpfwh2zt6YTHwvgdo28QIJNKZlDzJyFz3ufvgKVAq/leqaN23Z8BxtLlgVtRpWNShRLNUw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=unisoc.com; spf=pass smtp.mailfrom=unisoc.com; dkim=pass (2048-bit key) header.d=unisoc.com header.i=@unisoc.com header.b=rq1Rf5ZT; arc=none smtp.client-ip=222.66.158.135 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=unisoc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unisoc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=unisoc.com header.i=@unisoc.com header.b="rq1Rf5ZT" Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 60Q3UW8q017213; Mon, 26 Jan 2026 11:30:32 +0800 (+08) (envelope-from baisheng.gao@unisoc.com) Received: from SHDLP.spreadtrum.com (zeshmbx08.spreadtrum.com [10.29.3.106]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4dzv6J0x1jz2P3QY8; Mon, 26 Jan 2026 11:24:40 +0800 (CST) Received: from BJ15137PCW.spreadtrum.com (10.0.73.52) by zeshmbx08.spreadtrum.com (10.29.3.106) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 26 Jan 2026 11:30:30 +0800 From: Baisheng Gao To: Robin Murphy , Will Deacon , Mark Rutland , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: , , , , , Subject: [PATCH 1/2] perf/arm-ni: Don't crash in probing clock domains without a PMU instance Date: Mon, 26 Jan 2026 11:30:28 +0800 Message-ID: <20260126033029.7923-2-baisheng.gao@unisoc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260126033029.7923-1-baisheng.gao@unisoc.com> References: <20260126033029.7923-1-baisheng.gao@unisoc.com> 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-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To zeshmbx08.spreadtrum.com (10.29.3.106) X-MAIL: SHSQR01.spreadtrum.com 60Q3UW8q017213 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unisoc.com; s=default; t=1769398245; bh=JJznXfRb1ExPhgEM/qLqi6O5sc5Mc/cQpjqasq10Kfc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=rq1Rf5ZTNsTGKtBFW9tmJo2IU65pSOJ9P5RWdq5PhbZQugVhnOtuHcwkhL8lC9BMf ezheTT0OGk8iXcymBvNZHtWqGHT2thuRfSP1Cq1Q1L3db+zT7Ndy3RqHlj1PdWkGVc nyqoso80N4mnPOtQeVas6imtdY/S+Um0+sXQ+cifXxPK+Y3v41nFwVvF4opsPu346M MFHc/g1eMdywB/YxuolBD2jywyRhau0HKvBJwcIvlo5QU7nziSMHf5agQfQtsOALMc lrX+0s7EJCWvs1BjhuD0Xk66Wq4l9SC9UqlxV14WvOLvrrQTOMcMagUswUoeUz+Sh1 xqz3VFumlODxg== Content-Type: text/plain; charset="utf-8" The NULL pmusela pointer implies that current clock domain doesn't have a PMU instance. Return 0 for probing the next clock domain. Otherwise a kernel crash will happen. Signed-off-by: Baisheng Gao --- drivers/perf/arm-ni.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/perf/arm-ni.c b/drivers/perf/arm-ni.c index 66858c65215d..53b656983da1 100644 --- a/drivers/perf/arm-ni.c +++ b/drivers/perf/arm-ni.c @@ -526,6 +526,7 @@ static int arm_ni_init_cd(struct arm_ni *ni, struct arm= _ni_node *node, u64 res_s { struct arm_ni_cd *cd =3D ni->cds + node->id; const char *name; + static atomic_t id; =20 cd->id =3D node->id; cd->num_units =3D node->num_components; @@ -562,6 +563,11 @@ static int arm_ni_init_cd(struct arm_ni *ni, struct ar= m_ni_node *node, u64 res_s case NI_TMNI: case NI_CMNI: unit->pmusela =3D arm_ni_get_pmusel(ni, unit_base); + if (!unit->pmusela) { + dev_info(ni->dev, "No have PMU %d\n", cd->id); + devm_kfree(ni->dev, cd->units); + return 0; + } writel_relaxed(1, unit->pmusela); if (readl_relaxed(unit->pmusela) !=3D 1) dev_info(ni->dev, "No access to node 0x%04x%04x\n", unit->id, unit->ty= pe); @@ -591,7 +597,7 @@ static int arm_ni_init_cd(struct arm_ni *ni, struct arm= _ni_node *node, u64 res_s writel_relaxed(U32_MAX, cd->pmu_base + NI_PMCNTENCLR); writel_relaxed(U32_MAX, cd->pmu_base + NI_PMOVSCLR); =20 - cd->irq =3D platform_get_irq(to_platform_device(ni->dev), cd->id); + cd->irq =3D platform_get_irq(to_platform_device(ni->dev), atomic_fetch_in= c(&id)); if (cd->irq < 0) return cd->irq; =20 --=20 2.34.1 From nobody Sun Feb 8 23:26:21 2026 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) (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 D7A3520B810 for ; Mon, 26 Jan 2026 03:30:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=222.66.158.135 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769398257; cv=none; b=ZnJM5PHWvmKfuzmHfoWwXd5SPuWwRZwY+QxvC7p4B2pqrZ3J3mm5H/KLr6I1HB10rcyNRSclHNCREBqR0AzQ0TzJ+cCwlWLIwR/SLPP6aBGWdWsQN1RkYY/eg9z0NCjkYfcK3dyaUTbDMsyJcK9y2FjmwOo05Z5Ks+3ExAeYkWk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769398257; c=relaxed/simple; bh=Q/J9J/pw9UXt2Q6x57AIZnWPbZDuxQ0X4GChAbdKBrA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f5oT/7hLctjkjJnRH7PE3mvEd7955gYyn0cmNthiCQsxJh0C2rgXcuqeCeQxThRO+2MzaxW+CckDXKPjlhR1zUsImG18q4NFaMNH71vHzC2zck5jWAMoV9ZfSYnOU9kWpCA1KQI+ZxsbfdnuJqiRH2+/zQ3MDkT9+BKpTazQCL4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=unisoc.com; spf=pass smtp.mailfrom=unisoc.com; dkim=pass (2048-bit key) header.d=unisoc.com header.i=@unisoc.com header.b=fdAYSVhv; arc=none smtp.client-ip=222.66.158.135 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=unisoc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unisoc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=unisoc.com header.i=@unisoc.com header.b="fdAYSVhv" Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 60Q3UXk7017409; Mon, 26 Jan 2026 11:30:33 +0800 (+08) (envelope-from baisheng.gao@unisoc.com) Received: from SHDLP.spreadtrum.com (zeshmbx08.spreadtrum.com [10.29.3.106]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4dzv6K0TC9z2MC1Xh; Mon, 26 Jan 2026 11:24:41 +0800 (CST) Received: from BJ15137PCW.spreadtrum.com (10.0.73.52) by zeshmbx08.spreadtrum.com (10.29.3.106) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 26 Jan 2026 11:30:31 +0800 From: Baisheng Gao To: Robin Murphy , Will Deacon , Mark Rutland , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: , , , , , Subject: [PATCH 2/2] dt-bindings/perf: Drop irqs for clock domains without a PMU instance Date: Mon, 26 Jan 2026 11:30:29 +0800 Message-ID: <20260126033029.7923-3-baisheng.gao@unisoc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260126033029.7923-1-baisheng.gao@unisoc.com> References: <20260126033029.7923-1-baisheng.gao@unisoc.com> 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-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To zeshmbx08.spreadtrum.com (10.29.3.106) X-MAIL: SHSQR01.spreadtrum.com 60Q3UXk7017409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unisoc.com; s=default; t=1769398253; bh=czsV1XmnEkzLgfR3k2U1B+o7cQbHMg5oL+Q48pBs/VM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fdAYSVhv4IfLebcYVSHtcTLZyK4eKSt350dQhL/nJTRow6txiW1XgP15hQ3uwYuDV QvQg5pCVhaZFc8qGoziaPUbq5dBtGtVjxjQmedvgGRlgmaPSEeHqxzLG3Igr825XWE 6kZg89ctfDFZx2Bbn5q7INyyHsW3pwb7M5BbE9MJ76aEi/qwz+yxXfva47t9Lgx9pI vz115Q5afkO0XXhoxzJcRsGiw8YqgMHCjt4kkY770cmRWuBMEIelklaHVyIJID7tWM fvBb7wzsY8g2ZnjHCrEmrN/yMI19R8XHte05l3Jmo49WSWFgnolp0uTt9seD/d+vCh eeqSWeSB2on4g== Content-Type: text/plain; charset="utf-8" No need to specify the interrupts for the clock domains without a PMU instance. Signed-off-by: Baisheng Gao --- Documentation/devicetree/bindings/perf/arm,ni.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/perf/arm,ni.yaml b/Documenta= tion/devicetree/bindings/perf/arm,ni.yaml index d66fffa256d5..40a5b8929ef2 100644 --- a/Documentation/devicetree/bindings/perf/arm,ni.yaml +++ b/Documentation/devicetree/bindings/perf/arm,ni.yaml @@ -20,7 +20,8 @@ properties: interrupts: minItems: 1 maxItems: 32 - description: Overflow interrupts, one per clock domain, in order of do= main ID + description: Overflow interrupts, one per clock domain which has a PMU + instance, in order of domain ID. =20 required: - compatible --=20 2.34.1