From patchwork Mon Dec 5 10:09:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 9460759 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 8667060459 for ; Mon, 5 Dec 2016 10:11:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EB8E22ADC for ; Mon, 5 Dec 2016 10:11:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 730DD26490; Mon, 5 Dec 2016 10:11:39 +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=ham 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 092DA22ADC for ; Mon, 5 Dec 2016 10:11:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cDqDm-0005IX-Sh; Mon, 05 Dec 2016 10:10:06 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cDqDK-0004k8-0i for linux-arm-kernel@lists.infradead.org; Mon, 05 Dec 2016 10:09:40 +0000 Received: by mail-wm0-x236.google.com with SMTP id g23so89133300wme.1 for ; Mon, 05 Dec 2016 02:09:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gNiZq+2DEZXRUb44J+yEPsz8UFnrnr9Fob6YTrs0r8o=; b=br/6cX35fCxDLeuATshsB5s6ikoy3UnWwdfRrK6s/4qP5MTSWsPuO06Msg6PLEIW8l sFvsiwPwKCr/sly9jmwhYm0913amkGQSvIHkjk65grUMwExukKNUk6vow4b/1ZVZ3HZF P2cLfuod7VbTDOfY6JgZJJqpokfTO/Uen/p8Z5o5lv2KpSi3aPtQNyrUNKS0MmX1zLnk xA1tcm/q0EVC7P8s/w0V7mEb2KnOb7O0643ARm9ibKujQ3WuPqV1XPoM1O1HBwII7IpT MatULSqjTY2Dm6XDLMwoaakVDiIXvYoZB7c/2isnSnVb/8XPJWqx2e3jW+AoPVg321kW JSDw== 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:date:message-id:in-reply-to :references; bh=gNiZq+2DEZXRUb44J+yEPsz8UFnrnr9Fob6YTrs0r8o=; b=V5/+g3BKfkT7/UxATqhUE1vRVU2pSjRBW/CeKAFYiCqTrXESgGU0kZDPWbHN99YaU+ NLctlEFsaqoW9ShRWMX3Knpm7jCVTiM24STVDroyUndzqdFndS355GtojeyqYBD8Pam4 lMnCWyUmwcANaT0lVop07XwFYNUFU+H1Cb8mi5fO0r8JK9vuCKXo/eAa7W4Fo6TYfzdb O4lYlQR5CKGVHd0BABvmjadUKQRPO67PIwwwQ/bzr8d1VX2OlsTmHNamcyN2W1HVrZBV JhplhZw38QDO9a9djDvpTZtVmM25MuxbPZEoRN6bLV2mLzwRltwsyTaUsTYDhVzug7aI C3UA== X-Gm-Message-State: AKaTC03cTf3LxCcos/w7yzLNPljDLGQwApKDAowTJScW7loHALhaQyh9m3nMvbQVHJW+9tUt X-Received: by 10.28.40.67 with SMTP id o64mr7791202wmo.40.1480932555977; Mon, 05 Dec 2016 02:09:15 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id ef10sm19526939wjd.22.2016.12.05.02.09.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Dec 2016 02:09:15 -0800 (PST) From: Bartosz Golaszewski To: 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 Subject: [PATCH v3 1/3] ARM: da850: fix infinite loop in clk_set_rate() Date: Mon, 5 Dec 2016 11:09:07 +0100 Message-Id: <1480932549-30811-2-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1480932549-30811-1-git-send-email-bgolaszewski@baylibre.com> References: <1480932549-30811-1-git-send-email-bgolaszewski@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161205_020938_365403_67CC8284 X-CRM114-Status: GOOD ( 11.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartosz Golaszewski , LKML , arm-soc , linux-pm@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(). 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),