linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Valentin <edubezval@gmail.com>
To: Bai Ping <b51503@freescale.com>
Cc: rui.zhang@intel.com, linux-pm@vger.kernel.org
Subject: Re: [PATCH] thermal: imx: correct thermal driver load sequence
Date: Thu, 11 Sep 2014 08:16:20 -0400	[thread overview]
Message-ID: <20140911121618.GA26715@developer> (raw)
In-Reply-To: <1410422657-30726-1-git-send-email-b51503@freescale.com>

Hello Bai,

On Thu, Sep 11, 2014 at 04:04:17PM +0800, Bai Ping wrote:
> Thermal driver should be registered after cpufreq driver have
> been registered and probed. Doing so is to make sure that thermal
> driver can get the max cpu cooling states correctly when calling
> get_property.
> 

OK.

> Signed-off-by: Bai Ping <b51503@freescale.com>
> ---
>  drivers/thermal/imx_thermal.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
> index 45af765..d00aaaf 100644
> --- a/drivers/thermal/imx_thermal.c
> +++ b/drivers/thermal/imx_thermal.c
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright 2013 Freescale Semiconductor, Inc.
> + * Copyright 2013-2014 Freescale Semiconductor, Inc.
>   *

The above does not seam to be part of this patch.

>   * This program is free software; you can redistribute it and/or modify
>   * it under the terms of the GNU General Public License version 2 as
> @@ -557,7 +557,14 @@ static struct platform_driver imx_thermal = {
>  	.probe		= imx_thermal_probe,
>  	.remove		= imx_thermal_remove,
>  };
> -module_platform_driver(imx_thermal);
> +
> +static int __init imx_thermal_init(void)
> +{
> +	return platform_driver_register(&imx_thermal);
> +}
> +
> +late_initcall(imx_thermal_init);
> +

Have you considered checking if the cpufreq driver is loaded in your
probe? In case it is not loaded, you may return EPROBE_DEFER.

The problem that I have with the approach above is that it does not have
effect if you are building this driver as a module. Besides, in some
platforms, cpufreq also gets initialized in late phase, when most PM
layers are loaded. Are you sure the cpufreq in your case gets always
loaded before late init calls?

>  MODULE_AUTHOR("Freescale Semiconductor, Inc.");
>  MODULE_DESCRIPTION("Thermal driver for Freescale i.MX SoCs");
> -- 
> 1.9.1
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-09-11 12:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11  8:04 [PATCH] thermal: imx: correct thermal driver load sequence Bai Ping
2014-09-11 12:16 ` Eduardo Valentin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-09-11  7:50 Bai Ping

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=20140911121618.GA26715@developer \
    --to=edubezval@gmail.com \
    --cc=b51503@freescale.com \
    --cc=linux-pm@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 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).