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: 86533 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1396087qgi; Mon, 5 Dec 2016 02:09:31 -0800 (PST) X-Received: by 10.99.211.21 with SMTP id b21mr55818184pgg.120.1480932571898; Mon, 05 Dec 2016 02:09:31 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si14072988pgh.296.2016.12.05.02.09.31; Mon, 05 Dec 2016 02:09:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752188AbcLEKJV (ORCPT + 25 others); Mon, 5 Dec 2016 05:09:21 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:35317 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752099AbcLEKJR (ORCPT ); Mon, 5 Dec 2016 05:09:17 -0500 Received: by mail-wm0-f52.google.com with SMTP id a197so89013174wmd.0 for ; Mon, 05 Dec 2016 02:09:16 -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=ajKu7JKmVLBn1m8e9aeJUEulZz6VE3v3RKxsPMNnHpfc8sNHv+QFMHTMY+LLJlvZtp XiNcQUTj9sF0LmjUZHk7CL0aBUQWil4L1gavwkUlioUSs4G/HP53VcILsKrJA2rVw/L3 RxiLRUBY3ddbeCLiLhLTOErF/VENpzov194PRY1xMYh23O3Ca4hm+LyrQ+BL2YYkdido NRcXfb3tp2Bj2+nY2eWBDXnv5dgUP1GfGt2cZnYukVoXCr6ftmFN7NQ86vgZZ1YUMwAM 15rbdL2Yaal3rex0Iw4w6Y0hNMwqrgT7IVGbu0BU91qNUYHgj9pvhJlYAm+eg0iZQeXq 6yWA== X-Gm-Message-State: AKaTC00aBfMPvJZmliFJr926dyiVhEBnuDlLjZHE5GPjWeOjAJ4Ye0run0eNIWm5N7VmSc5O 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 Cc: LKML , arm-soc , linux-pm@vger.kernel.org, Bartosz Golaszewski 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.9.3 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),