From patchwork Tue Aug 8 13:29:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 9888159 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4038B60352 for ; Tue, 8 Aug 2017 13:30:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31F3D208C2 for ; Tue, 8 Aug 2017 13:30:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 26E9128911; Tue, 8 Aug 2017 13:30:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EFF12892A for ; Tue, 8 Aug 2017 13:30:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752183AbdHHNaH (ORCPT ); Tue, 8 Aug 2017 09:30:07 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:36569 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752142AbdHHNaH (ORCPT ); Tue, 8 Aug 2017 09:30:07 -0400 Received: by mail-wm0-f49.google.com with SMTP id t201so7324529wmt.1 for ; Tue, 08 Aug 2017 06:30:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=rWalVg1x2I/5RiIinPR0AZg7BnRjkGz9CJCJtnthrY4=; b=A8Xc7lRMa8aC+Wi1t8wrGWwFnpdsykNV83mIM4LZnpgKgsCmX01omQ5Mn0LI3N551K XdqBxu5u0DoyIevmk2eDQs6JAbfKfH/s0Hu254BSKkp+i4S1BckvhcAa5XR4755OLewc tPvlBHKOTbxYVs10TghHc2vUG9iRFEd7Avez4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=rWalVg1x2I/5RiIinPR0AZg7BnRjkGz9CJCJtnthrY4=; b=oVO+JQm4oyL2r4kX/L+xbgCtpg6QI/MSr2ygqrsa0P5DVGiKVtitpEZvJGz0L6bMOl bRha29WxXm65xCBeAytR9vd1cv8EXzDETKzxqbHbZUq3iOYnc0l6iJrrjL+61Wy7eI3R 2NKPZf/T3exL2fZnzscpL3Y1Z1GaRFi5makQu1xtSvfd126YkaosMaABVHpDdlztQaoI 5vuCaV7JyfamuAm4MDzxh6L44lAwjgaK717qGiLYPT3WMd7wy2Af2mVaO7KYYhRqr/4b 8mqaMK5HGZrLV3Gb2jUE3caSesjtqqv3Gxl26OJReWJifmH6KLvsRuE76iIfOdJEI10V RRqw== X-Gm-Message-State: AHYfb5g3fjEmzPKuZ4jJccmsCB9TMNh+H+dng+4rQEtHq4Sa85kcj3gn OOWrAWU9/M3YsGu+ X-Received: by 10.80.219.133 with SMTP id p5mr4643119edk.104.1502199005746; Tue, 08 Aug 2017 06:30:05 -0700 (PDT) Received: from leoy-ThinkPad-T440 (li524-22.members.linode.com. [176.58.122.22]) by smtp.gmail.com with ESMTPSA id o36sm997924edc.39.2017.08.08.06.30.01 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 08 Aug 2017 06:30:04 -0700 (PDT) Date: Tue, 8 Aug 2017 21:29:55 +0800 From: Leo Yan To: Zhang Rui Cc: Daniel Lezcano , edubezval@gmail.com, "open list:THERMAL" , open list , kong.kongxinwei@hisilicon.com Subject: Re: [PATCH] thermal/drivers/hisi: Remove confusing error message Message-ID: <20170808132955.GB32732@leoy-ThinkPad-T440> References: <1499439833-32531-1-git-send-email-daniel.lezcano@linaro.org> <1502178956.4296.7.camel@intel.com> <46604862-fbb8-8ed1-8b0d-7a51543b3398@linaro.org> <1502196531.4296.41.camel@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1502196531.4296.41.camel@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Aug 08, 2017 at 08:48:51PM +0800, Zhang Rui wrote: [...] > > > > @@ -352,10 +353,9 @@ static int hisi_thermal_probe(struct > > > > platform_device *pdev) > > > >   ret = hisi_thermal_register_sensor(pdev, data, > > > >      &data- > > > > > > > > > > sensors[i], i); > > > >   if (ret) > > > > - dev_err(&pdev->dev, > > > > - "failed to register thermal > > > > sensor: > > > > %d\n", ret); > > > > - else > > > > - hisi_thermal_toggle_sensor(&data- > > > > > > > > > > sensors[i], true); > > > > + continue; > > > > + > > > > + hisi_thermal_toggle_sensor(&data->sensors[i], > > > > true); > > > >   } > > > >   > > > >   return 0; > > > With these removed, is there any other information in dmesg that > > > suggests this failure? > > The problem is there are always failures showed in dmesg. The init > > function is based on the assumption there is HISI_MAX_SENSORS sensors > > which is not true for the hi6220 and that raises at boot time errors. > > > > Why HISI_MAX_SENSORS(=4) while there is only one on hi6220 AFAIK? and > > this driver is only used for hi6220 (now). > > > right, I think we should remove one error log, and then change the > HISI_MAX_SENSORS to reflect the reality instead. > > XinWei and Leo, > can you please help check this? Sure. Here I am a bit confusion and I think this is a common question for SoC thermal driver. Hi6220 does has 4 thermal sensors, but we now only use one sensor of them (thermal sensor id 2) to bind with thermal zone and other three sensors are not bound to any thermal zone. So this is the reason the booting reports the failure. I think changing HISI_MAX_SENSORS value cannot resolve this issue, due we are using thermal id 2. How about below change? We change to use warning for sensors without binding, and remove redundant log. Thanks, Leo Yan diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index 9c3ce34..6d34980 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -260,8 +260,6 @@ static int hisi_thermal_register_sensor(struct platform_device *pdev, if (IS_ERR(sensor->tzd)) { ret = PTR_ERR(sensor->tzd); sensor->tzd = NULL; - dev_err(&pdev->dev, "failed to register sensor id %d: %d\n", - sensor->id, ret); return ret; } @@ -351,7 +349,10 @@ static int hisi_thermal_probe(struct platform_device *pdev) for (i = 0; i < HISI_MAX_SENSORS; ++i) { ret = hisi_thermal_register_sensor(pdev, data, &data->sensors[i], i); - if (ret) + if (ret == -ENODEV) + dev_warn(&pdev->dev, + "thermal sensor %d has not bound\n", i); + else if (ret) dev_err(&pdev->dev, "failed to register thermal sensor: %d\n", ret); else