Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp645866imb; Fri, 1 Mar 2019 10:05:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwdUnmGep7wO739vKKhWXBLa4ITE/sYPMcr47WWafsyy16HdWh2T6TAsABWospvG/IOqCtu X-Received: by 2002:a65:608c:: with SMTP id t12mr6097424pgu.400.1551463505440; Fri, 01 Mar 2019 10:05:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551463505; cv=none; d=google.com; s=arc-20160816; b=0qV0mMq5wLuuISDGQ1E1f6rZNaNv5td0TzUaGJ9xzqDfCUV9nhJc2FRsMP4l0pTlc7 UjY57wim/8HgViRF6vE1sD0ojlxjsxP+DwQZo/lV9/1rEUI/DEpdDFJMcHjb77E0PQlM vHO2PpfnFfmDDxOJKpLIOwF7f9Bha/HLb2cQqTfjW+jKB4+wUW4/7Nial6y3K4Kmxf38 HElZfCmPROh0tCckBr37G+F2+mrji18i/bMHKeH0taMREwOutMe84IX8S7tDeFiQaaBE z5IsyuI3XBSEgMyphSfUylRh3yZR9xCr1iXyfkKIdKN+HgLspd1RmF1oZvQwEGG6XemT xy/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:user-agent:cc:from:references :message-id:subject:to:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=Lu4PA4Fe819LeTGUemL1FejJQOcKcQjMkveb0A3XSVc=; b=k/SMVuW3i4Rby/5/E2zwBcTJW/6bBTDdbCMTB9B+a6IEt0eB19kPhn42UhrFYBo67k fCxA2NWQKKaamYYs4LyuHV+pXWXmTpRdEX20Ttozxsbl6D8nOgeyQNhFBtvbtutoHo+M qjjkOXuUa1iwt+gd5ZZ6Kx6aInaodlMuZrPWbnwU8gynQOEgKVqJ6ID36bgC1/pp6XzV /IJllvLioeJgHZ2ecknoi/UIQ7fwUi9zv6AXC0noGSGBWWd8zzzzr1FskuAob6lY5/6h hS/HX7e1nL4piIlV/JjGFgL6SoAttFucJLnnuAY77nqLnfMVOwfK92zW21pWgXkkvZoy uVYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kj6g66x2; 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 c15si21407496pls.144.2019.03.01.10.04.50; Fri, 01 Mar 2019 10:05:05 -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=kj6g66x2; 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 S2388632AbfCARbZ (ORCPT + 99 others); Fri, 1 Mar 2019 12:31:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:53290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727418AbfCARbZ (ORCPT ); Fri, 1 Mar 2019 12:31:25 -0500 Received: from localhost (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6EC0620818; Fri, 1 Mar 2019 17:31:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551461484; bh=BQE+SMLxxsmFEvJ/1XIaQOXrWm6bgHplun/ybCjHg+A=; h=In-Reply-To:To:Subject:References:From:Cc:Date:From; b=kj6g66x2aa/b/Tec/ACBezsobpCsPcrV/rJ4LPhM94i9xwsFa16OrGt4FiXa2OYel iJOjLXPkrWHYyCAW5z0GfATN4QYU47X0bZ9CO82AKcHNueW+UmBCDh781N0xy57EPi ojxf6LYPWd7Ldjwv//YyrOmQe24YItesrc/TaqCI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20190301052947.32032-4-samuel@sholland.org> To: Chen-Yu Tsai , Jassi Brar , Mark Rutland , Maxime Ripard , Michael Turquette , Rob Herring , Samuel Holland Subject: Re: [PATCH v2 03/10] clk: sunxi-ng: sun50i: Mark the msgbox clock as critical Message-ID: <155146148359.16805.78863244252924530@swboyd.mtv.corp.google.com> References: <20190301052947.32032-1-samuel@sholland.org> <20190301052947.32032-4-samuel@sholland.org> From: Stephen Boyd Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Samuel Holland User-Agent: alot/0.8 Date: Fri, 01 Mar 2019 09:31:23 -0800 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Samuel Holland (2019-02-28 21:29:40) > The msgbox clock is critical because the hardware is shared between > Linux and system firmware. The message box may be used by the EL3 secure > monitor's PSCI implementation. On 64-bit sunxi SoCs, this is provided by > ARM TF-A; 32-bit SoCs use a different implementation. The secure monitor > uses the message box to forward requests to power management firmware > running on a separate CPU. >=20 > It is not enough for the secure monitor to enable the clock each time > Linux performs a SMC into EL3, as both the firmware and Linux can run > concurrently on separate CPUs. So it is never safe for Linux to turn > this clock off, and it should be marked as critical. >=20 > At this time, such power management firmware only exists for the A64. > However, it makes sense to take care of all CCU drivers now for > consistency, and to ease the transition in the future, once firmware is > ported to the other SoCs. >=20 > Signed-off-by: Samuel Holland > --- > drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 2 +- > drivers/clk/sunxi-ng/ccu-sun50i-h6.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng= /ccu-sun50i-a64.c > index 932836d26e2b..7780e855c56f 100644 > --- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c > +++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c > @@ -350,7 +350,7 @@ static SUNXI_CCU_GATE(bus_de_clk, "bus-de", "= ahb1", > static SUNXI_CCU_GATE(bus_gpu_clk, "bus-gpu", "ahb1", > 0x064, BIT(20), 0); > static SUNXI_CCU_GATE(bus_msgbox_clk, "bus-msgbox", "ahb1", > - 0x064, BIT(21), 0); > + 0x064, BIT(21), CLK_IS_CRITICAL); Please add a comment explaining why CLK_IS_CRITICAL is used. It helps us remember years from now without having to dig in the git history.