All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Petr Benes <petrben@gmail.com>
Cc: "Michal Vokáč" <michal.vokac@ysoft.com>,
	"Daniel Lezcano" <daniel.lezcano@linaro.org>,
	linux-pm@vger.kernel.org, "Fabio Estevam" <festevam@gmail.com>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Amit Kucheria" <amitk@kernel.org>,
	linux-kernel@vger.kernel.org,
	"Andrzej Pietrasiewicz" <andrzej.p@collabora.com>,
	"NXP Linux Team" <linux-imx@nxp.com>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"David Jander" <david@protonic.nl>,
	"Zhang Rui" <rui.zhang@intel.com>,
	"Shawn Guo" <shawnguo@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] thermal: imx: implement runtime PM support
Date: Wed, 17 Nov 2021 11:24:18 +0100	[thread overview]
Message-ID: <20211117102418.GA29712@pengutronix.de> (raw)
In-Reply-To: <CAPwXO5anM809k+wuSYU9LR9vLAyutaMNo6kceCHOZHPmZUbnUw@mail.gmail.com>

On Mon, Nov 15, 2021 at 04:02:07PM +0100, Petr Benes wrote:
> Hi Oleksij,
> 
> On Thu, 11 Nov 2021 at 10:16, Oleksij Rempel <o.rempel@pengutronix.de> wrote:
> >
> > On Wed, Nov 10, 2021 at 11:07:31AM +0100, Michal Vokáč wrote:
> > > On 25. 10. 21 13:06, Petr Benes wrote:
> > > > Hi Oleksij,
> > > >
> > > > On Thu, 21 Oct 2021 at 19:21, Oleksij Rempel <o.rempel@pengutronix.de> wrote:
> > > > >
> > > > > Hi Petr,
> > > > >
> > > > > On Wed, Oct 20, 2021 at 05:53:03PM +0200, Petr Benes wrote:
> > > > > > On Wed, 20 Oct 2021 at 07:05, Oleksij Rempel <o.rempel@pengutronix.de> wrote:
> > > > > > >
> > > > > > > Hi Petr and Michal,
> > > > > > >
> > > > > > > I forgot to add you for v2 in CC. Please test/review this version.
> > > > > >
> > > > > > Hi Oleksij,
> > > > > >
> > > > > > It works good. with PM as well as without PM. The only minor issue I found is,
> > > > > > that the first temperature reading (when the driver probes) fails. That is
> > > > > > (val & soc_data->temp_valid_mask) == 0) holds true. How does
> > > > > > pm_runtime_resume_and_get() behave in imx_thermal_probe()?
> > > > > > Does it go through imx_thermal_runtime_resume() with usleep_range()?
> > > > >
> > > > > How exactly did you reproduce it? Even more or less understanding how
> > > >
> > > > I just placed my debug print into get_temp()
> > > >
> > > >      if ((val & soc_data->temp_valid_mask) == 0) {
> > > >          dev_dbg(&tz->device, "temp measurement never finished\n");
> > > >          printk("Wrong temperature reading!!!!!!\n");
> > > >          return -EAGAIN;
> > > >      }
> > > >
> > > > > this can potentially happen, i never had this issue on my HW. Is it something
> > > > > HW specific?
> > > >
> > > > IMHO it is just product of the following sequence:
> > > >
> > > > pm_runtime_set_active(&pdev->dev);
> > > > pm_runtime_enable(data->dev);
> > > > pm_runtime_resume_and_get(data->dev);
> > > > thermal_zone_device_enable(data->tz);
> > > >
> > > > With assumption imx_thermal_runtime_resume() didn't run,
> > > > hence the sensor didn't get enough time to come up.
> > > >
> > > > I didn't have time to spend it on and you have better knowledge of the
> > > > area. If it is not that straightforward I can try to diagnose it better.
> > > >
> > > Hi Oleksij,
> > > Did you manage to further debug and reproduce this problem?
> > > Do you plan to send the v3?
> > >
> > > Regarding your question about the HW - this problem occured once we
> > > upgraded the SoC on our SBC from i.MX6DL to i.MX6Q/QP. With the DualLite
> > > we never had this problem but the Quad is getting hot quite fast.
> > > We have pretty limited cooling options so the core is operated at its
> > > upper temperature limits when fully loaded.
> >
> > Hi Michal,
> >
> > Sorry, I was busy and lost this topic from my radar. I was not able to
> > reproduce it on my i.MX6Q and i.MX6QP died after other thermal voltage
> > experiments. Please, if you able to reproduce it, try to investigate
> > what is wrong, for example increasing wakeup time and/or and tracing
> > sleap/wake/get sequences.
> 
> Seems it is just as easy as calling usleep_range(20, 50) when you switch on
> the sensor and enable temperature measurement in imx_thermal_probe().
> So, we are sure the sensor is configured and _ready_.
> 
> You call pm_runtime_set_active(), pm_runtime_enable(), and
> pm_runtime_resume_and_get(). The last one doesn't call the resume
> callback (which correctly handles waiting for the sensor) as the device
> is already active.

