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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6713FEB64D7 for ; Tue, 20 Jun 2023 18:11:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229839AbjFTSLk (ORCPT ); Tue, 20 Jun 2023 14:11:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbjFTSLj (ORCPT ); Tue, 20 Jun 2023 14:11:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E384B186; Tue, 20 Jun 2023 11:11:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 80C536135B; Tue, 20 Jun 2023 18:11:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64B49C433C0; Tue, 20 Jun 2023 18:11:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687284697; bh=VTiFKT6Z64g8zSgonzXFVxQd/dWKaj0YtS/ajTUezpw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LS9BK7eLpAP73WcTFv8l0fgFL9o/t1b/Tx9HjzSZL31GlFhrnKdU/79nw0gz19IHR F0XMbKzmmWsttEZNv6qCM9wgAdHjc52slCOjO8C8HgBpx/wRq96ksJqN4XFh9pM7l7 HjGhxBrr0+XMxG6WoIc54qNrHorg6FWBX068XtVeHmWwsg6+ck4IX1sLSJIpfy9gXL aQ5D1GWVG074oRFoFM8ACxO1ifsK9XGOIakbQdtAvTiLh5lzMAbJ8K3Yu2wgEpp8jo S1r24JvaWPYE7vf3TW64i4W8hQYMgD2gxBAdaO0EeCVHULsm+DJMclS2kltemUOn8X 5uK9wODajJxBg== Date: Tue, 20 Jun 2023 11:14:51 -0700 From: Bjorn Andersson To: Krzysztof Kozlowski Cc: Konrad Dybcio , Andy Gross , Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] soc: qcom: icc-bwmon: Don't ignore return values of regmap functions Message-ID: <20230620181451.idesqpkdyb2wa65l@ripper> References: <20230615-topic-bwmonretval-v1-1-223bd048ebf7@linaro.org> <3364339a-908d-7ab6-7d62-a05ab8e67739@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3364339a-908d-7ab6-7d62-a05ab8e67739@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Thu, Jun 15, 2023 at 11:26:13PM +0200, Krzysztof Kozlowski wrote: > On 15/06/2023 23:12, Konrad Dybcio wrote: > > As it turns out, not all regmap accesses succeed. Not knowing this is > > particularly suboptimal when there's a breaking change to the regmap > > APIs. Monitor the return values of regmap_ calls and propagate errors, > > should any occur. > > > > To keep any level of readability in bwmon_enable(), add some comments > > to separate the logical blocks. > > > > Signed-off-by: Konrad Dybcio > > Nice coincidence, I just had some talks with a friend about uselessness > (IMHO) of regmap MMIO return status checks. > > Sorry, for me most of this makes the code difficult to read for no gain. > Errors are not real. This is some artificial problem. Solving it makes > code less maintainable. > > If we used here readl/writel, you would not add any checks, right? Then > don't add for regmap mmio. > I agree, the mmio regmap interface should only fail because of bugs or things are misconfigured. Would be nice to capture that in a WARN_ON() or something... Regards, Bjorn