All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <l.majewski@samsung.com>
To: Abhilash Kesavan <kesavan.abhilash@gmail.com>
Cc: Eduardo Valentin <edubezval@gmail.com>,
	Zhang Rui <rui.zhang@intel.com>,
	Kukjin Kim <kgene.kim@samsung.com>, Kukjin Kim <kgene@kernel.org>,
	Linux PM list <linux-pm@vger.kernel.org>,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Lukasz Majewski <l.majewski@majess.pl>,
	Amit Daniel Kachhap <amit.daniel@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>
Subject: Re: [PATCH 1/2] thermal: exynos: Reorder exynos_map_dt_data() function
Date: Thu, 22 Jan 2015 10:01:24 +0100	[thread overview]
Message-ID: <20150122100124.65e7a19e@amdc2363> (raw)
In-Reply-To: <CAM4voakDBLbshW3EvFN4YRx1o1ApMLJVZ2ZQ0Bb6NwhmoT8WFA@mail.gmail.com>

Hi Abhilash,

> Hi Lukasz,
> 
> On Mon, Jan 19, 2015 at 5:14 PM, Lukasz Majewski
> <l.majewski@samsung.com> wrote:
> > The exynos_map_dt_data() function must be called before
> > thermal_zone_of_sensor_register(), and hence provide tmu_read()
> > function, before it is needed.
> >
> > This change is driven by adding support for enabling thermal_zoneX
> > when it is properly initialized.
> >
> > One can read the mode of operation
> > at /sys/class/thermal/thermal_zone0/mode Such functionality was
> > missing in the of-thermal.c code.
> >
> > Reported-by: Abhilash Kesavan <a.kesavan@samsung.com>
> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > ---
> >  drivers/thermal/samsung/exynos_tmu.c | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/thermal/samsung/exynos_tmu.c
> > b/drivers/thermal/samsung/exynos_tmu.c index 9d2d685..5d946ab 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.c
> > +++ b/drivers/thermal/samsung/exynos_tmu.c
> > @@ -975,15 +975,16 @@ static int exynos_tmu_probe(struct
> > platform_device *pdev) platform_set_drvdata(pdev, data);
> >         mutex_init(&data->lock);
> >
> > +       ret = exynos_map_dt_data(pdev);
> > +       if (ret)
> > +               goto err_sensor;
> > +
> >         data->tzd = thermal_zone_of_sensor_register(&pdev->dev, 0,
> > data, &exynos_sensor_ops);
> >         if (IS_ERR(data->tzd)) {
> >                 pr_err("thermal: tz: %p ERROR\n", data->tzd);
> >                 return PTR_ERR(data->tzd);
> >         }
> > -       ret = exynos_map_dt_data(pdev);
> > -       if (ret)
> > -               goto err_sensor;
> >
> >         pdata = data->pdata;
> 
> I have been testing this along with your v5 patch set and am seeing
> incorrect temperature being reported at boot-up on exynos7.

Does it show a maximal temperature value (0x1FF)?

>  It looks
> like exynos_tmu_read gets called from thermal_zone_of_device_update
> during boot-up, now that we have it populated early. However, as the
> tmu initialization function has not been called yet it returns a wrong
> value. Does that sound correct ?

No, this is a mistake. However, I'm wondering why on Exynos4/5 this
error didn't show up...

The reordering is needed to be able to call set_mode callback at
of-thermal.c to set the mode.

If this change causes problems, then another solution (probably not so
neat) must be found.

> 
> Regards,
> Abhilash
> >
> > --
> > 2.0.0.rc2
> >



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

  reply	other threads:[~2015-01-22  9:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19 11:44 [PATCH 0/2] thermal: Set default thermal_zoneX mode to "enabled" Lukasz Majewski
2015-01-19 11:44 ` [PATCH 1/2] thermal: exynos: Reorder exynos_map_dt_data() function Lukasz Majewski
2015-01-22  8:29   ` Abhilash Kesavan
2015-01-22  9:01     ` Lukasz Majewski [this message]
2015-01-22 12:32       ` Abhilash Kesavan
2015-01-29 23:06         ` Eduardo Valentin
2015-01-30  8:14           ` Lukasz Majewski
2015-01-30 15:06             ` Abhilash Kesavan
2015-02-02  5:36               ` Abhilash Kesavan
2015-02-04 10:36                 ` Lukasz Majewski
2015-02-04 11:50                   ` Abhilash Kesavan
2015-04-15  6:45             ` Joonyoung Shim
2015-04-15 11:05               ` Lukasz Majewski
2015-04-16  1:01                 ` Joonyoung Shim
2015-04-17 12:39                   ` Lukasz Majewski
2015-04-22  1:34                     ` Joonyoung Shim
2015-04-22  8:49                       ` Lukasz Majewski
2015-01-19 11:44 ` [PATCH 2/2] thermal: of: Enable thermal_zoneX when sensor is correctly added Lukasz Majewski
2015-01-20 18:26   ` Javi Merino

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=20150122100124.65e7a19e@amdc2363 \
    --to=l.majewski@samsung.com \
    --cc=amit.daniel@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=edubezval@gmail.com \
    --cc=kesavan.abhilash@gmail.com \
    --cc=kgene.kim@samsung.com \
    --cc=kgene@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=l.majewski@majess.pl \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.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 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.