From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4951FC44515 for ; Fri, 17 Jul 2026 16:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pj3FufgUK4WJm4b4g7xbNdYWS5jX7v2dnf2aFinCTlY=; b=TxH0wdxT4PVHGjzep40pYSMXsT 5rQ10jbXeRpcSPtvZLrF4hBLDwauioJ/tiyM5IIrBcdWk17IvPYXYI9tQLePFOce9/FqpFE2oh8Fv E/gKg5BrPBqGV0/vt0IPVm7NuBda7OEAi2GOnbbHLon3nxHwBMxEN8Qq8nGzu3PO32rCMw9YgpAwO /t41DufqFfhWEnAZw77gTpEs3VY8+xtP5kMZaD/eaqX/vqK7Sw9sTSf62nPk25PoCyjDd2EZJy2K/ fKuMcfB/v7sHZ09lmobvMLTrZYejmumsloJ8jMvEptkDCtcT/OEQQDbEo563aUQymcM2JNVdtjPjf jP9wbhIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wklEf-00000002iam-3zHy; Fri, 17 Jul 2026 16:16:25 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wklEc-00000002iZs-3kN5 for linux-arm-kernel@lists.infradead.org; Fri, 17 Jul 2026 16:16:24 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A4FEA1476; Fri, 17 Jul 2026 09:16:15 -0700 (PDT) Received: from [10.2.212.23] (e121345-lin.cambridge.arm.com [10.2.212.23]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 971193F905; Fri, 17 Jul 2026 09:16:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1784304979; bh=w0Zi2BWh5dfpwiy/hOSW/MU5kOPYrXvW79sibZvRp7o=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=WhaAS9rWsloxlgUl+kgCy5WI/pibMFWNf2PDA9a4K1EjbZ2/EltFDFM0s4BMTk+UY eEX1EbCTHmD0dkZbQTmEO1dxoauio5NpiTONH9RTSYFyohj2UJuLGHL+G8zwcGMhDt D8gyXwjswL9P3HVbPlDGYr+Jtk1+wJjH2dJuY/cM= Message-ID: Date: Fri, 17 Jul 2026 17:16:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/4] perf/arm_cspmu: Improve sub-module error reporting To: Jonathan Cameron 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 References: <256bcb4c8c98dc95bfdf295adb66b917545c919b.1784213435.git.robin.murphy@arm.com> <20260716171213.000026c7@oss.qualcomm.com> From: Robin Murphy Content-Language: en-GB In-Reply-To: <20260716171213.000026c7@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260717_091623_015489_729563B8 X-CRM114-Status: GOOD ( 19.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 17/07/2026 1:12 am, Jonathan Cameron wrote: > On Thu, 16 Jul 2026 15:56:36 +0100 > Robin Murphy 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 >> Signed-off-by: Robin Murphy > > 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); >