Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Myria Sarvay" <myrialsarvay@gmail.com>
Cc: linux-perf-users@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 11/13] arm64: dts: apple: t604x: Add PMU Device Nodes
Date: Tue, 03 Nov 2026 11:12:53 +0000	[thread overview]
Message-ID: <sashiko-outbox-195124@kernel.org> (raw)
In-Reply-To: <20261103-m3-plus-pmu-events-v1-11-a8eb6c1139fe@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] arm64: dts: apple: t6041: 4-cell PMU interrupts with 3-cell aic parent
--

commit d0216cee20998d9364fd46a4827e945211d4e88a
Author: Myria Sarvay <myrialsarvay@gmail.com>

arm64: dts: apple: t604x: Add PMU Device Nodes

This commit adds the pmu-e and pmu-p device tree nodes for the Apple M4
Pro/Max (t6041) SoC.

> diff --git a/arch/arm64/boot/dts/apple/t6041.dtsi b/arch/arm64/boot/dts/apple/t6041.dtsi
> index 9110d05c896da..2c72972d12192 100644
> --- a/arch/arm64/boot/dts/apple/t6041.dtsi
> +++ b/arch/arm64/boot/dts/apple/t6041.dtsi
> @@ -314,6 +314,18 @@ l2_cache_2: l2-cache-2 {
>  		};
>  	};
>  
> +	pmu-e {
> +		compatible = "apple,brava-e-pmu";
> +		interrupt-parent = <&aic>;
> +		interrupts = <AIC_FIQ 0 AIC_CPU_PMU_E IRQ_TYPE_LEVEL_HIGH>;
> +	};
> +
> +	pmu-p {
> +		compatible = "apple,brava-p-pmu";
> +		interrupt-parent = <&aic>;
> +		interrupts = <AIC_FIQ 0 AIC_CPU_PMU_P IRQ_TYPE_LEVEL_HIGH>;
> +	};

[Severity: High]
Should the interrupts properties in pmu-e and pmu-p use 3 cells instead of 4?

In arch/arm64/boot/dts/apple/t6041.dtsi, the parent aic controller declares
3 interrupt cells:

	aic: interrupt-controller@502400000 {
		compatible = "apple,t6041-aic3", "apple,t8122-aic3";
		...
		#interrupt-cells = <3>;

When arm_pmu_device_probe() -> pmu_parse_irqs() ->
platform_get_irq_affinity() -> of_irq_parse_one() parses these 4-cell
specifiers against the 3-cell parent, only the first 3 cells are read into
fwspec->param[0..2] with fwspec->param_count = 3.

In drivers/irqchip/irq-apple-aic.c, both aic_irq_get_fwspec_info() and
aic_irq_domain_translate() then read param[1] (which is 0, matching
AIC_TMR_HV_PHYS) as the FIQ index and param[2] (AIC_CPU_PMU_E or
AIC_CPU_PMU_P) as the trigger type:

	if (fwspec->param_count == 3)
		intid = fwspec->param[1];
	else
		intid = fwspec->param[2];

and:

	args = &fwspec->param[1];

	if (fwspec->param_count == 4) {
		die = args[0];
		args++;
	}

As a result, the PMU affinity masks at AIC_CPU_PMU_E and AIC_CPU_PMU_P are
missed, and interrupt translation or registration fails for both PMU nodes
(returning -ENOENT in EL1, or colliding with the hyp-phys timer FIQ / failing
aic_fiq_set_type() with -EINVAL in EL2). When platform_get_irq_affinity()
fails in pmu_parse_irqs(), it triggers WARN_ON(irq <= 0) and leaves
pmu->supported_cpus empty, causing armpmu_register() to pass nr_cpu_ids to
topology_core_has_smt() and read past the end of cpu_topology[].

Should these be:

	interrupts = <AIC_FIQ AIC_CPU_PMU_E IRQ_TYPE_LEVEL_HIGH>;

and:

	interrupts = <AIC_FIQ AIC_CPU_PMU_P IRQ_TYPE_LEVEL_HIGH>;

matching the timer node in t6041.dtsi and the PMU nodes in t8132.dtsi and
t8140.dtsi?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261103-m3-plus-pmu-events-v1-0-a8eb6c1139fe@gmail.com?part=11

  reply	other threads:[~2026-11-03 11:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 10:14 [PATCH 00/13] drivers/perf: apple_m1: Add M3/M4/A18 Pro Support Myria Sarvay via B4 Relay
2026-11-03 10:14 ` [PATCH 01/13] dt-bindings: arm: pmu: Add Apple M3/M4/A18 Pro SoC CPU PMU compatibles Myria Sarvay via B4 Relay
2026-11-03 10:14 ` [PATCH 02/13] drivers/perf: apple_m1: Remove unused variables Myria Sarvay via B4 Relay
2026-11-03 10:14 ` [PATCH 03/13] drivers/perf: apple_m1: Support per-implementation event tables Myria Sarvay via B4 Relay
2026-11-03 10:14 ` [PATCH 04/13] drivers/perf: apple_m1: Support per-implementation event size Myria Sarvay via B4 Relay
2026-11-03 10:14 ` [PATCH 05/13] drivers/perf: apple_m1: Use macros for per-implementation init functions Myria Sarvay via B4 Relay
2026-11-03 10:31   ` sashiko-bot
2026-11-03 10:14 ` [PATCH 06/13] drivers/perf: apple_m1: Add Apple M3 Series Support Myria Sarvay via B4 Relay
2026-11-03 10:14 ` [PATCH 07/13] drivers/perf: apple_m1: Add Apple M4 " Myria Sarvay via B4 Relay
2026-11-03 10:14 ` [PATCH 08/13] drivers/perf: apple_m1: Add Apple A18 Support Myria Sarvay via B4 Relay
2026-11-03 10:47   ` sashiko-bot
2026-11-03 10:14 ` [PATCH 09/13] arm64: dts: apple: t603x: Add PMU Device Nodes Myria Sarvay via B4 Relay
2026-11-03 10:54   ` sashiko-bot
2026-11-03 10:14 ` [PATCH 10/13] arm64: dts: apple: t8122: " Myria Sarvay via B4 Relay
2026-11-03 10:14 ` [PATCH 11/13] arm64: dts: apple: t604x: " Myria Sarvay via B4 Relay
2026-11-03 11:12   ` sashiko-bot [this message]
2026-11-03 10:14 ` [PATCH 12/13] arm64: dts: apple: t8132: " Myria Sarvay via B4 Relay
2026-11-03 10:14 ` [PATCH 13/13] arm64: dts: apple: t8140: " Myria Sarvay via B4 Relay
2026-11-03 11:23   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-195124@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=myrialsarvay@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox