Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Robin Murphy" <robin.murphy@arm.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 4/4] perf/arm_cspmu: Make IRQ more optional
Date: Thu, 09 Jul 2026 14:49:42 +0000	[thread overview]
Message-ID: <20260709144942.B11391F000E9@smtp.kernel.org> (raw)
In-Reply-To: <fb2cab05c714f24f703b242c8f8b8e9e4df938f8.1783605641.git.robin.murphy@arm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The driver improperly ignores `-EPROBE_DEFER` errors when requesting the IRQ for devices with 64-bit counters, breaking the deferred probe mechanism and leading to non-deterministic boot behavior.
--

--- Patch [4]: [PATCH 4/4] perf/arm_cspmu: Make IRQ more optional ---
commit 9b3f415215659b0aa95020707b757a52d3157692
Author: Robin Murphy <robin.murphy@arm.com>

perf/arm_cspmu: Make IRQ more optional

If we have 64-bit counters, we can reasonably assume we'll never have to
handle an overflow before the end of the universe (since we're a system
PMU with no sampling). Thus even if firmware does specify an IRQ, we can
still continue in the event of being unable to request it. This can help
systems where IRQs cannot be claimed exclusively, or are broken in other
ways.

> diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c
> index 1015d86957724..3e32342a609e4 100644
> --- a/drivers/perf/arm_cspmu/arm_cspmu.c
> +++ b/drivers/perf/arm_cspmu/arm_cspmu.c
> @@ -1257,8 +1257,11 @@ static int arm_cspmu_device_probe(struct platform_device *pdev)
>  		return ret;
>  
>  	ret = arm_cspmu_request_irq(cspmu);
> -	if (ret)
> -		return ret;
> +	if (ret) {
> +		if (counter_size(cspmu) < 64)
> +			return ret;
> +		dev_info(cspmu->dev, "Continuing without IRQ\n");
> +	}

[Severity: Medium]
Will this improperly ignore -EPROBE_DEFER if the interrupt controller is not yet
probed?

If arm_cspmu_request_irq() returns -EPROBE_DEFER from platform_get_irq_optional():

drivers/perf/arm_cspmu/arm_cspmu.c:arm_cspmu_request_irq() {
    ...
	irq = platform_get_irq_optional(pdev, 0);
	if (irq < 0)
		return irq == -ENXIO ? 0 : irq;
    ...
}

and counter_size(cspmu) >= 64, it looks like this code will mask the error and
continue without an IRQ, rather than deferring the probe. This could lead to
non-deterministic boot behavior depending on probe timing.

Could we explicitly check for and propagate -EPROBE_DEFER here?

>  
>  	ret = arm_cspmu_get_cpus(cspmu);
>  	if (ret)

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1783605641.git.robin.murphy@arm.com?part=4

      reply	other threads:[~2026-07-09 14:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 14:39 [PATCH 0/4] perf/arm_cspmu: Miscellaneous improvements Robin Murphy
2026-07-09 14:39 ` [PATCH 1/4] ACPI/APMT: Use stable device ID Robin Murphy
2026-07-09 14:52   ` sashiko-bot
2026-07-09 15:31   ` Robin Murphy
2026-07-09 14:39 ` [PATCH 2/4] perf/arm_cspmu: Improve APMT-based PMU naming Robin Murphy
2026-07-09 14:48   ` sashiko-bot
2026-07-09 15:42   ` Robin Murphy
2026-07-09 14:39 ` [PATCH 3/4] perf/arm_cspmu: Improve sub-module error reporting Robin Murphy
2026-07-09 14:39 ` [PATCH 4/4] perf/arm_cspmu: Make IRQ more optional Robin Murphy
2026-07-09 14:49   ` sashiko-bot [this message]

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=20260709144942.B11391F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --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