Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752811AbaFETcM (ORCPT ); Thu, 5 Jun 2014 15:32:12 -0400 Received: from mail-wg0-f42.google.com ([74.125.82.42]:52014 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751405AbaFETcK (ORCPT ); Thu, 5 Jun 2014 15:32:10 -0400 Message-ID: <5390C5A9.5070900@gmail.com> Date: Thu, 05 Jun 2014 21:31:53 +0200 From: Tomasz Figa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Doug Anderson CC: Tomasz Figa , Mike Turquette , Kukjin Kim , linux-samsung-soc , "linux-kernel@vger.kernel.org" , Olof Johansson , Javier Martinez Canillas , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v2] clk: exynos5420: Keep aclk66_peric enabled during boot References: <1401398496-4624-1-git-send-email-dianders@chromium.org> <1401467562-5585-1-git-send-email-dianders@chromium.org> <5390C19A.9060201@gmail.com> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05.06.2014 21:22, Doug Anderson wrote: > Tomasz, > > On Thu, Jun 5, 2014 at 12:14 PM, Tomasz Figa wrote: >> On 05.06.2014 20:48, Doug Anderson wrote: >>> Tomasz / Mike, >>> >>> On Fri, May 30, 2014 at 9:32 AM, Doug Anderson wrote: >>>> Right now if you've got earlyprintk enabled on exynos5420-peach-pit >>>> then you'll get a hang on boot. Here's why: >>>> >>>> 1. The i2c-s3c2410 driver will probe at subsys_initcall. It will >>>> enable its clock and disable it. This is the clock "i2c2". >>>> 2. The act of disabling "i2c2" will disable its parents. In this case >>>> the parent is "aclk66_peric". There are no other children of >>>> "aclk66_peric" officially enabled, so "aclk66_peric" will be turned >>>> off (despite being CLK_IGNORE_UNUSED, but that's by design). >>>> 3. The next time you try to earlyprintk you'll do so without the UART >>>> clock enabled. That's because the UART clocks are also children of >>>> "aclk66_peric". You'll hang. >>>> >>>> There's no good place to put a clock enable for earlyprintk, which is >>>> handled by a bunch of assembly code. The best we can do is to handle >>>> this in the clock driver. >>>> >>>> Signed-off-by: Doug Anderson >>>> Tested-by: Javier Martinez Canillas >>>> --- >>>> Changes in v2: >>>> - Use GATE_A and clk_get(). Save the clock for putting later. >>>> - Return 0 from exynos5420_clk_late_init(). >>>> >>>> drivers/clk/samsung/clk-exynos5420.c | 33 +++++++++++++++++++++++++++++++-- >>>> 1 file changed, 31 insertions(+), 2 deletions(-) >>> >>> Are there other changes you'd like me to make to this? It would be >>> really nice to get this in for 3.16 so the system doesn't just >>> mysteriously hang when you use earlyprintk. >> >> We can probably take this as an -rc fix, so it should be fine. >> >> However I still don't see the point of exporting this clock and >> polluting the global clkdev namespace. Even the diffstat looks better in v1. > > OK, I'm happy to go back to v1 with the addition of the "return 0". > > Mike: are you OK with that? > One more question that just came to my mind: Why it is just the aclk66_peri and not its children related to UARTs? Exynos5420 clock driver still needs a little clean-up, so I'm okay with any fix for now and changing this later if needed, but is this gate clock for ACLK66_PERIC even needed? It seems to be marked with CLK_IGNORE_UNUSED which suggests that it is not needed in this driver at all, along with other similar clocks. AFAIK for power management purposes our fine-grained approach is fine and we shouldn't need to use the big gates. Best regards, Tomasz -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/