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 9E647C761AF for ; Mon, 27 Mar 2023 11:28:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Sn61VbONgSLkRiHDsDhF/3iGkFPInAuNorId/L+GkKk=; b=sdPNw4sVSTQE9t 6HkwMgXZhY1rEjz+UGCpMy7OB0+Fosdyul4A39PPnp7LZGX8YhrYo9kc7utYY6oBlVKtVtBV6gc+5 R3o9CsmIjNCot9L+6BmLfyVxQ5CcHfzD1h06AD14vqey83fBNym2kMOPELy7vl9Ga89h1KAkTh7jW hGsJ6QuuvPMcftaZ9ut/H3f1BcFZclwgY37x+awAh3M90uhq1Oj8y1E1OsUWYBjD419zMKGqnP6RE /z9dBE2l+61a7+50Ty7ozVFBNlyj6e99mv/6lWdoEaZVkfhU2EmyVoaVSpsOzGxIVSLY74a2y47wk ZV9eO4Nxie/MAzT3snLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgl0K-00AkVp-2T; Mon, 27 Mar 2023 11:27:12 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgl0H-00AkUB-0T for linux-arm-kernel@lists.infradead.org; Mon, 27 Mar 2023 11:27:10 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9BFFAB80B7E; Mon, 27 Mar 2023 11:26:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73A81C433D2; Mon, 27 Mar 2023 11:26:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679916418; bh=AA9PB0i43UEXirMyagzIG+tyedd7MXwYR2/xrRobVAU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L/Qnd73zbnm3lFU9+b0sx8BxpXM3GmR+e4/TXolcOieW3b0sVF/hS1y9LIZ1+XTZ+ bo2Ydn7TGlrwtZhgTD227V6nW4rpF5hPWRn+Nl1OqxBW3UL8Ylg74Q375H6lxy1Tj/ w9SKAoW6XX+LcECu0JNz8ZTfgShzWF4I2++U1ZTSe1qZRIgngzHSoZohbhimtf7WpB KialyK+slDIVQREyPr8natKc9hoDj0TsgfkDM5IYheW6tauBHfud/JN0PNcOxpO/4N eTLndk5Uv6qpNCAb2P9Uc8pN7n98GblaNL6KFFqjMWRY7P3+2W32ZOG0fE29gKLyAC J7wtJiixvSFxg== Date: Mon, 27 Mar 2023 12:26:53 +0100 From: Will Deacon To: void0red Cc: mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf/smmuv3: add a check of devm_add_action in smmu_pmu_setup_msi Message-ID: <20230327112652.GA30874@willie-the-truck> References: <20230227032557.894274-1-void0red@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230227032557.894274-1-void0red@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230327_042709_347231_CD443489 X-CRM114-Status: GOOD ( 19.94 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Feb 27, 2023 at 11:25:57AM +0800, void0red wrote: > From: Kang Chen > > devm_add_action may fails, add a warning when it happens. > > Signed-off-by: Kang Chen > --- > drivers/perf/arm_smmuv3_pmu.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c > index 25a269d43..307bac904 100644 > --- a/drivers/perf/arm_smmuv3_pmu.c > +++ b/drivers/perf/arm_smmuv3_pmu.c > @@ -724,7 +724,11 @@ static void smmu_pmu_setup_msi(struct smmu_pmu *pmu) > pmu->irq = msi_get_virq(dev, 0); > > /* Add callback to free MSIs on teardown */ > - devm_add_action(dev, smmu_pmu_free_msis, dev); > + ret = devm_add_action(dev, smmu_pmu_free_msis, dev); > + if (ret) { > + dev_warn(dev, "failed to add callback to free MSIs on teardown\n"); > + return; > + } I appreciate that you're following the existing error handling in this function, but I don't think this message is especially helpful. We'd be better off propagating the error and failing the probe in this case, I reckon. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel