public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Eduardo Valentin <edubezval@gmail.com>,
	Zhang Rui <rui.zhang@intel.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Kukjin Kim <kgene@kernel.org>,
	linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [PATCH 02/14] thermal: exynos: Propagate error value from tmu_read()
Date: Mon, 16 Apr 2018 15:02:50 +0200	[thread overview]
Message-ID: <1533276.iHnOBFtKQV@amdc3058> (raw)
In-Reply-To: <4123d3bb-408f-b0c0-43c3-862e93f4907a@linaro.org>

On Monday, April 16, 2018 02:54:01 PM Daniel Lezcano wrote:
> On 16/04/2018 14:49, Bartlomiej Zolnierkiewicz wrote:
> > On Monday, April 16, 2018 02:41:48 PM Daniel Lezcano wrote:
> >> On 16/04/2018 14:35, Bartlomiej Zolnierkiewicz wrote:
> >>> On Monday, April 16, 2018 02:16:56 PM Daniel Lezcano wrote:
> >>>> On 16/04/2018 12:11, Bartlomiej Zolnierkiewicz wrote:
> >>>>> From: Marek Szyprowski <m.szyprowski@samsung.com>
> >>>>>
> >>>>> tmu_read() in case of Exynos4210 might return error for out of bound
> >>>>> values. Current code ignores such value, what leads to reporting critical
> >>>>> temperature value. Add proper error code propagation to exynos_get_temp()
> >>>>> function.
> >>>>
> >>>> For me the comment in the function exynos4210_tmu_read
> >>>>
> >>>> /* "temp_code" should range between 75 and 175 */
> >>>>
> >>>> ... is strange. I would double check this assertion before dealing with
> >>>> the error value.
> >>>
> >>> static int exynos4210_tmu_read(struct exynos_tmu_data *data)
> >>> {
> >>> 	int ret = readb(data->base + EXYNOS_TMU_REG_CURRENT_TEMP);
> >>>
> >>> 	/* "temp_code" should range between 75 and 175 */
> >>> 	return (ret < 75 || ret > 175) ? -ENODATA : ret;
> >>> }
> >>>
> >>
> >> But I don't get why it *should* ?
> > 
> > Because of hardware design.
> > 
> >> Shouldn't be the same with the 4412, it seems having the same sensor, no?
> > 
> > Probably same limitations apply to all SoCs (Exynos4412 has very similar
> > sensor) but the driver currently lacks the needed checks for them (it is
> > on TODO but other things have higher priority).
> 
> 
> I understand. Why the other boards are not reporting a critical value?

->tmu_read methods for other SoCs currently lack hardware limitations
checking so they don't return negative values (which before fix was passed
to code_to_temp() unchecked and was mapped to critical temperature value).

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

  reply	other threads:[~2018-04-16 13:03 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180416101225epcas2p42e345645d822cd869dbdb449becf1c7a@epcas2p4.samsung.com>
2018-04-16 10:11 ` [PATCH 00/14] thermal: exynos: pending fixes and cleanups Bartlomiej Zolnierkiewicz
2018-04-16 10:11   ` [PATCH 01/14] thermal: exynos: Reading temperature makes sense only when TMU is turned on Bartlomiej Zolnierkiewicz
2018-04-16 12:06     ` Daniel Lezcano
2018-04-16 12:17       ` Bartlomiej Zolnierkiewicz
2018-04-16 12:39         ` Daniel Lezcano
2018-04-16 10:11   ` [PATCH 02/14] thermal: exynos: Propagate error value from tmu_read() Bartlomiej Zolnierkiewicz
2018-04-16 12:16     ` Daniel Lezcano
2018-04-16 12:35       ` Bartlomiej Zolnierkiewicz
2018-04-16 12:41         ` Daniel Lezcano
2018-04-16 12:49           ` Bartlomiej Zolnierkiewicz
2018-04-16 12:54             ` Daniel Lezcano
2018-04-16 13:02               ` Bartlomiej Zolnierkiewicz [this message]
2018-04-16 10:11   ` [PATCH 03/14] thermal: exynos: Read soc_type from match data Bartlomiej Zolnierkiewicz
2018-04-16 12:19     ` Daniel Lezcano
2018-04-16 12:41       ` Bartlomiej Zolnierkiewicz
2018-04-16 12:47         ` Daniel Lezcano
2018-04-16 10:11   ` [PATCH 04/14] thermal: exynos: remove unused "type" field from struct exynos_tmu_platform_data Bartlomiej Zolnierkiewicz
2018-04-16 12:50     ` Daniel Lezcano
2018-04-16 10:11   ` [PATCH 05/14] thermal: exynos: remove parsing of samsung,tmu_default_temp_offset property Bartlomiej Zolnierkiewicz
2018-04-16 12:55     ` Daniel Lezcano
2018-04-16 10:11   ` [PATCH 06/14] thermal: exynos: remove parsing of samsung,tmu_[first,second]_point_trim properties Bartlomiej Zolnierkiewicz
2018-04-16 12:57     ` Daniel Lezcano
2018-04-16 10:11   ` [PATCH 07/14] thermal: exynos: remove parsing of samsung,tmu_noise_cancel_mode property Bartlomiej Zolnierkiewicz
2018-04-16 13:03     ` Daniel Lezcano
2018-04-16 10:11   ` [PATCH 08/14] thermal: exynos: remove parsing of samsung,tmu[_min,_max]_efuse_value properties Bartlomiej Zolnierkiewicz
2018-04-16 13:15     ` Daniel Lezcano
2018-04-16 10:12   ` [PATCH 09/14] thermal: exynos: remove parsing of samsung,tmu_reference_voltage property Bartlomiej Zolnierkiewicz
2018-04-16 13:16     ` Daniel Lezcano
2018-04-16 10:12   ` [PATCH 10/14] thermal: exynos: remove parsing of samsung,tmu_gain property Bartlomiej Zolnierkiewicz
2018-04-16 13:18     ` Daniel Lezcano
2018-04-16 10:12   ` [PATCH 11/14] thermal: exynos: remove parsing of samsung,tmu_cal_type property Bartlomiej Zolnierkiewicz
2018-04-16 13:19     ` Daniel Lezcano
2018-04-16 10:12   ` [PATCH 12/14] thermal: exynos: remove separate exynos_tmu.h header file Bartlomiej Zolnierkiewicz
2018-04-16 13:24     ` Daniel Lezcano
2018-04-16 14:24       ` Bartlomiej Zolnierkiewicz
2018-04-16 10:12   ` [PATCH 13/14] ARM: dts: exynos: remove no longer needed samsung thermal properties Bartlomiej Zolnierkiewicz
2018-04-16 12:16     ` Krzysztof Kozlowski
2018-06-20 19:17     ` Krzysztof Kozlowski
2018-04-16 10:12   ` [PATCH 14/14] arm64: " Bartlomiej Zolnierkiewicz
2018-04-16 13:02     ` Daniel Lezcano
2018-04-16 13:09       ` Bartlomiej Zolnierkiewicz
2018-04-16 13:10         ` Daniel Lezcano
2018-06-20 19:19     ` Krzysztof Kozlowski

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=1533276.iHnOBFtKQV@amdc3058 \
    --to=b.zolnierkie@samsung.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=edubezval@gmail.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=rui.zhang@intel.com \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox