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: 9176645 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 3DCDA6075D for ; Tue, 14 Jun 2016 18:59:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26C07200F5 for ; Tue, 14 Jun 2016 18:59:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B9132823D; Tue, 14 Jun 2016 18:59:40 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BD49F200F5 for ; Tue, 14 Jun 2016 18:59:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bCtYl-0001h6-ME; Tue, 14 Jun 2016 18:59:35 +0000 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bCtYj-0001IE-A8 for linux-amlogic@lists.infradead.org; Tue, 14 Jun 2016 18:59:34 +0000 Received: by mail-pa0-x230.google.com with SMTP id b5so58864682pas.3 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=PkCMsOaIcE+6oth3ChTT0yKeyeJwG2/m8BjzlxKRyU6DXEoA7xUcXve4QF7YswsFJA zA35vdpcTV7oFophMizSUiqTauTk1oS0uK2q7sH13uzoeEvDnqtL/Fjm26B1HJ8p1FTG WsgSck3M7y6EQ+kvK7205v4amxR6EG/Dc/a/L59EBlZhQGXw96p+idX67g4p3yWQmX5r OS7de15ekXxWw1rEIJWWzcwv6LOYQtf+puivXwA5/6Ac+SWu2GyKZmxsmedvCWCNL8DA 09p9e2f/T2HP3OnBMUMs72NkGwhdQ1Zz+rsYrg416sA/R88ZArvUI61N57RAvremCe+L GZWg== X-Gm-Message-State: ALyK8tKcJTn+h1EFM64/Vpw+cHE60J1zfe9ekfAq6KTL37Mp4b3+j7IuHLwx+vQa8UVv3bA4 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160614_115933_421832_09DF988E X-CRM114-Status: GOOD ( 19.24 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: xing.xu@amlogic.com, victor.wan@amlogic.com, carlo@endlessm.com, jerry.cao@amlogic.com, linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.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] 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), }, };