Ok, thx! It makes sense. I'll send new version with the fix.

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

WARNING: multiple messages have this Message-ID (diff)
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Petr Benes <petrben@gmail.com>
Cc: "Michal Vokáč" <michal.vokac@ysoft.com>,
	"Daniel Lezcano" <daniel.lezcano@linaro.org>,
	linux-pm@vger.kernel.org, "Fabio Estevam" <festevam@gmail.com>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Amit Kucheria" <amitk@kernel.org>,
	linux-kernel@vger.kernel.org,
	"Andrzej Pietrasiewicz" <andrzej.p@collabora.com>,
	"NXP Linux Team" <linux-imx@nxp.com>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"David Jander" <david@protonic.nl>,
	"Zhang Rui" <rui.zhang@intel.com>,
	"Shawn Guo" <shawnguo@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] thermal: imx: implement runtime PM support
Date: Wed, 17 Nov 2021 11:24:18 +0100	[thread overview]
Message-ID: <20211117102418.GA29712@pengutronix.de> (raw)
In-Reply-To: <CAPwXO5anM809k+wuSYU9LR9vLAyutaMNo6kceCHOZHPmZUbnUw@mail.gmail.com>

On Mon, Nov 15, 2021 at 04:02:07PM +0100, Petr Benes wrote:
> Hi Oleksij,
> 
> On Thu, 11 Nov 2021 at 10:16, Oleksij Rempel <o.rempel@pengutronix.de> wrote:
> >
> > On Wed, Nov 10, 2021 at 11:07:31AM +0100, Michal Vokáč wrote:
> > > On 25. 10. 21 13:06, Petr Benes wrote:
> > > > Hi Oleksij,
> > > >
> > > > On Thu, 21 Oct 2021 at 19:21, Oleksij Rempel <o.rempel@pengutronix.de> wrote:
> > > > >
> > > > > Hi Petr,
> > > > >
> > > > > On Wed, Oct 20, 2021 at 05:53:03PM +0200, Petr Benes wrote:
> > > > > > On Wed, 20 Oct 2021 at 07:05, Oleksij Rempel <o.rempel@pengutronix.de> wrote:
> > > > > > >
> > > > > > > Hi Petr and Michal,
> > > > > > >
> > > > > > > I forgot to add you for v2 in CC. Please test/review this version.
> > > > > >
> > > > > > Hi Oleksij,
> > > > > >
> > > > > > It works good. with PM as well as without PM. The only minor issue I found is,
> > > > > > that the first temperature reading (when the driver probes) fails. That is
> > > > > > (val & soc_data->temp_valid_mask) == 0) holds true. How does
> > > > > > pm_runtime_resume_and_get() behave in imx_thermal_probe()?
> > > > > > Does it go through imx_thermal_runtime_resume() with usleep_range()?
> > > > >
> > > > > How exactly did you reproduce it? Even more or less understanding how
> > > >
> > > > I just placed my debug print into get_temp()
> > > >
> > > >      if ((val & soc_data->temp_valid_mask) == 0) {
> > > >          dev_dbg(&tz->device, "temp measurement never finished\n");
> > > >          printk("Wrong temperature reading!!!!!!\n");
> > > >          return -EAGAIN;
> > > >      }
> > > >
> > > > > this can potentially happen, i never had this issue on my HW. Is it something
> > > > > HW specific?
> > > >
> > > > IMHO it is just product of the following sequence:
> > > >
> > > > pm_runtime_set_active(&pdev->dev);
> > > > pm_runtime_enable(data->dev);
> > > > pm_runtime_resume_and_get(data->dev);
> > > > thermal_zone_device_enable(data->tz);
> > > >
> > > > With assumption imx_thermal_runtime_resume() didn't run,
> > > > hence the sensor didn't get enough time to come up.
> > > >
> > > > I didn't have time to spend it on and you have better knowledge of the
> > > > area. If it is not that straightforward I can try to diagnose it better.
> > > >
> > > Hi Oleksij,
> > > Did you manage to further debug and reproduce this problem?
> > > Do you plan to send the v3?
> > >
> > > Regarding your question about the HW - this problem occured once we
> > > upgraded the SoC on our SBC from i.MX6DL to i.MX6Q/QP. With the DualLite
> > > we never had this problem but the Quad is getting hot quite fast.
> > > We have pretty limited cooling options so the core is operated at its
> > > upper temperature limits when fully loaded.
> >
> > Hi Michal,
> >
> > Sorry, I was busy and lost this topic from my radar. I was not able to
> > reproduce it on my i.MX6Q and i.MX6QP died after other thermal voltage
> > experiments. Please, if you able to reproduce it, try to investigate
> > what is wrong, for example increasing wakeup time and/or and tracing
> > sleap/wake/get sequences.
> 
> Seems it is just as easy as calling usleep_range(20, 50) when you switch on
> the sensor and enable temperature measurement in imx_thermal_probe().
> So, we are sure the sensor is configured and _ready_.
> 
> You call pm_runtime_set_active(), pm_runtime_enable(), and
> pm_runtime_resume_and_get(). The last one doesn't call the resume
> callback (which correctly handles waiting for the sensor) as the device
> is already active.

