Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp559770ybt; Wed, 8 Jul 2020 06:30:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx28Bd6uT7Dwc9I50JwhpRBXo+E4ob79sZM6jMSECaaZScCNldy85l0e3DPVfbHuDbuHQT4 X-Received: by 2002:a17:906:6d15:: with SMTP id m21mr50446254ejr.209.1594215049377; Wed, 08 Jul 2020 06:30:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594215049; cv=none; d=google.com; s=arc-20160816; b=LXXx+E6LFvLlxN6ZIM/u4uI8Nx+vdl7mK4DTokWlZj5yzPQbtcg7VctTPLVdzB4fiz REnO6HYmszDlzsm7MVWsfHWLW8RLmjWrU3dLvwlCSMoZyio1d0rpgf8Fr2q524EV9uon aGrnL500SWcp5gKV3UbhVmunF77hdwkL7m3YS0KfwLAfdTKpEXI820sx4Ey094e+Tmnv zQpjXEwzJ4yrnq1NtNGpneZPTwzO5l8TfWPVecaOLvrsuYNBaOOWjOuN8/1mUQGC3hMg opNR76/RgEXunVl0iiWtX9KdwQWFXRAaBMknb3IhPv6cEiqbMh1IrnAD5tJKJ+wB5LNl qpag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:dkim-signature; bh=67YIQldc9TEW/s+NtwXtqBpOOEGCgGZ6RDnOazmvXl4=; b=o+lEOFID+2JomCcnhLmpp0QzOejs/CZX8ncUdb+2vFFNg92fWxRrjNjIyukPH2qYG/ UAF01eu8vWpu/0DIK/0MvIDIXchVjVapdTEHmZnxLr49SzvMPW+Nvnj5qV1/qGx73ws2 GSaKiDs3ONDixsMB4OpHLQURJrLrZ2G3yAa2MwVL2ozIvrSlWLMUJQcCN49A47Kds48V seT0X3sDlGG1I0xwDbavVPg1s9ZhgPV/1crfQ908cZtXTlcCiXlszXZLabyyuXI2EcsQ WUCYBAtOU3EnL3CP/zF8OH/H4KqAGLE2ggQ4TSeA7SdpVWxLZDlvkhfxp+8ZbajY8BUt 1TAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=JJlJUi+b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx20si17018402edb.568.2020.07.08.06.30.25; Wed, 08 Jul 2020 06:30:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=JJlJUi+b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729366AbgGHN31 (ORCPT + 99 others); Wed, 8 Jul 2020 09:29:27 -0400 Received: from vps.xff.cz ([195.181.215.36]:51668 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728148AbgGHN30 (ORCPT ); Wed, 8 Jul 2020 09:29:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1594214964; bh=8N9bH83BZfSgEFYUIHwb06OwlfkSojJ4iISr/5Xqob8=; h=Date:From:To:Cc:Subject:References:X-My-GPG-KeyId:From; b=JJlJUi+bNmDQomRx+37m/rE4iJQhTBtYpUFCn4VDLVeJuxyyu3V3dBpWxiX8cBRLN GgSx5w2iaOnOryftkEVBYBM4d43Bd90Oh/868O3SxJipxc1VLXg+T4aJznBM9PNZfT wt3JZfK9taYEOvEKkjI4nL65UZvJ2dvgkVj/M0N0= Date: Wed, 8 Jul 2020 15:29:24 +0200 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: Maxime Ripard Cc: linux-sunxi@googlegroups.com, Vasily Khoruzhick , Yangtao Li , Zhang Rui , Daniel Lezcano , Amit Kucheria , Chen-Yu Tsai , "open list:ALLWINNER THERMAL DRIVER" , "moderated list:ARM/Allwinner sunXi SoC support" , open list Subject: Re: [PATCH] thermal: sun8i: Be loud when probe fails Message-ID: <20200708132924.r6f5id2evprhybec@core.my.home> Mail-Followup-To: =?utf-8?Q?Ond=C5=99ej?= Jirman , Maxime Ripard , linux-sunxi@googlegroups.com, Vasily Khoruzhick , Yangtao Li , Zhang Rui , Daniel Lezcano , Amit Kucheria , Chen-Yu Tsai , "open list:ALLWINNER THERMAL DRIVER" , "moderated list:ARM/Allwinner sunXi SoC support" , open list References: <20200708105527.868987-1-megous@megous.com> <20200708122542.73o3lbhgvbdw5c4z@gilmour.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200708122542.73o3lbhgvbdw5c4z@gilmour.lan> X-My-GPG-KeyId: EBFBDDE11FB918D44D1F56C1F9F0A873BE9777ED Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Maxime, On Wed, Jul 08, 2020 at 02:25:42PM +0200, Maxime Ripard wrote: > Hi, > > On Wed, Jul 08, 2020 at 12:55:27PM +0200, Ondrej Jirman wrote: > > I noticed several mobile Linux distributions failing to enable the > > thermal regulation correctly, because the kernel is silent > > when thermal driver fails to probe. Add enough error reporting > > to debug issues and warn users in case thermal sensor is failing > > to probe. > > > > Failing to notify users means, that SoC can easily overheat under > > load. > > > > Signed-off-by: Ondrej Jirman > > --- > > drivers/thermal/sun8i_thermal.c | 55 ++++++++++++++++++++++++++------- > > 1 file changed, 43 insertions(+), 12 deletions(-) > > > > diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c > > index 74d73be16496..9065e79ae743 100644 > > --- a/drivers/thermal/sun8i_thermal.c > > +++ b/drivers/thermal/sun8i_thermal.c > > @@ -287,8 +287,12 @@ static int sun8i_ths_calibrate(struct ths_device *tmdev) > > > > calcell = devm_nvmem_cell_get(dev, "calibration"); > > if (IS_ERR(calcell)) { > > + dev_err(dev, "Failed to get calibration nvmem cell (%ld)\n", > > + PTR_ERR(calcell)); > > + > > if (PTR_ERR(calcell) == -EPROBE_DEFER) > > return -EPROBE_DEFER; > > + > > The rest of the patch makes sense, but we should probably put the error > message after the EPROBE_DEFER return so that we don't print any extra > noise that isn't necessarily useful I thought about that, but in this case this would have helped, see my other e-mail. Though lack of "probe success" message may be enough for me, to debug the issue, I'm not sure the user will notice that a message is missing, while he'll surely notice if there's a flood of repeated EPROBE_DEFER messages. And people run several distros for 3-4 months without anyone noticing any issues and that thermal regulation doesn't work. So it seems that lack of a success message is not enough. Other solution may be to select CONFIG_NVMEM_SUNXI_SID if this driver is enabled. That may get rid of this error scenario of waiting infinitely for calibration data with EPROBE_DEFER. And other potential EPROBE_DEFER sources will probably be quite visible even without this driver telling the user. So this message may not be necessary in that case. thank you and regards, o. > Maxime