From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C761C10F03 for ; Fri, 1 Mar 2019 17:31:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 09FF920857 for ; Fri, 1 Mar 2019 17:31:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551461487; bh=BQE+SMLxxsmFEvJ/1XIaQOXrWm6bgHplun/ybCjHg+A=; h=In-Reply-To:To:Subject:References:From:Cc:Date:List-ID:From; b=gCDWKEJoDiiKiUv6A9/E2EmakijV1bJsj75iylFl928PL0fZ+Vb4+fxYu0RlE0hxF qiiqLl4SZ8iF1nipUlJX6gMa5lZLnQhxWB7bOjcWQVOebo1KmOJlbRnSXVC+MKb+0k L3K6f81SmMzU3XdajklBG6PtSCzh4xpS6KFU63RY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388728AbfCARbZ (ORCPT ); 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. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Boyd Subject: Re: [PATCH v2 03/10] clk: sunxi-ng: sun50i: Mark the msgbox clock as critical Date: Fri, 01 Mar 2019 09:31:23 -0800 Message-ID: <155146148359.16805.78863244252924530@swboyd.mtv.corp.google.com> References: <20190301052947.32032-1-samuel@sholland.org> <20190301052947.32032-4-samuel@sholland.org> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20190301052947.32032-4-samuel@sholland.org> Sender: linux-kernel-owner@vger.kernel.org To: Chen-Yu Tsai , Jassi Brar , Mark Rutland , Maxime Ripard , Michael Turquette , Rob Herring 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 List-Id: devicetree@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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 370DBC43381 for ; Fri, 1 Mar 2019 17:31:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 030E020857 for ; Fri, 1 Mar 2019 17:31:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qG+AbI0m"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="kj6g66x2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 030E020857 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:From:References:Message-ID:Subject :To:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5zCgd4/V0gpYpY0rG+1/Ju7sO1PRhOeSbMBybJQE6KA=; b=qG+AbI0mFhuNNa fdsvGH6gYy2nMZAGKfcbZJTx8C6symnKEh2QT+nL3NYiC6O24M9Re2G+tD5q43TAoJdxmKYuGtoFd QgTg5nCtJfddeINTVGdLxACA/QB7rGTj6RCXZcUXR9e0kadd7Gstgqotw+bIw++gCPXcYm/mgpxx8 0MFKVi9q5vpF+DnBxYAVYplQWHn0b78q7CzTxIg/aObCVsYQB3jfFr8oRvAWq/k5Ek46+sVU9RHJi kk6u9wnFD3ngCWC89tFiQvlATtSKtPm276eVqjhoJcqJLYL3nkrIf7gh5KYHQQNNMnUUxKaKApMSq 9P6DfUzBm6nk4/SRu3rw==; 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 1gzm0O-000219-SQ; Fri, 01 Mar 2019 17:31:28 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzm0L-00020m-GX for linux-arm-kernel@lists.infradead.org; Fri, 01 Mar 2019 17:31:26 +0000 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= MIME-Version: 1.0 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 User-Agent: alot/0.8 Date: Fri, 01 Mar 2019 09:31:23 -0800 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_093125_562522_9E209981 X-CRM114-Status: GOOD ( 18.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Samuel Holland , linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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. > > 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); 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel