From: Maxime Ripard <maxime@cerno.tech> To: "Ondřej Jirman" <megous@megous.com>, linux-sunxi@googlegroups.com, "Vasily Khoruzhick" <anarsoul@gmail.com>, "Yangtao Li" <tiny.windzz@gmail.com>, "Zhang Rui" <rui.zhang@intel.com>, "Daniel Lezcano" <daniel.lezcano@linaro.org>, "Amit Kucheria" <amit.kucheria@verdurent.com>, "Chen-Yu Tsai" <wens@csie.org>, "open list:ALLWINNER THERMAL DRIVER" <linux-pm@vger.kernel.org>, "moderated list:ARM/Allwinner sunXi SoC support" <linux-arm-kernel@lists.infradead.org>, "open list" <linux-kernel@vger.kernel.org> Subject: Re: [PATCH] thermal: sun8i: Be loud when probe fails Date: Wed, 8 Jul 2020 15:36:54 +0200 [thread overview] Message-ID: <20200708133654.fp7k4whl2qmn5ygy@gilmour.lan> (raw) In-Reply-To: <20200708132924.r6f5id2evprhybec@core.my.home> 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 <megous@megous.com> > > > --- > > > 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. > 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? 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
WARNING: multiple messages have this Message-ID (diff)
From: Maxime Ripard <maxime@cerno.tech> To: "Ondřej Jirman" <megous@megous.com>, linux-sunxi@googlegroups.com, "Vasily Khoruzhick" <anarsoul@gmail.com>, "Yangtao Li" <tiny.windzz@gmail.com>, "Zhang Rui" <rui.zhang@intel.com>, "Daniel Lezcano" <daniel.lezcano@linaro.org>, "Amit Kucheria" <amit.kucheria@verdurent.com>, "Chen-Yu Tsai" <wens@csie.org>, "open list:ALLWINNER THERMAL DRIVER" <linux-pm@vger.kernel.org>, "moderated list:ARM/Allwinner sunXi SoC support" <linux-arm-kernel@lists.infradead.org>, "open list" <linux-kernel@vger.kernel.org> Subject: Re: [PATCH] thermal: sun8i: Be loud when probe fails Date: Wed, 8 Jul 2020 15:36:54 +0200 [thread overview] Message-ID: <20200708133654.fp7k4whl2qmn5ygy@gilmour.lan> (raw) In-Reply-To: <20200708132924.r6f5id2evprhybec@core.my.home> 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 <megous@megous.com> > > > --- > > > 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. > 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? 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-07-08 13:37 UTC|newest] Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-08 10:55 [PATCH] thermal: sun8i: Be loud when probe fails Ondrej Jirman 2020-07-08 10:55 ` Ondrej Jirman 2020-07-08 11:03 ` Russell King - ARM Linux admin 2020-07-08 11:03 ` Russell King - ARM Linux admin 2020-07-08 11:10 ` Ondřej Jirman 2020-07-08 11:10 ` Ondřej Jirman 2020-07-20 7:55 ` Icenowy Zheng 2020-07-20 7:55 ` Icenowy Zheng 2020-07-20 8:28 ` Russell King - ARM Linux admin 2020-07-20 8:28 ` Russell King - ARM Linux admin 2020-07-08 11:55 ` Frank Lee 2020-07-08 11:55 ` Frank Lee 2020-07-08 13:21 ` Ondřej Jirman 2020-07-08 13:21 ` Ondřej Jirman 2020-07-08 13:42 ` Robin Murphy 2020-07-08 13:42 ` Robin Murphy 2020-07-08 13:33 ` Ondřej Jirman 2020-07-08 13:33 ` Ondřej Jirman 2020-07-08 12:25 ` Maxime Ripard 2020-07-08 12:25 ` Maxime Ripard 2020-07-08 13:29 ` Ondřej Jirman 2020-07-08 13:29 ` Ondřej Jirman 2020-07-08 13:36 ` Maxime Ripard [this message] 2020-07-08 13:36 ` Maxime Ripard 2020-07-08 13:44 ` Ondřej Jirman 2020-07-08 13:44 ` Ondřej Jirman 2020-07-08 13:57 ` Maxime Ripard 2020-07-08 13:57 ` Maxime Ripard 2020-07-12 23:29 ` Ondřej Jirman 2020-07-12 23:29 ` Ondřej Jirman 2020-07-23 15:20 ` Maxime Ripard 2020-07-23 15:20 ` Maxime Ripard 2020-07-08 13:29 ` Maxime Ripard 2020-07-08 13:29 ` Maxime Ripard
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200708133654.fp7k4whl2qmn5ygy@gilmour.lan \ --to=maxime@cerno.tech \ --cc=amit.kucheria@verdurent.com \ --cc=anarsoul@gmail.com \ --cc=daniel.lezcano@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-pm@vger.kernel.org \ --cc=linux-sunxi@googlegroups.com \ --cc=megous@megous.com \ --cc=rui.zhang@intel.com \ --cc=tiny.windzz@gmail.com \ --cc=wens@csie.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.