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: 9458821 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 DEA2E60515 for ; Fri, 2 Dec 2016 15:41:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2745284DE for ; Fri, 2 Dec 2016 15:41:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C670E28502; Fri, 2 Dec 2016 15:41:25 +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 702CF284DE for ; Fri, 2 Dec 2016 15:41:25 +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 1cCpwP-0002Ff-Fo; Fri, 02 Dec 2016 15:40:01 +0000 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cCpwB-0001ri-La for linux-arm-kernel@lists.infradead.org; Fri, 02 Dec 2016 15:39:49 +0000 Received: by mail-wm0-x22c.google.com with SMTP id t79so19179685wmt.0 for ; Fri, 02 Dec 2016 07:39:27 -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=PRNgxKmprCf+l0bhQbCuF8ons2TTavtCR16Pb5j1uF8YloBL9Vr5mXTDkeIIroqe8l WPQy2RWvd1STZsWo7hxKMjc7uhHJaaJAJ//SL/K01B1MbSwUPbSNfvvJDsI/Prt1q5kP 4/vSVijVNh0PUpkqSzt/cfXdNqA5clTtHotwm4vAOK/6D3xBUu7OLK5n5JfIetqSA7Q3 r00yXM5OU6KqjPXEgOVtVszFcjFI2eIwNR+fJwbB67LTEeNrCMEZ0XZqFwUgBG9ggAIE HpvYHbgrtJlJA/lKAEs8MtttzvWFcQT7eq9LuwHvgZBt4nKrGAN513PWXCrFTb2YUaw+ mEUw== X-Gm-Message-State: AKaTC03dxlgi8HKnqUVK1pffmLSNETgGD1EX/xMm+51nwCPZfumAPMBQvbMjdknn9hNeixYO 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161202_073948_017891_F9B2433F X-CRM114-Status: GOOD ( 12.96 ) 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 ++++++- drivers/mtd/nand/davinci_nand.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) 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);