From patchwork Mon Nov 5 23:08:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 150227 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3196099ljp; Mon, 5 Nov 2018 15:08:37 -0800 (PST) X-Google-Smtp-Source: AJdET5exTrTooo8ojr0+eHeKwOYinaeT5A0EYkcHBaZU50gV3up++rnm6HAIi+DEsBuwabK3noD8 X-Received: by 2002:a63:ae4d:: with SMTP id e13-v6mr21898356pgp.315.1541459317572; Mon, 05 Nov 2018 15:08:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541459317; cv=none; d=google.com; s=arc-20160816; b=KZfIhFQdqaIOnm4/c7f+DIVw5j5a3saRJj2CrlwbxGa6cZaBqY+B75OOFqZ2hef4V/ 7YFtKmVMwz4A8sElDEacNvjeG3+EzZRvgZ7e7cEXK6tGY820M/P61CvHz5gPwVQp9NUm +Xk8uHiFd7kRhT8fEmJR5CohVkpMgKPFKT/sGHfWWY8POoyJPEa62qFLSue/6vhVqW9i Yp0fiwm6e/Fn03+aWi1TmBlACWgsbFaTflUO0ZLvYGUKN37jU4qW19XAZrbJAuBuqjGS 2TNDtnxJVYLwphzgkpgFEapZu/7FWchqdCfaERAytqdQnhTz79C7tgQsrUCDMiAi6iRg L7NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=NR7/4GP7YK0tr2b/JpXE+NH3LWhxmoZ3idljVVirVVg=; b=i7ivm5InqPq1tW3rWw34r3SepI1w7zuqhCv1zFnXNzATyPEUEu75HnhX9ubzQisPs7 TY3gKUyY6dqal0A+BfM4ifRK5G6hlmjwPMQSm/i5MbgUOEyyvwRDIYxVySKOrAM8N+Gt 23UNGt2sY8hnHcjMHCRyJeH/zpnaYlM4FsB1xS6bInyHhPeoRDDIa9+zuPOYOSrFNb/t 5jPpXOxu7fr9sCm5hbeUH5wGYprYFtEqDnqLZad+03b+pKnRy8A8eK5/4taUqpuZuYYK 6iVVR3YMseMCPNKkff5GWkEylmJfDyOkSZ5XA2616onWSUYDo4R8GOMFevdqUHp9rhCV mzuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Ki6Wgy5M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h20si7443368pgm.366.2018.11.05.15.08.37; Mon, 05 Nov 2018 15:08:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Ki6Wgy5M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725945AbeKFIaj (ORCPT + 32 others); Tue, 6 Nov 2018 03:30:39 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:52108 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725733AbeKFIaj (ORCPT ); Tue, 6 Nov 2018 03:30:39 -0500 Received: by mail-wm1-f66.google.com with SMTP id w7-v6so9952986wmc.1 for ; Mon, 05 Nov 2018 15:08:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NR7/4GP7YK0tr2b/JpXE+NH3LWhxmoZ3idljVVirVVg=; b=Ki6Wgy5MUsJFbW+bD7IDqrlaR9LGixvoAG1FKXqxaTf5VL0Tb8aIqKvH48GEm22RWH 6kWqnt176VESod/Np250VO6FqAMEXRs+rW6qcGaUTlQQgqInvA7KqsvFun98m44e4mT/ E8LpjE50rfLFABBpbtmaT7Gl0h3W8up/cjwd6mPFGV7/ACFJRoESKGKotPFSXufYpa2J QpA2v7fsy14AishKPgqa5KcrsHg6OFUp+9iK3/81ZDI8PVCnoOe5bMXTX/1K63jp9NKq y3TqpRo1KXmPcte7TtGX2pp8TTCGUaG9dFV6IouBNqLmHyiuXGFoKRQsv6xZD4rf9zJ2 FIIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NR7/4GP7YK0tr2b/JpXE+NH3LWhxmoZ3idljVVirVVg=; b=o4A1O6DkhC8Gmkmb1fZDytjQ2Cz9yiaaFHinThgTRbIvjDvf9NrGtAxRBRI+Bx+moO KRamnGqPu/po7gyM2g6eGsKTwVv8GZ2iRa80l3sU82LTxwuQlZHBd7FBXFkkvkPss/rD upyGUja/4IGm2KBTPYPyPfocgGyZRRaERc/cZ3LxXTcKhhp0/l06Gw2dtScGWWjP2Nqs ruJBr7uGnCOKQZXtTrZfKSdvEgyzeYdkQbCoZTuN2XfBU3cYRfbB+TubeWUQ6A8SuQYO KGb/9oZkfzHOLFpnSNPHju4PbnbH7MLgva2og22my4WajlhhfVh1deGOOM9vKlIcjCgv 3QQQ== X-Gm-Message-State: AGRZ1gKiSgMfCxEOB1D/I9YBhdomIhUotJQ4itiSCXk1k++49BgkikW2 t8gW8KqqzxOBggkXk9oPv3Zzng== X-Received: by 2002:a1c:bce:: with SMTP id 197-v6mr75878wml.15.1541459313122; Mon, 05 Nov 2018 15:08:33 -0800 (PST) Received: from boomer.lan (cag06-3-82-243-161-21.fbx.proxad.net. [82.243.161.21]) by smtp.googlemail.com with ESMTPSA id k73-v6sm95717wmd.33.2018.11.05.15.08.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Nov 2018 15:08:32 -0800 (PST) From: Jerome Brunet To: Neil Armstrong , Carlo Caione , Kevin Hilman Cc: Christian Hewitt , Michael Turquette , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Jerome Brunet Subject: [PATCH v2] clk: meson-gxbb: set fclk_div3 as CLK_IS_CRITICAL Date: Tue, 6 Nov 2018 00:08:20 +0100 Message-Id: <20181105230820.3562-1-jbrunet@baylibre.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christian Hewitt 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 --- drivers/clk/meson/gxbb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 2.19.1 diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index 9309cfaaa464..4ada9668fd49 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -506,6 +506,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, }, };