Ok, thx! It makes sense. I'll send new version with the fix.

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-11-17 10:24 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 13:08 [PATCH v2] thermal: imx: implement runtime PM support Oleksij Rempel
2021-10-19 13:08 ` Oleksij Rempel
2021-10-20  5:04 ` Oleksij Rempel
2021-10-20  5:04   ` Oleksij Rempel
2021-10-20 15:53   ` Petr Benes
2021-10-20 15:53     ` Petr Benes
2021-10-21  7:20     ` Oleksij Rempel
2021-10-21  7:20       ` Oleksij Rempel
2021-10-21  7:41       ` Daniel Lezcano
2021-10-21  7:41         ` Daniel Lezcano
2021-10-21  7:44         ` Oleksij Rempel
2021-10-21  7:44           ` Oleksij Rempel
2021-10-21  7:56           ` Daniel Lezcano
2021-10-21  7:56             ` Daniel Lezcano
2021-10-21 17:20     ` Oleksij Rempel
2021-10-21 17:20       ` Oleksij Rempel
2021-10-25 11:06       ` Petr Benes
2021-10-25 11:06         ` Petr Benes
2021-11-10 10:07         ` Michal Vokáč
2021-11-10 10:07           ` Michal Vokáč
2021-11-11  9:16           ` Oleksij Rempel
2021-11-11  9:16             ` Oleksij Rempel
2021-11-15 15:02             ` Petr Benes
2021-11-15 15:02               ` Petr Benes
2021-11-17 10:24               ` Oleksij Rempel [this message]
2021-11-17 10:24                 ` Oleksij Rempel

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=20211117102418.GA29712@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=amitk@kernel.org \
    --cc=andrzej.p@collabora.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=david@protonic.nl \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=michal.vokac@ysoft.com \
    --cc=petrben@gmail.com \
    --cc=rui.zhang@intel.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /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.