All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Michael Turquette <mturquette@baylibre.com>,
	linux-clk@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 2/2] clk: renesas: mstp: Make INTC-SYS a critical clock
Date: Fri, 20 Jan 2017 15:12:43 -0800	[thread overview]
Message-ID: <20170120231243.GE8009@codeaurora.org> (raw)
In-Reply-To: <1484657190-12838-3-git-send-email-geert+renesas@glider.be>

On 01/17, Geert Uytterhoeven wrote:
> INTC-SYS is the module clock for the GIC.  Accessing the GIC while it is
> disabled causes:
> 
>     Unhandled fault: asynchronous external abort (0x1211) at 0x00000000
> 
> Currently, the GIC-400 driver cannot enable its module clock for several
> reasons:
>   - It does not use a platform device, so Runtime PM is not an option,
>   - gic_of_init() runs before any clocks are registered, so it cannot
>     enable the clock explicitly,
>   - gic_of_init() cannot return -EPROBE_DEFER, as IRQCHIP_DECLARE()
>     doesn't support deferred probing.
> 
> Hence we have to keep on relying on the boot loader for enabling the
> module clock.
> 
> To prevent the module clock from being disabled when the CCF core thinks
> it is unused, and thus causing a system lock-up, add a check to the MSTP
> clock driver and enable CLK_IS_CRITICAL. This will make sure the module
> clock is never disabled.
> 
> This is a hard dependency for describing the INTC-SYS clock in DT on
> R-Mobile APE6 and R-Car Gen2.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---

Acked-by: Stephen Boyd <sboyd@codeaurora.org>

> diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c
> index 9375777776d99407..c0319b8acf3521a2 100644
> --- a/drivers/clk/renesas/clk-mstp.c
> +++ b/drivers/clk/renesas/clk-mstp.c
> @@ -144,6 +144,11 @@ static int cpg_mstp_clock_is_enabled(struct clk_hw *hw)

Sad that git gets confused about which function this is in.

>  	init.name = name;
>  	init.ops = &cpg_mstp_clock_ops;
>  	init.flags = CLK_IS_BASIC | CLK_SET_RATE_PARENT;
> +	/* INTC-SYS is the module clock of the GIC, and must not be disabled */
> +	if (!strcmp(name, "intc-sys")) {
> +		pr_debug("MSTP %s setting CLK_IS_CRITICAL\n", name);
> +		init.flags |= CLK_IS_CRITICAL;
> +	}
>  	init.parent_names = &parent_name;
>  	init.num_parents = 1;
>  

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2017-01-20 23:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-17 12:46 [PATCH 0/2] clk: renesas: Use CLK_IS_CRITICAL to handle critical clocks Geert Uytterhoeven
2017-01-17 12:46 ` [PATCH 1/2] clk: renesas: cpg-mssr: Migrate to CLK_IS_CRITICAL Geert Uytterhoeven
2017-01-20 23:00   ` Stephen Boyd
2017-01-17 12:46 ` [PATCH 2/2] clk: renesas: mstp: Make INTC-SYS a critical clock Geert Uytterhoeven
2017-01-20 23:12   ` Stephen Boyd [this message]
2017-01-23  9:50     ` Geert Uytterhoeven
2017-01-20 23:00 ` [PATCH 0/2] clk: renesas: Use CLK_IS_CRITICAL to handle critical clocks Stephen Boyd
2017-01-23  9:34   ` Geert Uytterhoeven

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=20170120231243.GE8009@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=geert+renesas@glider.be \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mturquette@baylibre.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.