From patchwork Tue Jun 14 18:59:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 9176643 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1FD256075D for ; Tue, 14 Jun 2016 18:59:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0734C200F5 for ; Tue, 14 Jun 2016 18:59:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEE5D2824A; Tue, 14 Jun 2016 18:59:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4843B200F5 for ; Tue, 14 Jun 2016 18:59:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932817AbcFNS71 (ORCPT ); Tue, 14 Jun 2016 14:59:27 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:34813 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932828AbcFNS7N (ORCPT ); Tue, 14 Jun 2016 14:59:13 -0400 Received: by mail-pa0-f48.google.com with SMTP id bz2so58923128pad.1 for ; Tue, 14 Jun 2016 11:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version; bh=sUt+y9s1tdKZTJjw6gDUENO6pKUvbD8GO90xikW01v8=; b=awLbdVvjePZ8schhD60NFtFavIK3Xi/6vJ2p14GxCtLSoJS7Zoe7R8cyK724gGit02 muCCEycekOiLY/Bnd1DBws9FEUqO9LlLZzuI5m3d1Hep3LmniqJXj7Gmyc9G1BgXiwG5 QVSz+L9jy/YF4KVIKi5EV0vtLzr1exNmW1Qy2tpMIj1whi5ryikxvjIgPA+WaFOYhLqT 07VjXMmvdhCjAojJmgXYjOcI44PjuTIV6QWNLf8OXKnOR8KOpmANrqVxWXuPx9U3IlBf 9KEJ7OlaINYAyNZOQr1DulvT6OoZjJf0awBUIPcr2X/JLonJ1Cj4esTfXyLakxecq7f7 4ajg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version; bh=sUt+y9s1tdKZTJjw6gDUENO6pKUvbD8GO90xikW01v8=; b=gONmkpz5EXzpMnHNYP+54XPtZG3j1aRZOQsyUuFGBJf/8rs7C+qgynF1JrJa+qc2bE +4Z2MxpX/mWy46XGko9V5EndAhGb5qaJJYVnCsZE5k9LiHIlTKCNoTuiE4u3VWQp7S7s t+sMXeMw6JqVWeacIsh6XXSh7eCwNObG/Ccm6O1P20NOGMWjTfzz/tarYOCxyU9fBbDl 8rfUkDNhIXXlzeVkIyZVLDKO+eWFDvon3z/rkaG8HR4YGBJFgWFjgVkiQ9fazA/VweNX bqRYVavRHxnooSc7Aw7fFZzz47RRupPGyNWRrKqRsqBBn9uig8f8lR0ZiIVMTiqeWotr Z/5w== X-Gm-Message-State: ALyK8tKnIwN8TfGzoogYiuYTRqQzhPlDm6H/bmVvIri2CJD2+My5Q/d56/SBw6h5vWRjdUIr X-Received: by 10.66.248.133 with SMTP id ym5mr29878151pac.46.1465930752269; Tue, 14 Jun 2016 11:59:12 -0700 (PDT) Received: from localhost (c-98-203-232-209.hsd1.wa.comcast.net. [98.203.232.209]) by smtp.gmail.com with ESMTPSA id ee10sm27089350pac.31.2016.06.14.11.59.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jun 2016 11:59:11 -0700 (PDT) From: Kevin Hilman To: Michael Turquette Cc: linux-clk@vger.kernel.org, linux-amlogic@lists.infradead.org, carlo@endlessm.com, victor.wan@amlogic.com, jerry.cao@amlogic.com, xing.xu@amlogic.com Subject: Re: [PATCH 0/7] Add support for AmLogic GXBB clock controller Organization: BayLibre References: <1465518774-26924-1-git-send-email-mturquette@baylibre.com> Date: Tue, 14 Jun 2016 11:59:10 -0700 In-Reply-To: <1465518774-26924-1-git-send-email-mturquette@baylibre.com> (Michael Turquette's message of "Thu, 9 Jun 2016 17:32:47 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Mike, Michael Turquette writes: > This series is based on the AmLogic Meson8b rewrite/cleanup[0]. The > AmLogic GXBB is an ARMv8-based SoC, fed by a 24MHZ xtal, and it provides > several PLLs, muxes dividers and gates to drive CPUs and peripherals. > > While based on the Meson8b clock controller driver, this series adds > supports for Multi-phase Locked Loops (mpll) and support for PLLs with > fractional rates. > > This series introduces the clock controller driver for the gxbb, > including the DT binding description and accompanying change in the gxbb > dtsi. Only three clocks are exposed via the headers in the dt-bindings > include-chroot. More can be added later, but since these values > represent an ABI I wanted to start small. I'm not sure about the names > for the gate clocks, so I especially tried to avoid putting those in the > binding (with the exception of the Ethernet gate, which Kevin has needed > for a while). I tested this on top of my integration branch for v4.7-rc[1] along with the ethernet driver. First, I modified the ethernet node to use the new clock[2], and then I added the ethernet driver to the build as modules[3] since unloading/reloading the module is testing the clock API[3]. Then, I tested unloading/reloading the dwmac-meson module on meson-gxbb-p200 and meson-gxbb-odroidc2 and found that the system hung on module reload. As you suggested off-list, this might be because it's walking up the tree and disabling clk81, which would cause such a problem, so I added CLK_IS_CRITICAL to clk81, and that got things working just fine. With that change, I can now unload/reload the ethernet module (which is prepare/enable'ing and unprepare/disable'ing the clocks. Tested-by: Kevin Hilman Kevin [1] https://git.kernel.org/cgit/linux/kernel/git/khilman/linux-amlogic.git/log/?h=v4.7/integ [2] the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi index e3210eb89bc8..834258a36cfb 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi @@ -45,6 +45,7 @@ #include #include #include +#include / { compatible = "amlogic,meson-gxbb"; @@ -332,7 +333,7 @@ 0x0 0xc8834540 0x0 0x4>; interrupts = <0 8 1>; interrupt-names = "macirq"; - clocks = <&xtal>; + clocks = <&clkc CLKID_ETH>; clock-names = "stmmaceth"; phy-mode = "rgmii"; status = "disabled"; [3] CONFIG_STMMAC_ETH=m CONFIG_PHYLIB=m CONFIG_MICREL_PHY=m CONFIG_REALTEK_PHY=m [4] diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index 26c78a2a614d..007b7157cf4b 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -558,7 +558,7 @@ static struct clk_gate gxbb_clk81 = { .ops = &clk_gate_ops, .parent_names = (const char *[]){ "mpeg_clk_div" }, .num_parents = 1, - .flags = (CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED), + .flags = (CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED | CLK_IS_CRITICAL), }, }; -- To unsubscribe from this list: send the line "unsubscribe linux-clk" in