From patchwork Wed Mar 18 19:16:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 6043661 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 50899BF90F for ; Wed, 18 Mar 2015 19:16:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 84D4C20431 for ; Wed, 18 Mar 2015 19:16:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A86532043C for ; Wed, 18 Mar 2015 19:16:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932510AbbCRTQS (ORCPT ); Wed, 18 Mar 2015 15:16:18 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:48205 "EHLO laurent.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933376AbbCRTQO (ORCPT ); Wed, 18 Mar 2015 15:16:14 -0400 Received: from ayla.of.borg ([84.193.93.87]) by laurent.telenet-ops.be with bizsmtp id 57GC1q00H1t5w8s017GCFb; Wed, 18 Mar 2015 20:16:12 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1YYJRr-0007xV-PH; Wed, 18 Mar 2015 20:16:11 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1YYJRt-0007NO-DY; Wed, 18 Mar 2015 20:16:13 +0100 From: Geert Uytterhoeven To: Mike Turquette , Stephen Boyd , Simon Horman , Magnus Damm , Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org, linux-pm@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC 1/5] clk: shmobile: mstp: Never disable INTC-SYS Date: Wed, 18 Mar 2015 20:16:00 +0100 Message-Id: <1426706164-28309-2-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426706164-28309-1-git-send-email-geert+renesas@glider.be> References: <1426706164-28309-1-git-send-email-geert+renesas@glider.be> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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 explicitly enable the clock, - 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 quirk to the MSTP clock driver to make sure the module clock is never disabled. Signed-off-by: Geert Uytterhoeven --- drivers/clk/shmobile/clk-mstp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/clk/shmobile/clk-mstp.c b/drivers/clk/shmobile/clk-mstp.c index 2d2fe773ac8168f9..742af84735a07450 100644 --- a/drivers/clk/shmobile/clk-mstp.c +++ b/drivers/clk/shmobile/clk-mstp.c @@ -62,6 +62,12 @@ static int cpg_mstp_clock_endisable(struct clk_hw *hw, bool enable) unsigned int i; u32 value; + /* INTC-SYS is the module clock of the GIC, and must not be disabled */ + if (!enable && !strcmp(__clk_get_name(hw->clk), "intc-sys")) { + pr_debug("MSTP %pC skipping disable\n", hw->clk); + return 0; + } + spin_lock_irqsave(&group->lock, flags); value = clk_readl(group->smstpcr);