Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35167498rwd; Mon, 10 Jul 2023 03:42:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlHk3F5ON/S1taqFKeStEuaKHCKN7z0LpvlPE2LVShD8ZERGNNC7+MuL+qEyamgM4Uinhn20 X-Received: by 2002:aa7:db48:0:b0:51d:d1e5:81c with SMTP id n8-20020aa7db48000000b0051dd1e5081cmr15990461edt.19.1688985741917; Mon, 10 Jul 2023 03:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688985741; cv=none; d=google.com; s=arc-20160816; b=w+T6njLvjaVAjRcofp1HFjl/SG/htLTDca9Zl8QjrJSV5PWVLFRFTW9e5m8ZQ+umcM kdeGQEvDsWVFUnzMVOjwdzD82/ZHYW97NnCL6SUMheGG+OU8Ixowd3TMRHFTmadXTk4g Ywaaj9WKGdJDZbJ8SpcZP2EMJ1lo8e90NX6CBR1RHUXac/aXBVWQmXlB9HdipmVn6MOX RjIxESX00W5RbRJR3G2ZD0ArFv66STFUUo2pDL/ipGSHD+tZaQ/aevWT+7hL4i4v0+BA 3ZiPqDYvSAjo95FceN03mXC1TyrQ19/wZETuRve3A4zfATXBvH4HfocCuGdbZHL/u2I7 eRiw== 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=nUEWXEFp+1oZr3kpVMJaoQSxkbkTSjRww+xMqeNuW+U=; fh=jzNiSjgVL1udT8ZXyYGJ+HVFVLqNB6KWzI2zDmhYWPo=; b=qsOsIt2RffH5UR4pdRSuGtIxJ40TI/be2mimC/uk1iby2z6pHOl0+yoNkBK7f1j0Oq B34SNeZ1ad7kWnkDtWclFXHzO44BqNiZPLj2gtUCH/detP7ejzqVweynnNaFsk1fCcfA /jyHVofNh/xKAoYHIeQTPLKsCmyhOcg8e5F3KjxaZ4jEXKdA+zfCGZN2kH3rZuVRqx0q MOTEFkyJybwngcK/O5PY4gLMy6OqEMDdjDzGFxcJqVDC7lN1LoAHb4h1wtLrmSY8bnQB GvS6Cz8Ra5px7O+m4yfuwZEWeGF82Ja932Hut/yDalFfjbbVSgy6MyBEbo1g4kC1bVF9 1rbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=coOXt0JV; 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 f18-20020a05640214d200b0051d9df28f17si8331988edx.501.2023.07.10.03.41.57; Mon, 10 Jul 2023 03:42:21 -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=coOXt0JV; 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 S233298AbjGJKPt (ORCPT + 99 others); Mon, 10 Jul 2023 06:15:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233305AbjGJKPe (ORCPT ); Mon, 10 Jul 2023 06:15:34 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1CF135A9 for ; Mon, 10 Jul 2023 03:14:04 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-51e344efd75so7954114a12.1 for ; Mon, 10 Jul 2023 03:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688984043; x=1691576043; 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=nUEWXEFp+1oZr3kpVMJaoQSxkbkTSjRww+xMqeNuW+U=; b=coOXt0JVy/PKdCwR4/GcJ2HCVu/jydih7pmt243YtW7vhvpPOEmjrMvIUoiGNb2tqw KUmOuEut8EA2oUMSKMubkfa6j/7dqVGpgdbIFI9TWrsfWlxVYf779f9F8xrMNW2dabhg tx9BWEHUJX1XLBGIP29lOQpaqsE7awuMjNMnWQzkiDB1yAWLBlFv79Ar+CpmOB2Nn0vy rr5mREIrx/Tut1WlmmcDE8ProxiTJthgC4g1kR8OCgQBw7A+VkKs4QA6HYpcsNEA0J/K x4UGQI8wPTq53z1DO/XEsCAe50C+8iiXfLx7SQCyXXH6uUUO4vDxvQ5VTT/HISalohPr HFQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688984043; x=1691576043; 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=nUEWXEFp+1oZr3kpVMJaoQSxkbkTSjRww+xMqeNuW+U=; b=cYftFHPhvbVeQI0IX7CjWfa3IBZv1GcRF50kRd8J+gYFEMF3uQ46v4zLbEr+yWm9+C M5g8cVjApLmPdvtQNGZ8IJh66MR+cRsd2gMGoO8Yzvso20drAbABe/odByGC0HEAHQEH dk98TYZ+4eMVxFvJug3NzWkbJtUbq63D27tXd1HcZ5THVEPn4ENPivFvbd4YlqH9YTc+ 2G8KJNJSYyIGx6E44PyvbvL+UiNXfOdO/6jbGZuOrEyP/gS2BRItRyTKOn/7V9PQB46r OZP6aC8soWGptVp/8cdfBvx+wjzpF3dpQUsQqt+1nc/rdwvQUqOL2DHCexZ23OrO8trE pRSA== X-Gm-Message-State: ABy/qLaAVPGCAMeE3fAc+xX+VO1FQWubRAZiMtUAAG65sD8BIZc0jkmR vUEvTei6DT3HNK6kpoa7wR3gNw== X-Received: by 2002:aa7:c508:0:b0:51d:e185:a211 with SMTP id o8-20020aa7c508000000b0051de185a211mr8809170edq.21.1688984043258; Mon, 10 Jul 2023 03:14:03 -0700 (PDT) Received: from [192.168.1.20] ([178.197.223.104]) by smtp.gmail.com with ESMTPSA id n24-20020aa7d058000000b0051df583ca96sm5454199edo.43.2023.07.10.03.14.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Jul 2023 03:14:02 -0700 (PDT) Message-ID: Date: Mon, 10 Jul 2023 12:14:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v4 10/21] thermal/drivers/exynos: convert to use devm_request*_irq_probe() Content-Language: en-US To: Yangtao Li , Bartlomiej Zolnierkiewicz , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar Cc: Thomas Gleixner , Krzysztof Kozlowski , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Jonathan Cameron , AngeloGioacchino Del Regno , linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230710095926.15614-1-frank.li@vivo.com> <20230710095926.15614-10-frank.li@vivo.com> From: Krzysztof Kozlowski In-Reply-To: <20230710095926.15614-10-frank.li@vivo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 10/07/2023 11:59, Yangtao Li wrote: > There are more than 700 calls to devm_request_threaded_irq method and > more than 1000 calls to devm_request_irq method. Most drivers only > request one interrupt resource, and these error messages are basically > the same. If error messages are printed everywhere, more than 2000 lines > of code can be saved by removing the msg in the driver. > > And tglx point out that: > > If we actually look at the call sites of > devm_request_threaded_irq() then the vast majority of them print more or > less lousy error messages. A quick grep/sed/awk/sort/uniq revealed > > 519 messages total (there are probably more) > > 352 unique messages > > 323 unique messages after lower casing > > Those 323 are mostly just variants of the same patterns with > slight modifications in formatting and information provided. > > 186 of these messages do not deliver any useful information, > e.g. "no irq", " > > The most useful one of all is: "could request wakeup irq: %d" > > So there is certainly an argument to be made that this particular > function should print a well formatted and informative error message. > > It's not a general allocator like kmalloc(). It's specialized and in the > vast majority of cases failing to request the interrupt causes the > device probe to fail. So having proper and consistent information why > the device cannot be used _is_ useful. > > So convert to use devm_request*_irq_probe() API, which ensure that all > error handling branches print error information. > > In this way, when this function fails, the upper-layer functions can > directly return an error code without missing debugging information. > Otherwise, the error message will be printed redundantly or missing. > > Cc: Thomas Gleixner > Cc: Krzysztof Kozlowski > Cc: "Uwe Kleine-König" > Cc: Jonathan Cameron > Cc: AngeloGioacchino Del Regno > Signed-off-by: Yangtao Li > --- Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof