From patchwork Fri Dec 2 15:38:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 86315 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp311148qgi; Fri, 2 Dec 2016 07:39:51 -0800 (PST) X-Received: by 10.99.247.69 with SMTP id f5mr81385516pgk.81.1480693191769; Fri, 02 Dec 2016 07:39:51 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f192si5696141pfa.60.2016.12.02.07.39.51; Fri, 02 Dec 2016 07:39:51 -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 S1750903AbcLBPjb (ORCPT + 25 others); Fri, 2 Dec 2016 10:39:31 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:37712 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751804AbcLBPj1 (ORCPT ); Fri, 2 Dec 2016 10:39:27 -0500 Received: by mail-wm0-f42.google.com with SMTP id t79so19179684wmt.0 for ; Fri, 02 Dec 2016 07:39:26 -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=pbphaGTlW0ssvSHDYhfWD72uf9ImSP1e9AbisRXbycY=; b=K6eyasesdsc5kccKHHTjtUCUhagNM0eaLR6+R68dlXaPVXtRNTkz6NRN1fVB2kTV7o 4JLDjQVkUP+JG/HpLn78cKgr8cwOrkdwPxDJaGdzd23BC5y+yA1I+3cHHhoLVgBHmomV GydEckealpJ5nYnc89qrcbqISQ6PSLH/ZFh7SNyiMaBSju6FvQ3R+ks/azOAj8ovBpn4 POjkO+r9uBoRQkzAVgAoACHa/MAoewnyt3lLcVK2PnrCBxRYVuj1PEGbVt8KTmoVISQo 10+9ANEQzac4zX8Wau42/wbOwglVyC9D3zuoIVRWrXJwjdZC70Mcl3lsfOgg+Bg6bwnu u/Lg== 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=pbphaGTlW0ssvSHDYhfWD72uf9ImSP1e9AbisRXbycY=; b=Mt7Qnlj3wjC/CpGIlZoRLmU6H+kIPAVnjxyTsGQ87bHdPk761iRtRdot+xEoM0Qc1J Np7YcOXUscKVWuPUSHfMsyp1BEPvzlKnHTplEmQFtKkxd0rGt5C1ccBjqi4N43bd33fC 9ZcdfW2AEQM1dngjz6FBrorNakUAqMUAVPURCem+FvmsVf0W8lWYTPT9oVvSzGDGzzzZ 0Igu8t94Pef+Yz7pH5B6LYwlw5Eetbg2DzIL+Xj/AypL6nLh4K5I8vbmBaUaS2QACODp gl9nMHhDdsPfAeg85kiCdaBGbSnRN0vxr+FlQ6nYaVb7sRncfX1Cibiu3lxM6/bxALTv YKDQ== X-Gm-Message-State: AKaTC015eBe1Dluuv9xtP1RINQ7GnRxzRavwBCk72bGU/subwvVrQ+wi89LgttCL9la+H3Zp X-Received: by 10.28.27.208 with SMTP id b199mr3394502wmb.82.1480693165733; Fri, 02 Dec 2016 07:39:25 -0800 (PST) Received: from bgdev-debian.lan (jua06-1-82-242-157-225.fbx.proxad.net. [82.242.157.225]) by smtp.gmail.com with ESMTPSA id x140sm3769666wme.19.2016.12.02.07.39.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Dec 2016 07:39:25 -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 v2 1/3] ARM: da850: fix infinite loop in clk_set_rate() Date: Fri, 2 Dec 2016 16:38:52 +0100 Message-Id: <1480693134-31324-2-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1480693134-31324-1-git-send-email-bgolaszewski@baylibre.com> References: <1480693134-31324-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 ++++++- drivers/mtd/nand/davinci_nand.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) -- 2.9.3 diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index e770c97..1fcc986 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 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, "nand", &nand_clk), CLK("ohci-da8xx", "usb11", &usb11_clk), CLK("musb-da8xx", "usb20", &usb20_clk), CLK("spi_davinci.0", NULL, &spi0_clk), diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 27fa8b8..5857d06 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c @@ -694,7 +694,7 @@ static int nand_davinci_probe(struct platform_device *pdev) ret = -EINVAL; - info->clk = devm_clk_get(&pdev->dev, "aemif"); + info->clk = devm_clk_get(&pdev->dev, "nand"); if (IS_ERR(info->clk)) { ret = PTR_ERR(info->clk); dev_dbg(&pdev->dev, "unable to get AEMIF clock, err %d\n", ret);