Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Cc: will@kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com,
	ilkka@os.amperecomputing.com, bwicaksono@nvidia.com,
	linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2 3/4] perf/arm_cspmu: Improve sub-module error reporting
Date: Fri, 17 Jul 2026 17:16:16 +0100	[thread overview]
Message-ID: <aee1da04-3909-43d2-8cf0-82c9de323c0e@arm.com> (raw)
In-Reply-To: <20260716171213.000026c7@oss.qualcomm.com>

On 17/07/2026 1:12 am, Jonathan Cameron wrote:
> On Thu, 16 Jul 2026 15:56:36 +0100
> Robin Murphy <robin.murphy@arm.com> wrote:
> 
>> When waiting for a sub-module to register, we return a bare
>> -EPROBE_DEFER that ends up showing the end user:
>>
>>    platform arm-cs-arch-pmu.1: deferred probe pending (no reason)
>>
>> wherein it's not necessarily clear that they might need to take some
>> action to ensure the appropriate module is available to load. Let's use
>> dev_err_probe() here so we can show exactly what we're waiting for.
>>
>> Similarly, in the case where something's gone horribly wrong with an
>> already-registered module, we can use dev_WARN() to standardise the
>> device/driver attribution rather than just open-coding "arm_cspmu".
>>
>> Reviewed-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> 
> Hi Robin,
> 
> Maybe sprinkle some cleanup.h magic and use a guard(mutex)() and direct
> returns.  Simplifies this function that you are touching anyway.
> 
> Looking more broadly it'd either take a scoped_guard() or some refactoring
> if you want to go that way cross the file.

Heh, feel free to try some cosmetic refactoring if you fancy - for 
starters, "if (!match) return 0" would save a whole needless level of 
indentation here - but this patch is purely about a functional 
improvement to the user-visible logging. I'd rather not tangle that up 
in subjective non-functional changes.

(And to be brutally honest I'm not much of a fan of the cleanup.h stuff 
anyway - maybe for complex nested resource acquisition, but it's not 
like there are any gotos here, so for the sake of ~3 lines I'd 
personally rather have locking that looks like locking...)

Thanks,
Robin.

> 
> Jonathan
> 
>>
>> ---
>> v2: No change
>> ---
>>   drivers/perf/arm_cspmu/arm_cspmu.c | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c
>> index 8c2dda17d73e..caad9a36651d 100644
>> --- a/drivers/perf/arm_cspmu/arm_cspmu.c
>> +++ b/drivers/perf/arm_cspmu/arm_cspmu.c
>> @@ -437,13 +437,15 @@ static int arm_cspmu_init_impl_ops(struct arm_cspmu *cspmu)
>>   				if (ret)
>>   					module_put(match->module);
>>   			} else {
>> -				WARN(1, "arm_cspmu failed to get module: %s\n",
>> +				dev_WARN(cspmu->dev, "Failed to get module: %s\n",
>>   					match->module_name);
>>   				ret = -EINVAL;
>>   			}
>>   		} else {
>>   			request_module_nowait(match->module_name);
>> -			ret = -EPROBE_DEFER;
>> +			ret = dev_err_probe(cspmu->dev, -EPROBE_DEFER,
>> +					    "Waiting for module %s to load\n",
>> +					    match->module_name);
>>   		}
>>   
>>   		mutex_unlock(&arm_cspmu_lock);
> 



  reply	other threads:[~2026-07-17 16:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 14:56 [PATCH v2 0/4] perf/arm_cspmu: Miscellaneous improvements Robin Murphy
2026-07-16 14:56 ` [PATCH v2 1/4] ACPI/APMT: Use stable device ID Robin Murphy
2026-07-17  1:31   ` Hanjun Guo
2026-07-16 14:56 ` [PATCH v2 2/4] perf/arm_cspmu: Improve APMT-based PMU naming Robin Murphy
2026-07-16 21:13   ` Ilkka Koskinen
2026-07-16 14:56 ` [PATCH v2 3/4] perf/arm_cspmu: Improve sub-module error reporting Robin Murphy
2026-07-17  0:12   ` Jonathan Cameron
2026-07-17 16:16     ` Robin Murphy [this message]
2026-07-16 14:56 ` [PATCH v2 4/4] perf/arm_cspmu: Make IRQ more optional Robin Murphy

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=aee1da04-3909-43d2-8cf0-82c9de323c0e@arm.com \
    --to=robin.murphy@arm.com \
    --cc=bwicaksono@nvidia.com \
    --cc=catalin.marinas@arm.com \
    --cc=ilkka@os.amperecomputing.com \
    --cc=jonathan.cameron@oss.qualcomm.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=will@kernel.org \
    /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