Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35410594rwd; Mon, 10 Jul 2023 07:07:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlGnkfXOOTOgws5Rw2HyJLfrlXKM6iXoHq53EFoNt3n0g7du2KQnSXuUCpTDXT1U3Tdxj0KH X-Received: by 2002:a05:6a20:8f0c:b0:131:47f7:e80d with SMTP id b12-20020a056a208f0c00b0013147f7e80dmr6972260pzk.23.1688998056273; Mon, 10 Jul 2023 07:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688998056; cv=none; d=google.com; s=arc-20160816; b=JfRFRxyw90zw6OSTGN1Srlvif3AuH92vwp4wMGSmgX7XFuejwIhvdT78A6XC97PHcg Qnet8DlOZhVlfVAGk64CoxgIj8IFCV5EehSbP8DK1TYZabL93vAfBQTkGhApksC4o/t6 dioPArKC2XPmY5qupcMxESewCCjoY9CNguOZrZYsvSftsgncwY6XOJJzilIJjIVrL05W eCHi27xkfR24ltAnb+4Hf+/Ow4QQseZ72O/IR3vU2kcldsJg3ORdSZW2u3nlOPlqfQPD GCOo+rBoc1h4cjaW8SZR1yY/Se8nYDWqcmgAwA2dQB2jwiszNubGih81z+sv+wWPZDG8 LjHw== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=VOzWwiEH8DidGOYkaE3lb5x00sW6Vlf6i60YrqPi54U=; fh=vD15DqL/kUWbu51cpRVArqlfPdgN5nkLh93oXYoyLpE=; b=J3EPdMN60kASpUkBVsHrYS/D6DCF+H6hUl3IKR9Grm0eRX3MlTx2HozEJzJdA2wbdx efUt/OMtFrSyQaKcBCsDjtK3atTqJ2dJRbhC9g57Urt16ftCqSXucBn4qX4aMhx0Mfm1 QKDEGMdXRqIJ7eYB+YfvN59y2/ss4UFBLx0GY/Q2TxzHvC703oxmYyQkMuOOR4dU9kCx WnYWLaeWnTil31khkTXQCR+DFCwQ4VENROUYE8uB1gDitnPSb1X9ulZeTOW3RpU4WrIx IO0G5xo83RKJh9EQD+b+1BmuSP95yOkYBaIvL2pNs5PA815yG0motsdnCsvVciPIdnVs w8cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dhr4ZeDv; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n8-20020a635908000000b0054fb9698c4csi9099384pgb.13.2023.07.10.07.07.24; Mon, 10 Jul 2023 07:07:36 -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=@kernel.org header.s=k20201202 header.b=dhr4ZeDv; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231215AbjGJN4D (ORCPT + 99 others); Mon, 10 Jul 2023 09:56:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbjGJN4C (ORCPT ); Mon, 10 Jul 2023 09:56:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BA37D2; Mon, 10 Jul 2023 06:56:01 -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 EE9BF60FF2; Mon, 10 Jul 2023 13:56:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BDB0C433C8; Mon, 10 Jul 2023 13:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688997360; bh=Cb3zN0i3LpQdGPrnW/9rBdcgLOPCUpIjjFIxHlihHi4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dhr4ZeDvlFhsy3Uw9KN5krszlhdTd1zBWqzGJDRe0od/qNZrUnZPqLPGLGjvd+74z 8A2LULl/yLB8WQUIAuod9dyhUI9r96GhGQPX8M/bzdUwodLyRq/Lm5GXEhiqOm/sQp evbNwTdLltu7J952obKxobtDTLRyhjM/oY99GIBUHY9QV68y+F5Fk94O82l5TU1Hgq x0hoAdnoCwprW6QPyAfmgMHbxl0qFRNVStLHKOaDbRmDSsito4qSCR6G7LxtBk4Tv7 SBtHStPhoyB6fzeOCxG/NOPfECBOco0UDy3DYSM1YSs4nGAouRypVZ6aU04eDuSUGM 5jdgsnFN4WvpQ== Message-ID: <6db7b1ba-6b5b-3aef-fff7-e36a8fe5739d@kernel.org> Date: Mon, 10 Jul 2023 15:55:00 +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 05/21] thermal/drivers/tegra: convert to use devm_request*_irq_probe() To: Thierry Reding , Yangtao Li Cc: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Jonathan Hunter , Thomas Gleixner , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Jonathan Cameron , AngeloGioacchino Del Regno , linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230710095926.15614-1-frank.li@vivo.com> <20230710095926.15614-5-frank.li@vivo.com> Content-Language: en-US From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 15:16, Thierry Reding wrote: > On Mon, Jul 10, 2023 at 05:59:09PM +0800, 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. > > Do we really need to keep repeating this same commit message for each > and everyone of these commits? It's already in the cover letter and > presumably on the patch that introduces the new helper, so surely we can > come up with a denser version for individual subsystem patches. Yeah, this is way too long to put in every commit doing the same but for different drivers. Best regards, Krzysztof