Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp211637imb; Thu, 28 Feb 2019 21:33:46 -0800 (PST) X-Google-Smtp-Source: APXvYqz8t0rtbmzV+J+A7ejvfZeEmlwzsXYupR4Z5vTTw/L+e/YIlxjhGP9jxV9amq3TH8F0e0cD X-Received: by 2002:a62:39c5:: with SMTP id u66mr3648114pfj.245.1551418426081; Thu, 28 Feb 2019 21:33:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551418426; cv=none; d=google.com; s=arc-20160816; b=WvvFfBikPxB4SCp/84G0mqDmuoQh3096VxHy7A/BTnVMyTo97sLxGX6s2i/VZqoB+x Zs8jIeXdsjzQL5OnXxJB+PIC+DFE9eq6v4xyHbfbFZT2hdUfxcCPwCtVXcfkX6RgSjbI xm/kuP0516y5mavJasfWUjWP8YqxTmprsqfXZDJ6/t+oKXTl+aUQuZSUSDz9GhZRO3xQ hIeSjYUA+1IHk9jEUevowECQr0S8e6KBkKEsHWQ62nArcOAD6ujhvcR8dwh+J/aV3kmC C135ijm9M5t0ekHomRL1Gbl7TFqtzwhPsCxUC26ZcwHnfMawlWRR2msMQICTnGogWtEu nohQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=LsAmdVWXGGKSdxtImpsZNqV8mKGJx6ggOMkI4cJuZzQ=; b=u0hsNTJ6nARJpblQRJY9NpeVTwnnob+NdptCZfUNBurB4ozXQws5ZeM4aZCyJLEDrw to/IZuKwufnNhqp9ItnwrUxt/DAc6Y0bgI5ZtzZbuClp2i+WgUM8c7WXBw93f3LyRG55 xtp5Xvrj1oF3YI/tIZvvEgjo7Ymsfkq7HQ0CMpZZqR0cJZweWgXoDbRxIu9DXZ2PFysq 94vmtJ7+94EK+JGOypkwPx/YAA6RJ1lIy2zN5JFVcM6B8pSu0yufqKNIrBwWp9ETXl6b SglPtBLXadvyKmLeD7gQwaGRSx66JUOyOQzVpXUMaHgjlJ4soBv/2HjHidKlxgBsJe5x YzLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=mtWQVhUx; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="tIUL/aDr"; 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 c10si20490790pgd.18.2019.02.28.21.33.31; Thu, 28 Feb 2019 21:33:46 -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=@sholland.org header.s=fm2 header.b=mtWQVhUx; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="tIUL/aDr"; 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 S1727178AbfCAF3x (ORCPT + 99 others); Fri, 1 Mar 2019 00:29:53 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:42113 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbfCAF3w (ORCPT ); Fri, 1 Mar 2019 00:29:52 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 8046522098; Fri, 1 Mar 2019 00:29:51 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 01 Mar 2019 00:29:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=LsAmdVWXGGKSd xtImpsZNqV8mKGJx6ggOMkI4cJuZzQ=; b=mtWQVhUxvO4d20W4/OC86a15U3ocr hzqhyKG9pXoOL0Kk+3CjJnDo1PA3n72IrGPTseZA86axqFbwQhlKOTlB+uRzzFSM y/EhOw8XQYp3UPrWTkwdhhYiDB8XeeJEuYBggbGPENj3BHMwPOqM9Kh3CZQh4lDv lojyd5ezoT2H0JqPWd0tkIp/8QJx5FZ4ljY8I0+4hLYjyq6HPL6D+bgX9q88mGhT 6yNAqBudmtGIoJB4uimmEVXN9it8oXzqxBJ0D9nJ30H3VbulZ5F+ZXK1A6S2NtNg f5H9MkgdSQwhoI5ahgdaVa3RGrFeX1XtRkU/3myo1n44+SuRYtDeG2Unw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=LsAmdVWXGGKSdxtImpsZNqV8mKGJx6ggOMkI4cJuZzQ=; b=tIUL/aDr +vMXXEMJvQ85Ug0F+6tSuppjb2pG9B+JAVgElFJqTN5AW7n+/6AsProgiM9toLsb OXxFXMpmkYl5ii9TUmzzQetv0reR3KFBWIm7SErbB7usvMEzFrwV9VTg3HW4Z3Ci g1KOU8Rt75vyF4F7vajHNcXo//l2Q/35j7uowYLtGREWUpUtbWpt43HLu/Uw5Ylt K1WtQxhP1XwAEWKNy5l8p28h97aZA0DOTX3aqDdf9eE/FezOuvQdInV3B4HbNeRm +x8WnXZtf78eraRMQA+7js3caTeVYRlTVG8tdLEaL8NVtnxghj2crAk/rnLoWR8Y /6TfaZsbI6jyQQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrvdeggdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecukfhppe ejtddrudefhedrudegkedrudehudenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhu vghlsehshhholhhlrghnugdrohhrghenucevlhhushhtvghrufhiiigvpedv X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 5FD3BE457F; Fri, 1 Mar 2019 00:29:50 -0500 (EST) From: Samuel Holland To: Jassi Brar , Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland 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 Subject: [PATCH v2 03/10] clk: sunxi-ng: sun50i: Mark the msgbox clock as critical Date: Thu, 28 Feb 2019 23:29:40 -0600 Message-Id: <20190301052947.32032-4-samuel@sholland.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190301052947.32032-1-samuel@sholland.org> References: <20190301052947.32032-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. 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. 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(-) 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); static SUNXI_CCU_GATE(bus_spinlock_clk, "bus-spinlock", "ahb1", 0x064, BIT(22), 0); diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c index 139e8389615c..a7fee407a1c8 100644 --- a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c +++ b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c @@ -340,7 +340,7 @@ static SUNXI_CCU_GATE(bus_dma_clk, "bus-dma", "psi-ahb1-ahb2", 0x70c, BIT(0), 0); static SUNXI_CCU_GATE(bus_msgbox_clk, "bus-msgbox", "psi-ahb1-ahb2", - 0x71c, BIT(0), 0); + 0x71c, BIT(0), CLK_IS_CRITICAL); static SUNXI_CCU_GATE(bus_spinlock_clk, "bus-spinlock", "psi-ahb1-ahb2", 0x72c, BIT(0), 0); -- 2.19.2