Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760150AbcLBLAz (ORCPT ); Fri, 2 Dec 2016 06:00:55 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:29921 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760037AbcLBLAy (ORCPT ); Fri, 2 Dec 2016 06:00:54 -0500 Subject: Re: [PATCH 1/3] ARM: da850: fix infinite loop in clk_set_rate() To: Bartosz Golaszewski , Kevin Hilman , Michael Turquette , Peter Ujfalusi , Russell King References: <1480612516-18853-1-git-send-email-bgolaszewski@baylibre.com> <1480612516-18853-2-git-send-email-bgolaszewski@baylibre.com> CC: LKML , arm-soc From: Sekhar Nori Message-ID: Date: Fri, 2 Dec 2016 16:30:14 +0530 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: <1480612516-18853-2-git-send-email-bgolaszewski@baylibre.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1221 Lines: 30 Hi Bartosz, On Thursday 01 December 2016 10:45 PM, 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(). > > Simply add the clock once, but specify both the con_id and dev_id in > the lookup entry. > > Signed-off-by: Bartosz Golaszewski The issue is real, but the fix is not going to be this simple, I am afraid. This will break NAND on all da850 boards including LCDK. The aemif clock is accessed in two ways. One by the drivers/memory/ti-aemif.c, using ti-aemif as the device name and NULL connection id. Second by drivers/mtd/nand/davinci_nand.c and arch/arm/mach-davinci/aemif.c using davinci-nand as device id and with "aemif" as the connection id. We will need to match both. The only way to fix this without breaking anything is to create two clocks for the two lookups above. Both cannot be PSC clocks for the same PSC module as that would be racy. Instead just create a new nand clock node which is a child of the aemif node and inherits parent's clock rate. Thanks, Sekhar