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 EA56AEB64D9 for ; Mon, 10 Jul 2023 11:06:45 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0NrojizdOk+25QU87X2NYR4iWS1X3jntT67QADvfLb8=; b=ewnW0qrOCR70NU ZpL3+4hl3BqbQggQJxqDWhF1QdkJfq7QDshAaPmL5vPgRL1e5IndejeBlKs3ttfVJxwVUcEY00lHk AsxVJK3ZThI7MPh3rJ/dUiMfiLV8VIuKJvQpXvZk9ssuJ4L6NhQYINCV21ktimFzc1PMHxIISdYFW dRuJjAcqweDQjYPHPN/t/VUo1LaYTM5jlAY+VH6GzTuszjtTkOB/uWlhFBHw+rdPsLLhJzUsjhEX6 ztiaMLSG39TH4CX6VBpCLdup+8giWI8vNgM941v7901sOKWqcRJmCP08NwR+W6LK1C++j5he701N2 3SiEbch+7SLo/WLwB3Vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qIoic-00BQiR-1k; Mon, 10 Jul 2023 11:06:14 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qIoia-00BQh6-00; Mon, 10 Jul 2023 11:06:13 +0000 Received: from i53875a50.versanet.de ([83.135.90.80] helo=phil.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qIoi8-0000CZ-7Z; Mon, 10 Jul 2023 13:05:44 +0200 From: Heiko Stuebner To: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Yangtao Li Cc: Yangtao Li , Thomas Gleixner , Krzysztof Kozlowski , Uwe =?ISO-8859-1?Q?Kleine=2DK=F6nig?= , Jonathan Cameron , AngeloGioacchino Del Regno , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 12/21] thermal/drivers/rockchip: convert to use devm_request*_irq_probe() Date: Mon, 10 Jul 2023 13:05:42 +0200 Message-ID: <2114204.OBFZWjSADL@phil> In-Reply-To: <20230710095926.15614-12-frank.li@vivo.com> References: <20230710095926.15614-1-frank.li@vivo.com> <20230710095926.15614-12-frank.li@vivo.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230710_040612_040954_7FBB4DD0 X-CRM114-Status: GOOD ( 20.50 ) 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Am Montag, 10. Juli 2023, 11:59:16 CEST schrieb Yangtao Li: > 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=F6nig" > Cc: Jonathan Cameron > Cc: AngeloGioacchino Del Regno > Signed-off-by: Yangtao Li Acked-by: Heiko Stuebner _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel