From: Sascha Hauer <s.hauer@pengutronix.de>
To: Javi Merino <javi.merino@arm.com>
Cc: Eduardo Valentin <edubezval@gmail.com>,
mark.rutland@arm.com, devicetree@vger.kernel.org,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
robh+dt@kernel.org, linux-mediatek@lists.infradead.org,
kernel@pengutronix.de, Matthias Brugger <matthias.bgg@gmail.com>,
Zhang Rui <rui.zhang@intel.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/3] thermal: Add Mediatek thermal controller support
Date: Wed, 18 Nov 2015 09:18:11 +0100 [thread overview]
Message-ID: <20151118081811.GW8526@pengutronix.de> (raw)
In-Reply-To: <20151113112636.GA12760@e104805>
On Fri, Nov 13, 2015 at 11:26:37AM +0000, Javi Merino wrote:
> On Fri, Nov 13, 2015 at 11:09:12AM +0100, Sascha Hauer wrote:
> > On Wed, Nov 11, 2015 at 08:27:47AM +0100, Sascha Hauer wrote:
> > > On Tue, Nov 10, 2015 at 10:26:30AM -0800, Eduardo Valentin wrote:
> > > > On Tue, Nov 10, 2015 at 12:05:54PM +0000, Javi Merino wrote:
> > > > > On Mon, Nov 09, 2015 at 11:13:32AM +0100, Sascha Hauer wrote:
> > > >
> > > > <cut>
> > > >
> > > > > > +
> > > > > > +/*
> > > > > > + * The MT8173 thermal controller has four banks. Each bank can read up to
> > > > > > + * four temperature sensors simultaneously. The MT8173 has a total of 5
> > > > > > + * temperature sensors. We use each bank to measure a certain area of the
> > > > > > + * SoC. Since TS2 is located centrally in the SoC it is influenced by multiple
> > > > > > + * areas, hence is used in different banks.
> > > > > > + */
> > > > > > +static const struct mtk_thermal_bank_cfg bank_data[] = {
> > > > > > + {
> > > > > > + .num_sensors = 2,
> > > > > > + .sensors = { MT8173_TS2, MT8173_TS3 },
> > > > > > + }, {
> > > > > > + .num_sensors = 2,
> > > > > > + .sensors = { MT8173_TS2, MT8173_TS4 },
> > > > > > + }, {
> > > > > > + .num_sensors = 3,
> > > > > > + .sensors = { MT8173_TS1, MT8173_TS2, MT8173_TSABB },
> > > > > > + }, {
> > > > > > + .num_sensors = 1,
> > > > > > + .sensors = { MT8173_TS2 },
> > > > > > + },
> > > > > > +};
> > > >
> > > > Would it make sense to simply expose all sensors and let the
> > > > configuration of their aggregation be done by DT?
> > >
> > > This particular layout has been chosen because there's also the Smart
> > > Voltage Scaler (SVS) in the SoC. The SVS uses the same banks for
> > > measuring temperatures. I don't know the details yet, I just asked the
> > > Mediatek guys.
> >
> > Ok, the job of the SVS is to always pick the best voltage for a given
> > CPU frequency based on the temperature of the CPU cluster. How I
> > understand it the SVS engine automatically reads temperatures from bank0
> > for the first CPU cluster and from bank1 for the second CPU cluster. For
> > this to work we are not free to assign the sensors to the banks
> > arbitrarily.
> >
> > I was told that controlling the CPU frequency the performance is better
> > if we use the maximum temperature of the whole die rather than the
> > temperature of individual clusters.
> >
> > I would prefer to keep the sensor/bank association like it currently is
> > as it allows for easy SVS engine integration. Also I would prefer to
> > expose a single thermal zone for now, it will be easier to add
> > additional zones later than it is to remove them later once we have
> > exposed them to the device tree.
> >
> > Is that ok with you?
>
> Fair enough. I agree that it's easier to add thermal zones in the
> future than to remove it. Thanks for the explanation.
I added this comment to make this a bit clearer for the next version:
/*
* The thermal core only gets the maximum temperature of all banks, so
* the bank concept wouldn't be necessary here. However, the SVS (Smart
* Voltage Scaling) unit makes its decisions based on the same bank
* data, and this indeed needs the temperatures of the individual
* banks
* for making better decisions.
*/
--
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 |
next prev parent reply other threads:[~2015-11-18 8:18 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 10:13 [PATCH v10] Add Mediatek thermal support Sascha Hauer
[not found] ` <1447064013-13026-1-git-send-email-s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-11-09 10:13 ` [PATCH 1/3] dt-bindings: thermal: Add binding document for Mediatek thermal controller Sascha Hauer
2015-11-09 15:59 ` Rob Herring
2015-11-09 10:13 ` [PATCH 2/3] thermal: Add Mediatek thermal controller support Sascha Hauer
2015-11-09 14:39 ` Andy Shevchenko
[not found] ` <CAHp75VcSvoUt46tobRrWJ_etbLEasA1cyoJVnhjdzMegtGTugA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-18 8:11 ` Sascha Hauer
2015-11-10 12:05 ` Javi Merino
2015-11-10 18:26 ` Eduardo Valentin
2015-11-11 7:27 ` Sascha Hauer
[not found] ` <20151111072747.GI8526-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-11-11 9:40 ` Javi Merino
2015-11-13 10:09 ` Sascha Hauer
2015-11-13 11:26 ` Javi Merino
2015-11-18 8:18 ` Sascha Hauer [this message]
2015-11-09 10:13 ` [PATCH 3/3] ARM64: dts: mt8173: Add thermal/auxadc device nodes Sascha Hauer
-- strict thread matches above, loose matches on Subject: below --
2015-09-23 13:37 [PATCH v9] Add Mediatek thermal support Sascha Hauer
2015-09-23 13:37 ` [PATCH 2/3] thermal: Add Mediatek thermal controller support Sascha Hauer
[not found] ` <1443015463-23639-3-git-send-email-s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-09-23 18:31 ` Vladimir Zapolskiy
2015-09-30 6:14 ` Sascha Hauer
2015-09-29 23:04 ` Eduardo Valentin
2015-09-30 6:13 ` Sascha Hauer
2015-09-30 9:36 ` Punit Agrawal
2015-09-30 10:37 ` Sascha Hauer
2015-09-30 11:07 ` Punit Agrawal
2015-08-31 7:34 [PATCH v8] Add Mediatek thermal support Sascha Hauer
[not found] ` <1441006446-4558-1-git-send-email-s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-08-31 7:34 ` [PATCH 2/3] thermal: Add Mediatek thermal controller support Sascha Hauer
2015-09-14 7:32 ` Daniel Kurtz
2015-09-22 7:30 ` Daniel Kurtz
2015-09-22 8:30 ` Sascha Hauer
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=20151118081811.GW8526@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=devicetree@vger.kernel.org \
--cc=edubezval@gmail.com \
--cc=javi.merino@arm.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=robh+dt@kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).