| From 9dde2addb9d9d5f356e3b37b0e0222e12c93cdad Mon Sep 17 00:00:00 2001 |
| From: Geert Uytterhoeven <geert+renesas@glider.be> |
| Date: Tue, 17 Mar 2015 17:20:52 +0100 |
| Subject: [PATCH 014/255] clk: renesas: mstp: Make INTC-SYS a critical clock |
| |
| 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> |
| (cherry picked from commit e34084fb9a023d1dd008c989523af5a037f1d692) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| --- |
| drivers/clk/renesas/clk-mstp.c | 5 +++++ |
| 1 file changed, 5 insertions(+) |
| |
| --- a/drivers/clk/renesas/clk-mstp.c |
| +++ b/drivers/clk/renesas/clk-mstp.c |
| @@ -158,6 +158,11 @@ cpg_mstp_clock_register(const char *name |
| 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; |
| |