Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5118350rwb; Mon, 8 Aug 2022 12:30:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR4eV4pM5vU08VD3T3O1VH8X7c31euI29Ls2KY0ql0l5S5w4rCzgUBKIMaoomxdPMUNSvZWP X-Received: by 2002:a05:6402:f17:b0:43e:4700:f63e with SMTP id i23-20020a0564020f1700b0043e4700f63emr18856930eda.190.1659987018308; Mon, 08 Aug 2022 12:30:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659987018; cv=none; d=google.com; s=arc-20160816; b=CFkIUUA77WU07EZEuv0EXJc3iZ8F1qv7/MUmr9XfjvDKcnwev38FohtSIXsvYrQ1BQ pvmy5rTJYcSauFhaVqccXI/UqF7DcLQ1bAGaTT644iNVYm7k8T5g0tH5CjMa4ot3NgGe J+CzqjstDziFoOKTt13hg4uh+aq4CNGrzoQiEogZzaCuNmyn5SQsWxjz8+WbXFd4kDiK qaSGZQuGFMd/KnnnFBo8agEpdAQd5dD0GakhWzWaBiXJg8SwAcKGiFxzIqJ768lyquf9 NLlko9KDI5egPQewswXfDRWjXd48lmzJC0g+qVf0tT/ZYCgTtLggpCvPrJflcp7bwRNK icOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=9jzDzcair3ObU6jjVtN9JrVQdO9IqV9O9cxNAy1EWsQ=; b=V9eMXyhuktw9vKKC7H4TgqigbM8xSLNvS6NkI2OtyCTU3PVUhxFvg6XwObS9A2NSsG txgpClw2I/IlZDl4USYFynypeVJS5f1uhbonsFv/abk+WfaR/5hiOmcvhA1wSvdzEiD+ tBh/7/eSOLLhnw9W9qtgYXLgmfrHU6hlWSD7UQIZWZBlWdkY6qmXVGtzSoeLFMHgdkGg vUV+V2UhgU2JrNB782kY+QiQKsWQ3AWKw1nBpGW1lorKLs0OoUs5AgPvTzIjWDPgfBKb 5MxeiryME2jYao1lvNC1pIks2ZIv+QRt7XhhPSNpQ+E1hTpfNx1LcjvHbkLnXpJRrx4o pjqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=EA5Zde1j; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15-20020a056402084f00b0043ce8b2c72dsi8738732edz.36.2022.08.08.12.29.52; Mon, 08 Aug 2022 12:30: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=@walle.cc header.s=mail2016061301 header.b=EA5Zde1j; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244201AbiHHTFv (ORCPT + 99 others); Mon, 8 Aug 2022 15:05:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236838AbiHHTFu (ORCPT ); Mon, 8 Aug 2022 15:05:50 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFDEDE1F; Mon, 8 Aug 2022 12:05:48 -0700 (PDT) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id E81532224F; Mon, 8 Aug 2022 21:05:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1659985547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9jzDzcair3ObU6jjVtN9JrVQdO9IqV9O9cxNAy1EWsQ=; b=EA5Zde1jaGtDz4kuSUT8cQ7hayTtawRfJC+kw5Nm3lOaXM6equOhzHZc5rVKC4CKybY+eS hZ+zPyNt3cXtnYcviOgoBhOw0SbeIBj0NKra2GhgMzo3nfB3a8h69MLn9s2Qy3FtkDM2uS PaoxeQ+wnyaMR+zj0GPy/3gtcDrIms8= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 08 Aug 2022 21:05:46 +0200 From: Michael Walle To: Guenter Roeck Cc: Daniel Lezcano , rafael@kernel.org, dan.carpenter@oracle.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria , Zhang Rui Subject: Re: [PATCH 2/4] thermal/of: Return -ENODEV instead of -EINVAL if registration fails In-Reply-To: References: <20220808180915.446053-1-daniel.lezcano@linaro.org> <20220808180915.446053-2-daniel.lezcano@linaro.org> User-Agent: Roundcube Webmail/1.4.13 Message-ID: X-Sender: michael@walle.cc X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 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 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). -michael