From patchwork Wed Nov 14 22:23:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 10683171 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E04C14DB for ; Wed, 14 Nov 2018 22:25:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FC542BE9E for ; Wed, 14 Nov 2018 22:25:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 140A42BEE4; Wed, 14 Nov 2018 22:25:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ADE112BE9E for ; Wed, 14 Nov 2018 22:25:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=xhgtPalNeCacKcjRC0IA1X6bWZe7mvf08N+XtCiwsKo=; b=PK2YG+lCIsSZPHH5wZgkJsi2gc 5xZXX5DsPJRrULzNfnziOQu8/O83mjl4x1ozXYwoK+jT11DagYYj9vb5Ffij4I6evBDHuEllD5uyz wHz4SLXKj+xXQ9qE/INqisGWpoJoRc21lSLQALvF5KvnngZ2gMp6HmupIiUOoX4NH4eUoRTyo6En8 9CIl92rjb6b4vWJHIHaufQwnoWOUS5ZAd4ZvVoj+BWcsoWWJbhiW6wY9FZn5WmrQsy+NU0bOc/IbJ 4Vn8AiQfmNo278musG2pJGJ0lbOlHnVy8H0jZUwS2fOJrkrV3X054nM9sTHcGvl29++IbtGXV0ulj 3SHSqQvQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gN3ak-00024B-M3; Wed, 14 Nov 2018 22:24:58 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gN3af-0001vP-Ns for linux-amlogic@bombadil.infradead.org; Wed, 14 Nov 2018 22:24:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Nen90QJbAMFqJCnztBHwe10wUETtxovo6L47JsHejW4=; b=Nb6SWxD2yxxaysQ+EX4LKg3VP fGrVLjPru6M5n/YL97L0s5mkOcLICRanUdnV/m9ppaSylDz08ynts60IaEloA6ZW/Zmr4ZwQRypZ4 blDonRCM2VJ9DHMxR5aBgKVqXsXLwLw8BGNubt+inRGWrNZyNrtINRrE14tl6pzyIU2VUdUP5b/QR Ajwadgfaae1rt3PVbQg86nfF6lCg4OtKCKP1pD8diaawNoZ/7pfsdBwS/P1ZTx6jdslI6nxUYprEU KraMEZjJOkNQvCxKPRTeibM9K0AYGsmv3cTLKM7ezBucCoaSGXHUDZnR+r8rKszErRhTk3c3QrjQq 8UJQ7iPmg==; Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gN3ac-0002GD-Fz for linux-amlogic@lists.infradead.org; Wed, 14 Nov 2018 22:24:51 +0000 Received: from sasha-vm.mshome.net (unknown [64.114.255.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8F43822545; Wed, 14 Nov 2018 22:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542234275; bh=eL+/h6E8ha9ecM6sRlNDKJeF9zsoljeArTXvLfUos90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aw+DI4CpijJIW2X5CbEDts8Fu5dIhcfP169YzRsWK0xclqCij/D8/u4tSiN5pwAOO whMuadPZly+pQKwVQ4yE6dvfAEj7FEusfJ93DVgwWiyQlC2WNKOKb918yyn56r04Nh CLGUTIEjn8GsuuRH/uSDwx3JxM6VDlxubJ/nGVSQ= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH AUTOSEL 4.18 36/59] clk: meson-gxbb: set fclk_div3 as CLK_IS_CRITICAL Date: Wed, 14 Nov 2018 17:23:08 -0500 Message-Id: <20181114222335.99339-36-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181114222335.99339-1-sashal@kernel.org> References: <20181114222335.99339-1-sashal@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181114_172450_604389_C76FB231 X-CRM114-Status: GOOD ( 14.56 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , Stephen Boyd , Christian Hewitt , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, Jerome Brunet MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Christian Hewitt [ Upstream commit e2576c8bdfd462c34b8a46c0084e7c30b0851bf4 ] On the Khadas VIM2 (GXM) and LePotato (GXL) board there are problems with reboot; e.g. a ~60 second delay between issuing reboot and the board power cycling (and in some OS configurations reboot will fail and require manual power cycling). Similar to 'commit c987ac6f1f088663b6dad39281071aeb31d450a8 ("clk: meson-gxbb: set fclk_div2 as CLK_IS_CRITICAL")' the SCPI Cortex-M4 Co-Processor seems to depend on FCLK_DIV3 being operational. Until commit 05f814402d6174369b3b29832cbb5eb5ed287059 ("clk: meson: add fdiv clock gates"), this clock was modeled and left on by the bootloader. We don't have precise documentation about the SCPI Co-Processor and its clock requirement so we are learning things the hard way. Marking this clock as critical solves the problem but it should not be viewed as final solution. Ideally, the SCPI driver should claim these clocks. We also depends on some clock hand-off mechanism making its way to CCF, to make sure the clock stays on between its registration and the SCPI driver probe. Fixes: 05f814402d61 ("clk: meson: add fdiv clock gates") Signed-off-by: Christian Hewitt Signed-off-by: Jerome Brunet Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/meson/gxbb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index 177fffb9ebef..902c63209785 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -523,6 +523,18 @@ static struct clk_regmap gxbb_fclk_div3 = { .ops = &clk_regmap_gate_ops, .parent_names = (const char *[]){ "fclk_div3_div" }, .num_parents = 1, + /* + * FIXME: + * This clock, as fdiv2, is used by the SCPI FW and is required + * by the platform to operate correctly. + * Until the following condition are met, we need this clock to + * be marked as critical: + * a) The SCPI generic driver claims and enable all the clocks + * it needs + * b) CCF has a clock hand-off mechanism to make the sure the + * clock stays on until the proper driver comes along + */ + .flags = CLK_IS_CRITICAL, }, };