From: Eduardo Valentin <edubezval@gmail.com>
To: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
Cc: linux-pm@vger.kernel.org,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Khiem Nguyen <khiem.nguyen.xt@renesas.com>,
Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>,
linux-renesas-soc@vger.kernel.org,
Zhang Rui <rui.zhang@intel.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Hien Dang <hien.dang.eb@renesas.com>,
Thao Nguyen <thao.nguyen.yb@rvc.renesas.com>
Subject: Re: [PATCHv5 2/5] thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver
Date: Tue, 13 Dec 2016 20:38:00 -0800 [thread overview]
Message-ID: <20161214043758.GA2765@localhost.localdomain> (raw)
In-Reply-To: <20161213094339.GB24175@bigcity.dyn.berto.se>
hey,
On Tue, Dec 13, 2016 at 10:43:40AM +0100, Niklas Söderlund wrote:
> Hi Eduardo,
>
> Thanks for your feedback. I will skip commenting where Wolfram already
> have.
>
> On 2016-12-12 19:50:54 -0800, Eduardo Valentin wrote:
>
> <snip>
>
> > > +/* Structure for thermal temperature calculation */
> > > +struct equation_coefs {
> > > + int a1;
> > > + int b1;
> > > + int a2;
> > > + int b2;
> >
> > a little description of each coeff would be welcome.
>
> Yes, I too would like to have better documentation of the formulas and
> the meaning of the coefficients.
>
> <snip, Wolfram already covert this>
Ok..
>
> >
> > > +
> > > + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> > > + if (!priv)
> > > + return -ENOMEM;
> > > +
> > > + platform_set_drvdata(pdev, priv);
> > > +
> > > + pm_runtime_enable(dev);
> > > + pm_runtime_get_sync(dev);
> > > +
> > > + for (i = 0; i < TSC_MAX_NUM; i++) {
> > > + struct rcar_gen3_thermal_tsc *tsc;
> > > +
> > > + tsc = devm_kzalloc(dev, sizeof(*tsc), GFP_KERNEL);
> > > + if (!tsc) {
> > > + ret = -ENOMEM;
> > > + goto error_unregister;
> > > + }
> > > +
> > > + res = platform_get_resource(pdev, IORESOURCE_MEM, i);
> > > + if (!res)
> > > + break;
> > > +
> > > + tsc->base = devm_ioremap_resource(dev, res);
> > > + if (IS_ERR(tsc->base)) {
> > > + ret = PTR_ERR(tsc->base);
> > > + goto error_unregister;
> > > + }
> > > +
> > > + priv->tscs[i] = tsc;
> > > + mutex_init(&tsc->lock);
> > > +
> > > + match_data->thermal_init(tsc);
> > > + rcar_gen3_thermal_calc_coefs(&tsc->coef, ptat, thcode[i]);
> >
> > oh, the thcode's are currently not read then?
>
> No as Wolfram commented, reading THCODE and PTAT from hardware is not
> possible on the boards we have to test on so I think this needs to be
> added once we can test it. Do you agree this is the best option?
I agree here. I was under the impression that would be both types of
chips out there, with and without thcode. But looks like, at the end,
only a few engineers will have access to those without it, right?
If you still think those without the support need right support, I would
suggest moving the hardcoded values to DT. Specially if those hardcoded
values change across chip version (so you can better describe using DT).
But, in case you think this population of chips wont grow, then might be
ok to keep the way it is, even though looks not so nice in the code :-).
next prev parent reply other threads:[~2016-12-14 4:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-12 14:18 [PATCHv5 0/5] thermal: add driver for R-Car Gen3 Niklas Söderlund
2016-12-12 14:18 ` [PATCHv5 1/5] thermal: rcar_gen3_thermal: Document the " Niklas Söderlund
2016-12-12 14:18 ` [PATCHv5 2/5] thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver Niklas Söderlund
2016-12-12 21:45 ` Wolfram Sang
2016-12-13 8:25 ` Geert Uytterhoeven
2016-12-13 8:39 ` Wolfram Sang
2016-12-13 10:07 ` Niklas Söderlund
2016-12-13 3:50 ` Eduardo Valentin
2016-12-13 5:38 ` Wolfram Sang
2016-12-13 9:43 ` Niklas Söderlund
2016-12-14 4:38 ` Eduardo Valentin [this message]
2016-12-13 8:19 ` Geert Uytterhoeven
2016-12-13 9:53 ` Niklas Söderlund
2016-12-13 10:09 ` Geert Uytterhoeven
2016-12-12 14:18 ` [PATCHv5 3/5] arm64: dts: r8a7795: Add R-Car Gen3 thermal support Niklas Söderlund
2016-12-12 14:18 ` [PATCHv5 4/5] arm64: dts: r8a7796: " Niklas Söderlund
2016-12-12 14:18 ` [PATCHv5 5/5] thermal: rcar_gen3_thermal: Add delay in .thermal_init on r8a7795 Niklas Söderlund
2016-12-13 3:31 ` Eduardo Valentin
2016-12-13 9:15 ` Niklas Söderlund
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=20161214043758.GA2765@localhost.localdomain \
--to=edubezval@gmail.com \
--cc=geert@linux-m68k.org \
--cc=hien.dang.eb@renesas.com \
--cc=khiem.nguyen.xt@renesas.com \
--cc=kuninori.morimoto.gx@gmail.com \
--cc=linux-pm@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=niklas.soderlund@ragnatech.se \
--cc=rui.zhang@intel.com \
--cc=thao.nguyen.yb@rvc.renesas.com \
--cc=wsa+renesas@sang-engineering.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).