Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8264192rwd; Tue, 20 Jun 2023 12:32:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4HzmWq4WHFf4q9IcdbZYn49xT9ZK57lM2CRhIpHi+HASG5S8lECgnHtnmnLqsUFhs9304Y X-Received: by 2002:a05:6a00:14d2:b0:65e:fca6:f2cf with SMTP id w18-20020a056a0014d200b0065efca6f2cfmr13384460pfu.26.1687289537687; Tue, 20 Jun 2023 12:32:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687289537; cv=none; d=google.com; s=arc-20160816; b=Dq4HRkeRSulZaoh97116Kfi+2QipWN1RlLctrMvSVIIvRF3Fu9tRRrNGiWdUy6yMBd YPah+1ObamtBiyjF8J2aHYTqWX6TUZ3ZrYZFJ9vu5AfpqEmdZZ5hVFrYGF5NU7q2L9T2 sa2j/rXrIxdGFEkHsSmPD1Doh2HO3WVR9unX6Rp/XSdpJb9CQuVH3qp+QSKr48/df/4m kTHcBj/vy9sMjnUhgVs54V4Ls1UoJoAk7RJya+1fTMZNKPTJYxWMIqVsKCmYwUmOrLQJ swKQFaao80txcF3c/79C2H1BI0TMlENY8BRO6N98lYTAarzj+QeleTIWDWwTRGidvoyn DffA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=4pUkoASnKDVlNRbghMhxgnOUer5/QTr4MEdQPSjInRM=; b=ZDMWZPz8wugQgAHfwMtrguHSeE546E3MNL8LAfK3BDfIlsONbd3tRDpPd+LhmqdtHY +3Pkvd397XNiWRJTx6FyMDNunHRbB3/WiAQZijW2qv45KE4z9ZZ738SA1a5KOfZi7Syj h9BUtBaAAqLi0yZGfYkehGAkiYVormWabcLsG7JIbYxUUHISc0JIMUaidzGDonvUQ/fv +uYg1B/QvZNg6uzeBxUNP18STF0ndZbyDBDxmtjvMROm1eG56IXcOjokkS4X9ixd4K+N lZy8QZG6i8zn9ncti9S69lsWu3HojfILCjBuQl3PmieriIfA03MydKk/aXa2rNosDDym qCYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A1SgxJsL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n8-20020aa79848000000b0066767d61b7esi2277059pfq.331.2023.06.20.12.32.05; Tue, 20 Jun 2023 12:32:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A1SgxJsL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230221AbjFTTAH (ORCPT + 99 others); Tue, 20 Jun 2023 15:00:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230294AbjFTS7x (ORCPT ); Tue, 20 Jun 2023 14:59:53 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17324C2 for ; Tue, 20 Jun 2023 11:59:52 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b45c289615so67147441fa.1 for ; Tue, 20 Jun 2023 11:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687287590; x=1689879590; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4pUkoASnKDVlNRbghMhxgnOUer5/QTr4MEdQPSjInRM=; b=A1SgxJsLuu4gRO/+ZsKe4oQwLXr96Dqgko66fMBvjLK32Vp0aOgQl150Om5Py4zLEK 4VEekx2N0yLkUI0KGoU1jbDU43Gr/a3oony//zKTExijueVasseFR611zm9x6Nll8UBA tG9pQPHiMkbE58Lq8bAeMA5d8NzD21mvDvkhxV/yZqomkqf456g8c7KcUu4oLKnnB9UR p7UrJ9KcIv4aXuVmzuUJhMIbvD/xNxvNJsmsfPdwiIlvhiYeQAsLD71/xEWlfTrruXtq pYwfzHtraUPOsDVdlwBEqSjiBkAtWI4e0arZDB7xcCSCv9oPSIORZMtRvcAEIQ1E43lG tGpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687287590; x=1689879590; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4pUkoASnKDVlNRbghMhxgnOUer5/QTr4MEdQPSjInRM=; b=U542wGoeWqorArXbt/Z1XDt9A029/S4URSBUVomvkASF0DUGcsX/7tqKgmtVReOwUq SW8P8gyiIEFc+NNGRF5cdZJe9pB2cJDm7ZTMmQOO8GdnqdSfEPJsn1jxlL7YLT7wWaJA 0jJq6zjHGV/KFzCss4jdw6+qCPx/iMdVaXWx7CyaaOqmVyyYvJrrELPO6i2gm3cCPZ+w 5Bgk8ffU0zu1Xv0n2Ry1K+Tkp0B6iM3jZiyEt2Wd7iRMOi6ItoDShXz5qHjEuA1nD5Z8 T0cydmbUuf/2MO1ofssqvGggMtON7rN3rAnA0kgoXwGqnVrhkG18UXBEn4MGFOe4bV5k QyAQ== X-Gm-Message-State: AC+VfDy402zRgq5/2Ug5CDhtxwYbNOrlqbVrbYSw+niNsBlGPD9sL3cJ rBh/J5EBm8XBFOCKB/IMKAIWow== X-Received: by 2002:a2e:a0d8:0:b0:2b5:7f93:b3b3 with SMTP id f24-20020a2ea0d8000000b002b57f93b3b3mr1649596ljm.32.1687287590246; Tue, 20 Jun 2023 11:59:50 -0700 (PDT) Received: from [192.168.1.101] (abxj193.neoplus.adsl.tpnet.pl. [83.9.3.193]) by smtp.gmail.com with ESMTPSA id j6-20020a2e8506000000b002b473358e7asm516739lji.108.2023.06.20.11.59.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Jun 2023 11:59:49 -0700 (PDT) Message-ID: <1cf4af9b-b40e-9e1a-47e4-40c6334fd410@linaro.org> Date: Tue, 20 Jun 2023 20:59:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] soc: qcom: icc-bwmon: Don't ignore return values of regmap functions Content-Language: en-US To: Krzysztof Kozlowski , Bjorn Andersson Cc: Andy Gross , Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230615-topic-bwmonretval-v1-1-223bd048ebf7@linaro.org> <3364339a-908d-7ab6-7d62-a05ab8e67739@linaro.org> <20230620181451.idesqpkdyb2wa65l@ripper> <3b1b7849-c116-a9da-5c5c-a520c10a521b@linaro.org> From: Konrad Dybcio In-Reply-To: <3b1b7849-c116-a9da-5c5c-a520c10a521b@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20.06.2023 20:15, Krzysztof Kozlowski wrote: > On 20/06/2023 20:14, Bjorn Andersson wrote: >> 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... >> > > One choice could be to have for entire functions doing reads/writes: > > ret = 0; > ret != regmap_write(); > ret != regmap_write(); > ret != regmap_write(); > return ret; > > and handle this in the caller somehow. I don't think that aborting such > chain early, just because regmap mmio failures, makes sense. Meh, perhaps let's just forget about this patch. Konrad > > Best regards, > Krzysztof >