Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5208583rwb; Mon, 8 Aug 2022 14:21:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR7WBasCGfCLPCECYax4blN/pXSAw9zVDUbygeTG7yhEYlGZGxHiBOliFjxuFa5v8EpyuMch X-Received: by 2002:a17:906:8445:b0:730:ba5a:ef59 with SMTP id e5-20020a170906844500b00730ba5aef59mr15794553ejy.182.1659993678123; Mon, 08 Aug 2022 14:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659993678; cv=none; d=google.com; s=arc-20160816; b=pphf+cUV0VKnwOnATPWj2J6jdrbsOsdHLrH2pcYEW3mJf9vnva1JI1FOU/KXm/WXjj 6mdSVMWgDAvGp56h/XRS+EFUMaDL164NgmxjL2RrCTaBBMc6iyt7OSJqbyzHHRoaUs4f Pl+0F1kQqJTrx0w08Qd0AjuwBN+5Wsdm9iaJyEbKJtD3ciE5YkEzLViZgHOJmCRX6M9K vEX7tCcEHpJk413voS/SDQDli9ZE2z4RGCa27bFUrPDmrTZEKX2WyOHGAnb0c3/4UEpk 80tbA/iQ/GEBI1uY9YbieEwgPL7hEWCxwUhpuc3pSYJ86ZBWWJqfd3zlPwYzQU2FvNB/ C6zA== 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=xT3U7Fcq666IjZnpP4Hd9cAsdG9vkr6FYDlzUI0n/OE=; b=xfatDN5qosro/ziihKx3pW+HtbZ4SQvg76bCgA3fjHnEcQtvNQ/pxbrEWX5iq5x1rf T3HYs5k1j8Mi5qK+3JxKxj32toTBvBq47rDO7uGL+ePs8iXLzgH/pCRbu6qIcGOe48Li FeIVrF6Mr/bpumjqoRv1FILpwupUD+LhdNsQNMyhdVirmpHmJ4240rrDvZz6LFgkVXS9 jWuLJwm+xBgvrYEUVvyzEKW2YLrgr969VoTwFysCDoAET7tOR2vapunOHn4Ef1fWd7/T JZzAa6ttPGN56JFY0lCi1TD+lbmEh1OK2B0WJZzl+aQQEgQYixYmx+pxDtCvnzBMMqyG 4Pog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ECongWXK; 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 hp15-20020a1709073e0f00b00730870cb4b6si587595ejc.621.2022.08.08.14.20.53; Mon, 08 Aug 2022 14:21:18 -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=ECongWXK; 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 S238812AbiHHVRq (ORCPT + 99 others); Mon, 8 Aug 2022 17:17:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238069AbiHHVRo (ORCPT ); Mon, 8 Aug 2022 17:17:44 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6A061AF3A for ; Mon, 8 Aug 2022 14:17:42 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id a11so5380197wmq.3 for ; Mon, 08 Aug 2022 14:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=xT3U7Fcq666IjZnpP4Hd9cAsdG9vkr6FYDlzUI0n/OE=; b=ECongWXKH2gwPuWgmxYdr6guRMPl4jAF8wszWyuDEt5/3rpg1VhdodvEh3b0QBJjMu jGuXiG3uAJrZY2JzewgWe+wqpjTOPR5nMCDJUoBHV71Wu31SoMOUZSGcUU+V/BgGTuoy iVb6OREEZ4TfbdQdQqMHPScwgu2CXEsFtz4WSM90RaGHcMVscynjwcqz6Pyx/I7NK/TI zT/kzTU86DoKMKXH5cCVDZiAL1O5h6QNpKCMMH9MPqLwM/TjTMEnWa0yh1zmJ4LaADHI kzYBPFYPlmtlKKcbEVAmF6tKXgF52bwvvAz7j8ELzRCOEsd+XYWyWY7oGbauIVyZh6Hv UCgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=xT3U7Fcq666IjZnpP4Hd9cAsdG9vkr6FYDlzUI0n/OE=; b=hnFWNCl8G58qdEMZx1Y14fD/I0VUbkb1UUC6tep2cUXDkK0xmsY5ko/0SyE/IVAbvL nICp0jBxaMGRuUEkITH2QVCRS0ysf9U6EXckr+3pOgH4A7ZQcOAFa2jZnnmVhHd09a8q lA6G8kwxh8+VtaPGTphk3+48GgdOUEQpZ2k+JaC5WTblcf0D+UuTtUHQUSOJUqBlDcdi o7/9FwNFpi7dP3VFClHlrlM0sZwY6lzqxaFy3uZVWV7UIBc+BqqE3MGcapZ7p9+MZgqg NZQYTTZsIma2JEQ4pCjgnOnJvR7+1zr2sOu3bL473QZI6dQNBbt+DetoBfLPus/o9sC6 p1Xg== X-Gm-Message-State: ACgBeo0FHA6Wf74ZGkGynPHy3RCbLpBAu2lCfbSpYxH1la0KfiuM+ydO J8tb4zOk3CJM661sQpwSk7nPUg== X-Received: by 2002:a05:600c:1ca0:b0:3a5:3703:2a97 with SMTP id k32-20020a05600c1ca000b003a537032a97mr6409480wms.23.1659993461134; Mon, 08 Aug 2022 14:17:41 -0700 (PDT) Received: from [192.168.10.46] (146725694.box.freepro.com. [130.180.211.218]) by smtp.googlemail.com with ESMTPSA id o6-20020a05600c4fc600b003a32490c95dsm20358062wmq.35.2022.08.08.14.17.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Aug 2022 14:17:39 -0700 (PDT) Message-ID: Date: Mon, 8 Aug 2022 23:17:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 2/4] thermal/of: Return -ENODEV instead of -EINVAL if registration fails Content-Language: en-US To: Michael Walle , Guenter Roeck Cc: rafael@kernel.org, dan.carpenter@oracle.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria , Zhang Rui References: <20220808180915.446053-1-daniel.lezcano@linaro.org> <20220808180915.446053-2-daniel.lezcano@linaro.org> From: Daniel Lezcano In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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 08/08/2022 21:05, Michael Walle wrote: > Am 2022-08-08 20:35, schrieb Guenter Roeck: >> On 8/8/22 11:09, Daniel Lezcano wrote: >>> The previous version of the OF code was returning -ENODEV if no >>> thermal zones description was found or if the lookup of the sensor in >>> the thermal zones was not found. >>> >>> The backend drivers are expecting this return value as an information >>> about skipping the sensor initialization and considered as normal. >>> >>> Fix the return value by replacing -EINVAL by -ENODEV >>> >>> Signed-off-by: Daniel Lezcano >>> --- >>>   drivers/thermal/thermal_of.c | 4 ++-- >>>   1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c >>> index 368eb58e97cf..4210c18ef7b2 100644 >>> --- a/drivers/thermal/thermal_of.c >>> +++ b/drivers/thermal/thermal_of.c >>> @@ -329,7 +329,7 @@ static struct device_node >>> *of_thermal_zone_find(struct device_node *sensor, int >>>       np = of_find_node_by_name(NULL, "thermal-zones"); >>>       if (!np) { >>>           pr_err("Unable to find thermal zones description\n"); >> >> I really don't like that error message: People will see it (and complain) >> whenever a sensor registers and there is no thermal zone, even though >> that >> is perfectly normal (see description above). > > I can second that, and there actually two error messages: > > [    6.156983] thermal_sys: Unable to find thermal zones description > [    6.163125] thermal_sys: Failed to find thermal zone for hwmon id=0 Yeah, I can check: np = of_thermal_zone_find(sensor, id); And print the error if PTR_ERR(np) != ENODEV, otherwise silently return. > On the sl28 board with the qoriq_thermal driver: > [    1.917940] thermal_sys: Failed to find thermal zone for tmu id=2 > [    1.929231] thermal_sys: Failed to find thermal zone for tmu id=3 > [    1.940519] thermal_sys: Failed to find thermal zone for tmu id=4 > [    1.951814] thermal_sys: Failed to find thermal zone for tmu id=5 > [    1.963109] thermal_sys: Failed to find thermal zone for tmu id=6 > [    1.974399] thermal_sys: Failed to find thermal zone for tmu id=7 > [    1.985690] thermal_sys: Failed to find thermal zone for tmu id=8 > [    1.996980] thermal_sys: Failed to find thermal zone for tmu id=9 > [    2.008274] thermal_sys: Failed to find thermal zone for tmu id=10 > [    2.019656] thermal_sys: Failed to find thermal zone for tmu id=11 > [    2.031037] thermal_sys: Failed to find thermal zone for tmu id=12 > [    2.048942] thermal_sys: Failed to find thermal zone for tmu id=13 > [    2.060320] thermal_sys: Failed to find thermal zone for tmu id=14 > [    2.071700] thermal_sys: Failed to find thermal zone for tmu id=15 > > Btw. the driver seems to always register 16 sensors regardless how > many the actual hardware has (or rather: are described in the DT). Yes, it may be nicer to rely on the compatible string to figure out the sensors of the platform and call with full knowledge the registering function. But anyway ... -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog