Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752990AbcLGByz (ORCPT ); Tue, 6 Dec 2016 20:54:55 -0500 Received: from vern.gendns.com ([206.190.152.46]:42601 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751518AbcLGByu (ORCPT ); Tue, 6 Dec 2016 20:54:50 -0500 Subject: Re: [PATCH v3 1/3] ARM: da850: fix infinite loop in clk_set_rate() To: Bartosz Golaszewski , Kevin Hilman , Michael Turquette , Sekhar Nori , Peter Ujfalusi , Russell King , Viresh Kumar , Boris Brezillon , "Rafael J. Wysocki" , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Cyrille Pitchen References: <1480932549-30811-1-git-send-email-bgolaszewski@baylibre.com> <1480932549-30811-2-git-send-email-bgolaszewski@baylibre.com> Cc: LKML , arm-soc , linux-pm@vger.kernel.org From: David Lechner Message-ID: <148e4d35-da65-a212-1490-c2d902dd4410@lechnology.com> Date: Tue, 6 Dec 2016 19:54:44 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1480932549-30811-2-git-send-email-bgolaszewski@baylibre.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1565 Lines: 44 On 12/05/2016 04:09 AM, Bartosz Golaszewski wrote: > The aemif clock is added twice to the lookup table in da850.c. This > breaks the children list of pll0_sysclk3 as we're using the same list > links in struct clk. When calling clk_set_rate(), we get stuck in > propagate_rate(). &emac_clk is used twice in this list as well. Shouldn't we fix it too? I would expect that it causes the same problem. > > Create a separate clock for nand, inheriting the rate of the aemif > clock and retrieve it in the davinci_nand module. > > Signed-off-by: Bartosz Golaszewski > --- > arch/arm/mach-davinci/da850.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c > index e770c97..c008e5e 100644 > --- a/arch/arm/mach-davinci/da850.c > +++ b/arch/arm/mach-davinci/da850.c > @@ -367,6 +367,11 @@ static struct clk aemif_clk = { > .flags = ALWAYS_ENABLED, > }; > > +static struct clk aemif_nand_clk = { > + .name = "nand", > + .parent = &aemif_clk, > +}; > + > static struct clk usb11_clk = { > .name = "usb11", > .parent = &pll0_sysclk4, > @@ -537,7 +542,7 @@ static struct clk_lookup da850_clks[] = { > CLK("da830-mmc.0", NULL, &mmcsd0_clk), > CLK("da830-mmc.1", NULL, &mmcsd1_clk), > CLK("ti-aemif", NULL, &aemif_clk), > - CLK(NULL, "aemif", &aemif_clk), > + CLK(NULL, "aemif", &aemif_nand_clk), > CLK("ohci-da8xx", "usb11", &usb11_clk), > CLK("musb-da8xx", "usb20", &usb20_clk), > CLK("spi_davinci.0", NULL, &spi0_clk), >