public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: shawn.guo@linaro.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx6: gpc: don't register power domain if DT data is missing
Date: Wed, 27 May 2015 16:40:23 +0800	[thread overview]
Message-ID: <20150527084022.GE16165@dragon> (raw)
In-Reply-To: <1432714226-6333-1-git-send-email-l.stach@pengutronix.de>

On Wed, May 27, 2015 at 10:10:26AM +0200, Lucas Stach wrote:
> If the devicetree is too old and does not provide the regulator and clocks
> for the power domain, we need to avoid registering the power domain.
> Otherwise runtime PM will try to control the domain, which will lead to
> machine hangs without the proper DT configuration data.
> 
> This restores functionality to the kernel 4.0 level if an old DT is
> detected, where the power domain is constantly powered on.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

Applied, thanks.

> ---
>  arch/arm/mach-imx/gpc.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c
> index bbf015056221..6d0893a3828e 100644
> --- a/arch/arm/mach-imx/gpc.c
> +++ b/arch/arm/mach-imx/gpc.c
> @@ -449,6 +449,10 @@ static int imx_gpc_probe(struct platform_device *pdev)
>  	struct regulator *pu_reg;
>  	int ret;
>  
> +	/* bail out if DT too old and doesn't provide the necessary info */
> +	if (!of_property_read_bool(pdev->dev.of_node, "#power-domain-cells"))
> +		return 0;
> +
>  	pu_reg = devm_regulator_get_optional(&pdev->dev, "pu");
>  	if (PTR_ERR(pu_reg) == -ENODEV)
>  		pu_reg = NULL;
> -- 
> 2.1.4
> 

      reply	other threads:[~2015-05-27  8:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-27  8:10 [PATCH] ARM: imx6: gpc: don't register power domain if DT data is missing Lucas Stach
2015-05-27  8:40 ` Shawn Guo [this message]

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=20150527084022.GE16165@dragon \
    --to=shawn.guo@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox