Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp572536ybt; Wed, 8 Jul 2020 06:47:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzafdpRKg5ZLZR7yjJPNjviKiyM0qZshHF4GiNySh19bbcPQWGvg5LcxHaIt4KFaTKhfFFW X-Received: by 2002:a17:906:7c54:: with SMTP id g20mr52956934ejp.460.1594216045901; Wed, 08 Jul 2020 06:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594216045; cv=none; d=google.com; s=arc-20160816; b=maGHR1nROtVw1kO8k4qZ6PR4EFNNzM/wg4xR08xbKkHLTWqw9/JSdiMjofBoh7VW6E xB/Hi23ZCgB1OlBmfLjlBaZLMrAtN3rTg/lGNGJYWPGH4C6pDMOVKl5zbEArIrueuUHW QB83T0pwAAo++SX6Ig1RZcV8vyhw1CYwDxcePUmYfI3dp3wu+p/KKUTFrMzS53J/cDg+ Bc2+lDpgxtsTaOxqQ01lpj3wlA3iih/7ENahBAATUB72FxLvNwMtg4G6iuaQtp3sK/7Q O5THjkE6w21rIN6VVqBtjkZPP9hSmVImpK031Tlh/QkxCc9isAw42XY80elE580qd+4t lyvA== 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-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=SknBaqxAJS0NxplCtVAW1bVW61krBYbFkqU4ejMFQkM=; b=YjXh3yyXAkDTo9bwEI+2JTsLtOnYKUKp+OVtIRAWD/3ve10IdIZwjP6s+cw3P/C40+ 9fVnn7ywOfNKRIpaRD5PnXVCwHCRp/f++SLXx4hL+BDxwxsyEHm+xovhFOi/A2rfxBZA tL+Gqh7mh3BWeSQAzaSogbmm9NER8u04ox+dNxokFFhYArZry+LIeiiOkTgXV/X6g9hm HIx7CRjwt+gJ76NTY/znEZ1O7XsWE8qxIu8+Hqnd3jOpIYrp4lGrIgQpRUYRZkofhrHr ttvscxJeHvbYJVKX4qyHVw5WI5Kgu8VolMYmRShkzj5spcCsS6sQjkGqto8ol4FnWo/v fBow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=V9fWo4fu; 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 mj26si16528919ejb.416.2020.07.08.06.47.02; Wed, 08 Jul 2020 06:47:25 -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=V9fWo4fu; 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 S1729468AbgGHNoo (ORCPT + 99 others); Wed, 8 Jul 2020 09:44:44 -0400 Received: from vps.xff.cz ([195.181.215.36]:52146 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729288AbgGHNoo (ORCPT ); Wed, 8 Jul 2020 09:44:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1594215881; bh=m5N5EKsEYiWdipmJshuL2ZNQFzFFa5BIjVuaSql6fQU=; h=Date:From:To:Cc:Subject:References:X-My-GPG-KeyId:From; b=V9fWo4fub+/jaUPMFn1CZ3J/auzdwkPbCVuj6tjqtv3mA1VTW2crqFCRhc7itDvTK cOgfo/pd3fqAHXsv2MNzYSiLg9wbKcYB+trS13XAwUeH+bszFw7r74hzcR6dkrxJD7 Lx6RWlQU5gr8TnS46u4hlIQPoSasdJPxT20oZLdQ= Date: Wed, 8 Jul 2020 15:44:41 +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: <20200708134441.4lfuh7nwtqnkkg2a@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> <20200708132924.r6f5id2evprhybec@core.my.home> <20200708133654.fp7k4whl2qmn5ygy@gilmour.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200708133654.fp7k4whl2qmn5ygy@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 On Wed, Jul 08, 2020 at 03:36:54PM +0200, Maxime Ripard wrote: > On Wed, Jul 08, 2020 at 03:29:24PM +0200, Ondřej Jirman wrote: > > 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. > > Yeah, but on the other hand, we regularly have people that come up and > ask if a "legitimate" EPROBE_DEFER error message (as in: the driver > wasn't there on the first attempt but was there on the second) is a > cause of concern or not. That's why I also added a success message, to distinguish this case. > > 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. > > I understand what the issue is, but do you really expect phone users to > monitor the kernel logs every time they boot their phone to see if the > thermal throttling is enabled? Not phone users, but people making their own kernels/distributions. Those people monitor dmesg, and out of 4 distros or more nobody noticed there was an issue (despite the complaints of overheating by their users). So I thought some warning may be in order, so that distro people more easily notice they have misconfigured the kernel or sometging. End users really don't care about dmesg. regards, o. > If anything, it looks like a distro problem, and the notification / > policy to deal with that should be implemented in userspace. > > > 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. > > That would only partially solve your issue. If the nvmem driver doesn't > load for some reason, you would end up in a similar situation. > > Maxime