Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7276732imu; Wed, 14 Nov 2018 14:42:50 -0800 (PST) X-Google-Smtp-Source: AJdET5c/kVNIZb/DrQa2f0+QD+uv5KUCHgHqeAvbBJrW8sOHSJXxG/V6yVUFqmW5RS8u1UxlOFrw X-Received: by 2002:a17:902:4d46:: with SMTP id o6-v6mr3814667plh.104.1542235370381; Wed, 14 Nov 2018 14:42:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542235370; cv=none; d=google.com; s=arc-20160816; b=KhLo7g5BVP40OatF1g/CGqNQQvScDP0jK5+WzkoaWlim5Mo2NmqtVXMFGMrvqsr4TF F/uGLGrC5BPdy5RI9+rg5ZKTeG3MnR8BlyVRgXQbYBTbpK/kQi9BxHuSkGbXhXLgbPCU EIVn1E1kV8zKpNIDxgUNcQMd0XL/HjsgSjLbRtvTIukT/peiDeFMM1mtNFjcOo+XeLAv OMhqSg1uLxMhL86tmY/VD38d86I/LgE7X9F4TdK0HuJsrhdSiId/AXLNDu5W5YLWUGj4 qKc28/9RGkrOFQGYHg0XIshxuIghCvuBewx3hm1+wnY+xqYwO5O/5OIby2x47M8KUZi9 sw5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=itphX/kWXdx+OOxW7/Xzpp9thhyHt2D9tsMnaXrP8x0=; b=M6iwYJ8iJMMes73DVoE2wTidFxWfB1+N+KyAHz2sJGWY2rcOthgDsserMQuxTW2H/g EWF8AvvnEERzOuBRIBBu2Udgp081U2kzu7+supRELBPPheVTdJbhsn4NH7V5wVwRD8oj qnq5y2JkcYlpoXOFgynlnlMqkFS2A8fYROq1dA6OhNQ6pyjQERoYdkFM5wTZ8jkb5NTQ /ANQhsKxGFEXx/xFP2+g1NmORUNIF1Vey8VqWpr4zXqagTrGKL8VG/p1auLnuKwSkWq3 FsxF71MUIJvnHYYPRk9nDWaPSw8sL4VySMOSmXYCiYZBnHDiMCMZLOODI1CXw1hwdmHO 62pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ELbkA0Gl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j187-v6si5646277pfc.194.2018.11.14.14.42.35; Wed, 14 Nov 2018 14:42:50 -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=@kernel.org header.s=default header.b=ELbkA0Gl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728877AbeKOI1X (ORCPT + 99 others); Thu, 15 Nov 2018 03:27:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:34470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728824AbeKOI1W (ORCPT ); Thu, 15 Nov 2018 03:27:22 -0500 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 19F1422525; Wed, 14 Nov 2018 22:22:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542234139; bh=npnP/6vB2S1U+pAywWLduNRLDMOcnThc/5LFgrk//H4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ELbkA0Gl4ih+JYyL2nrR+odEZv3hHk0k97SYZDccXODyl30bjGdu2iIHo2fqafMJB +QBZVzfpSrf3kzsNyoQM+iHabVBZKef/38DWltBp1tzsQ0iIyTisQHXlhTNpQyMXjn HzYG/ShH+qwbqPWBvt41HkFdiT9mz+MwPc8fqEaw= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Hewitt , Jerome Brunet , Stephen Boyd , Sasha Levin Subject: [PATCH AUTOSEL 4.19 46/73] clk: meson-gxbb: set fclk_div3 as CLK_IS_CRITICAL Date: Wed, 14 Nov 2018 17:21:40 -0500 Message-Id: <20181114222207.98701-46-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181114222207.98701-1-sashal@kernel.org> References: <20181114222207.98701-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 86d3ae58e84c..6435d86118f1 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -522,6 +522,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, }, }; -- 2.17.1