Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1236108

Re: [PATCH 2/3] thermal: Add Mediatek thermal controller support

From Sascha Hauer <s.hauer@pengutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3] thermal: Add Mediatek thermal controller support
Date 2015-09-30 12:40 +0200
Message-ID <qemXO-2nj-65@gated-at.bofh.it> (permalink)
References <qbSr8-5Br-3@gated-at.bofh.it> <qbSr8-5Br-1@gated-at.bofh.it> <qem1H-Zq-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Punit,

On Wed, Sep 30, 2015 at 10:36:14AM +0100, Punit Agrawal wrote:
> Hi Sascha,
> 
> Re-posting a comment from v7. Perhaps you missed it...

Uh, sorry. In fact I didn't miss it and I thought I have answered it.
Appearantly I haven't.

> > +	struct mtk_thermal *mt = bank->mt;
> > +	int temp, i, max;
> > +	u32 raw;
> > +
> > +	temp = max = INT_MIN;
> > +
> > +	for (i = 0; i < bank_data[bank->id].num_sensors; i++) {
> > +		raw = readl(mt->thermal_base + sensing_points[i].msr);
> > +
> > +		temp = raw_to_mcelsius(mt, raw);
> > +
> > +		/*
> > +		 * The first read of a sensor often contains very high bogus
> > +		 * temperature value. Filter these out so that the system does
> > +		 * not immediately shut down.
> > +		 */
> > +		if (temp > 200000)
> > +			temp = 0;
> > +
> 
> If the bogus value is only the first time the sensor is read, instead of
> filtering here, you could call mtk_thermal_bank_temperature at probe
> time when you are initialising the banks and ignore the returned value.

It seems that after initialization the hardware needs some time to
settle before correct values can be read. Doing what you suggest would
mean we have to delay the boot by several 100ms. I'd rather not do that.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v9] Add Mediatek thermal support Sascha Hauer <s.hauer@pengutronix.de> - 2015-09-23 15:40 +0200
  [PATCH 2/3] thermal: Add Mediatek thermal controller support Sascha Hauer <s.hauer@pengutronix.de> - 2015-09-23 15:40 +0200
    Re: [PATCH 2/3] thermal: Add Mediatek thermal controller support Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> - 2015-09-23 20:40 +0200
      Re: [PATCH 2/3] thermal: Add Mediatek thermal controller support Sascha Hauer <s.hauer@pengutronix.de> - 2015-09-30 08:20 +0200
    Re: [PATCH 2/3] thermal: Add Mediatek thermal controller support Eduardo Valentin <edubezval@gmail.com> - 2015-09-30 01:10 +0200
      Re: [PATCH 2/3] thermal: Add Mediatek thermal controller support Sascha Hauer <s.hauer@pengutronix.de> - 2015-09-30 08:20 +0200
    Re: [PATCH 2/3] thermal: Add Mediatek thermal controller support Punit Agrawal <punit.agrawal@arm.com> - 2015-09-30 11:40 +0200
      Re: [PATCH 2/3] thermal: Add Mediatek thermal controller support Sascha Hauer <s.hauer@pengutronix.de> - 2015-09-30 12:40 +0200
        Re: [PATCH 2/3] thermal: Add Mediatek thermal controller support Punit Agrawal <punit.agrawal@arm.com> - 2015-09-30 13:10 +0200
  [PATCH 1/3] dt-bindings: thermal: Add binding document for Mediatek thermal controller Sascha Hauer <s.hauer@pengutronix.de> - 2015-09-23 15:40 +0200
  [PATCH 3/3] ARM64: dts: mt8173: Add thermal/auxadc device nodes Sascha Hauer <s.hauer@pengutronix.de> - 2015-09-23 15:40 +0200

csiph-web