devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anson Huang <anson.huang@nxp.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: "rui.zhang" <rui.zhang@intel.com>,
	Eduardo Valentin <edubezval@gmail.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS 
	<devicetree@vger.kernel.org>,
	linux-kernel" <linux-kernel@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: RE: [PATCH V2 4/4] thermal: qoriq: Add clock operations
Date: Tue, 30 Jul 2019 03:00:41 +0000	[thread overview]
Message-ID: <DB3PR0402MB39161F938C25012015B9739CF5DC0@DB3PR0402MB3916.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <CAOMZO5AgP0BrHyFKz78rsEz1XQMgSNzMmtTV6Q+GYtCGBiFMEQ@mail.gmail.com>

Hi, Fabio

> On Mon, Jul 29, 2019 at 6:04 AM <Anson.Huang@nxp.com> wrote:
> >
> > From: Anson Huang <Anson.Huang@nxp.com>
> >
> > Some platforms like i.MX8MQ has clock control for this module, need to
> > add clock operations to make sure the driver is working properly.
> 
> I haven't seen this series earlier, and I have sent a similar patch for Guido to
> test.
> 
> Since this patch solves a hang problem, I would suggest that this one
> becomes the first of the series.

Done in V3.

> 
> Also, the "clk: imx8mq: Remove CLK_IS_CRITICAL flag for
> IMX8MQ_CLK_TMU_ROOT" should only be applied after this one in order to
> avoid the hang.

Shawn already applied the patch, and Abel has the AHB clock patch to fix that,
so just wait for the AHB clock patch in instead of revert the TMU clock patch? 

> 
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > Reviewed-by: Guido Günther <agx@sigxcpu.org>
> > ---
> > Changes since V1:
> >         - use devm_clk_get_optional() instead of devm_clk_get().
> > ---
> >  drivers/thermal/qoriq_thermal.c | 21 +++++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> >
> > diff --git a/drivers/thermal/qoriq_thermal.c
> > b/drivers/thermal/qoriq_thermal.c index 2b2f79b..0ae45c0 100644
> > --- a/drivers/thermal/qoriq_thermal.c
> > +++ b/drivers/thermal/qoriq_thermal.c
> > @@ -2,6 +2,7 @@
> >  //
> >  // Copyright 2016 Freescale Semiconductor, Inc.
> >
> > +#include <linux/clk.h>
> >  #include <linux/module.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/err.h>
> > @@ -72,6 +73,7 @@ struct qoriq_sensor {
> >
> >  struct qoriq_tmu_data {
> >         struct qoriq_tmu_regs __iomem *regs;
> > +       struct clk *clk;
> >         bool little_endian;
> >         struct qoriq_sensor     *sensor[SITES_MAX];
> >  };
> > @@ -208,6 +210,16 @@ static int qoriq_tmu_probe(struct platform_device
> *pdev)
> >                 return PTR_ERR(data->regs);
> >         }
> >
> > +       data->clk = devm_clk_get_optional(&pdev->dev, NULL);
> > +       if (IS_ERR(data->clk))
> > +               return PTR_ERR(data->clk);
> > +
> > +       ret = clk_prepare_enable(data->clk);
> > +       if (ret) {
> > +               dev_err(&pdev->dev, "Failed to enable clock\n");
> > +               return ret;
> > +       }
> > +
> >         qoriq_tmu_init_device(data);    /* TMU initialization */
> >
> >         ret = qoriq_tmu_calibration(pdev);      /* TMU calibration */
> 
> In case of failure the TMU clock should be disabled in the error path.

Done in V3.

Thanks,
Anson.

  reply	other threads:[~2019-07-30  3:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29  8:39 [PATCH V2 1/4] thermal: qoriq: Use devm_platform_ioremap_resource() instead of of_iomap() Anson.Huang
2019-07-29  8:39 ` [PATCH V2 2/4] thermal: qoriq: Use __maybe_unused instead of #if CONFIG_PM_SLEEP Anson.Huang
2019-07-29  8:39 ` [PATCH V2 3/4] dt-bindings: thermal: qoriq: Add optional clocks property Anson.Huang
2019-07-29 12:21   ` Fabio Estevam
2019-07-29 12:31   ` Daniel Baluta
2019-07-29  8:39 ` [PATCH V2 4/4] thermal: qoriq: Add clock operations Anson.Huang
2019-07-29 12:30   ` Fabio Estevam
2019-07-30  3:00     ` Anson Huang [this message]
2019-07-30  3:56       ` Fabio Estevam
2019-07-30  4:33         ` Anson Huang

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=DB3PR0402MB39161F938C25012015B9739CF5DC0@DB3PR0402MB3916.eurprd04.prod.outlook.com \
    --to=anson.huang@nxp.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=edubezval@gmail.com \
    --cc=festevam@gmail.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.rutland@arm.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).