From patchwork Tue Nov 25 14:22:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5379891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B7B26C11AC for ; Tue, 25 Nov 2014 14:25:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D783420145 for ; Tue, 25 Nov 2014 14:24:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D922320142 for ; Tue, 25 Nov 2014 14:24:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XtH0r-00024u-Gq; Tue, 25 Nov 2014 14:22:41 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XtH0o-00022u-8w for linux-arm-kernel@lists.infradead.org; Tue, 25 Nov 2014 14:22:39 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NFL005LFMPGWN80@mailout4.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 25 Nov 2014 14:24:52 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-b9-5474908f77ed Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 3D.9C.07834.F8094745; Tue, 25 Nov 2014 14:22:07 +0000 (GMT) Received: from [106.116.151.171] by eusync1.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NFL008M6MKUBZ40@eusync1.samsung.com>; Tue, 25 Nov 2014 14:22:07 +0000 (GMT) Message-id: <1416925325.26128.6.camel@AMDC1943> Subject: Re: [RFC 0/2] Fix Arndale Octa/Peach Pi boot on Audio subsystem clocks From: Krzysztof Kozlowski To: Javier Martinez Canillas Date: Tue, 25 Nov 2014 15:22:05 +0100 In-reply-to: <547485F5.50600@collabora.co.uk> References: <1416842312-4405-1-git-send-email-k.kozlowski@samsung.com> <54736AD0.4070909@collabora.co.uk> <1416907375.5023.54.camel@AMDC1943> <547485F5.50600@collabora.co.uk> Content-type: multipart/mixed; boundary="=-t4KcOohHTQ3Z+aShKAkE" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphkeLIzCtJLcpLzFFi42I5/e/4Zd3+CSUhBktPSlu0XTnIbnH0d4FF /+PXzBZPNz9mstj0+BqrxeVdc9gsZpzfx2TxdMJFNovDb9pZLVbt+sPowOXx9/l1Fo+ds+6y e2xa1cnmcefaHjaPzUvqPfq2rGL0+LxJLoA9issmJTUnsyy1SN8ugSvj2LRO1oKZxhXz9k9k bmDcrNHFyMkhIWAisfDLJCYIW0ziwr31bCC2kMBSRonb6/i6GLmA7M+MEiuurgFL8AroS7Qf f8MOYgsL+EtsmjiPBcRmEzCW2Lx8CViNiICdxI3VD5lBmpkFbjBJPLh0mLWLkYODRUBVYs4c Z5AaTgFdic+7O9ghFmxilHj++TzYUGYBB4kzGyczgdRLCChLNPa7QewVlPgx+R7LBEb+WUiq ZiFJQcQ1JVq3/2aHsOUltr+dwwxhx0msb7zMCmFnSDxYP4sFWc0CRvZVjKKppckFxUnpuYZ6 xYm5xaV56XrJ+bmbGCGx9WUH4+JjVocYBTgYlXh4DRJLQoRYE8uKK3MPMaoAzXm0YfUFRimW vPy8VCUR3qBeoDRvSmJlVWpRfnxRaU5q8SFGJg5OqQZGnayd/5edTJky5+Bz37iYjmUh+wRk Vd1au1LKDT2+2i3a+C13W/9+0/j/rIc+vvJrtoyaxszB5HPnxy3L29duWz3ziYmX/cdS7e97 wfbh48xmZa3Tbw5m/H0s2WNwsaVmyfXsz12r2Stex2s0/DnwK2LZtUNnE654nzVyD9kfJsny VKz98CEmJZbijERDLeai4kQAZsQ3dZcCAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141125_062238_459301_84649FBC X-CRM114-Status: GOOD ( 30.73 ) X-Spam-Score: -5.0 (-----) Cc: linux-samsung-soc@vger.kernel.org, Mike Turquette , Kevin Hilman , Tomasz Figa , linux-kernel@vger.kernel.org, Kukjin Kim , Vivek Gautam , Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On wto, 2014-11-25 at 14:36 +0100, Javier Martinez Canillas wrote: > Hello Krzysztof, > > On 11/25/2014 10:22 AM, Krzysztof Kozlowski wrote: > > > > Hmmm, that's strange. I've looked again at your dmesg and it is little > > different than mine (when system fails). > > 1. Does your PMIC come up? In your dmesg: > > [ 2.687297] max77802-pmic max77802-pmic: regulator init failed for 0 > > [ 2.693539] platform max77802-pmic: Driver max77802-pmic requests probe deferral > > > > The Peach Pit/Pi DTS define the parent input supplies for the max77802 PMIC > regulators and these are regulators from the tps65090 PMU but the max77802 > is probed before. When the system does not fail, the probe is deferred and > succeed later but I don't know when the system fails (more on that below). OK. > > > 2. In my case booting fails just after disabling unused clocks which is > > quite early, my dmesg: > > [ 11.700074] input: gpio_keys as /devices/platform/gpio_keys/input/input0 > > [ 11.704282] s3c-rtc 101e0000.rtc: setting system clock to 2029-01-11 19:19:17 UTC (1862853557) > > [ 11.770602] mmcblk0: mmc0:0001 M8G1WA 7.28 GiB > > [ 11.776201] mmcblk0boot0: mmc0:0001 M8G1WA partition 1 2.00 MiB > > [ 11.780968] mmcblk0boot1: mmc0:0001 M8G1WA partition 2 2.00 MiB > > [ 11.786823] mmcblk0rpmb: mmc0:0001 M8G1WA partition 3 128 KiB > > [ 11.793815] mmcblk0: p1 p2 p3 p4 > > [ 11.824165] PVDD_G3D_1V0: disabling > > [ 11.830833] PVDD_G3DS_1V0: disabling > > [ 11.837771] PVDD_HSIC_1V8: disabling > > [ 11.841172] PVDD_ABB_1V8: disabling > > [ 11.844866] PVDD_ANAIP_1V8: disabling > > [ 11.847157] usb 5-1.4: new high-speed USB device number 3 using exynos-ehci > > [ 11.848778] PVDD > > > > In your case you have a gap here: > > [ 3.624142] platform 12d10000.adc: Driver exynos-adc requests probe deferral > > [ 24.188722] random: nonblocking pool is initialized > > > > Could you try my patches once again but this time with enabled: > > DEBUG_EXYNOS_UART > > EARLY_PRINTK > > DEBUG_S3C_UART3 > > DEBUG_LL > > > > Yes, there is a gap and I don't know why. Even after enabling all those > config options, nothing is printed on the serial console after the exynos-adc > probe deferral. Only that message in drivers/char/random.c is printed but > nothing else is printed after all... You may try attached patch (very early printk) if you suspect that some logs are missing. > > > and with following change: > > > > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c > > index 4896ae9e23da..316856e55784 100644 > > --- a/drivers/clk/clk.c > > +++ b/drivers/clk/clk.c > > @@ -478,7 +478,9 @@ static void clk_disable_unused_subtree(struct clk *clk) > > * sequence. call .disable_unused if available, otherwise fall > > * back to .disable > > */ > > + pr_err("clk: checking %s\n", clk->name); > > if (__clk_is_enabled(clk)) { > > + pr_err("clk: enabled %s, disabling\n", clk->name); > > if (clk->ops->disable_unused) > > clk->ops->disable_unused(clk->hw); > > else if (clk->ops->disable) > > > > Without my patch the boot hangs: > > [ 12.230666] clk: checking dout_unipro > > [ 12.234304] clk: checking mout_unipro > > [ 12.237913] clk: checking sclk_usbd300 > > [ 12.241638] clk: enabled sclk_usbd300, disabling > > [ 12.246264] clk: checking dout_usbd300 > > [ 12.249992] clk: checking sclk_usbd301 > > [ 12.253683] clk: enabled sclk_usbd301, disabling > > [ 12.258309] clk: checking dout_usbd301 > > [ 12.262007] clk: checking sclk_maudio0 > > [ 12.265728] clk: enabled sclk_maudio0, disabling > > [ 12.270355] clk: checking pcm_bus > > > > because audss seems to be gated so kernel cannot access status of > > pcm_bus clock. > > > > I added those printk's but clk_disable_unused() is executed after the > exynos-adc probe function so the logs are not shown on the serial console. So this would mean that something fails before clk_disable_unused(). > As mentioned previously in the thread, Tushar's fix [0] works for me and with > that patch I see the clocks disabled by clk_disable_unused_subtree() and the > kernel is able to access pcm_bus and other audio clocks: > > [ 5.007368] clk: checking mout_spdif > [ 5.010908] clk: checking dout_audio0 > [ 5.014566] clk: checking mout_audio0 > [ 5.018208] clk: checking sclk_maudio0 > [ 5.021926] clk: enabled sclk_maudio0, disabling > [ 5.026541] clk: checking pcm_bus > [ 5.029820] clk: enabled pcm_bus, disabling > [ 5.034001] clk: checking sclk_pcm > [ 5.037367] clk: enabled sclk_pcm, disabling > > Any ideas? Yes, I got. On Peach board the i2s0 is enabled in DTS. Probing it could fail because it relies on enabling audss clocks (which cannot be accessed). I reproduced another hang on Arndale Octa after enabling i2s0 in DTS. Maybe that is the cause also on Peach. Best regards, Krzysztof From def8df7c5d8098ec1656c075701e9ba17f0617c9 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Thu, 6 Nov 2014 12:58:07 +0100 Subject: [PATCH] Very early printk, for next-20141106 (3.19?) Signed-off-by: Krzysztof Kozlowski --- kernel/printk/printk.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 1b7092dbb590..269318013504 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -1708,6 +1708,13 @@ asmlinkage int vprintk_emit(int facility, int level, } } + if (1) { + extern void printascii(const char *); + printascii(text); + printed_len = 0; + goto early_printk_out; + } + if (level == LOGLEVEL_DEFAULT) level = default_message_loglevel; @@ -1754,6 +1761,7 @@ asmlinkage int vprintk_emit(int facility, int level, dict, dictlen, text, text_len); } +early_printk_out: logbuf_cpu = UINT_MAX; raw_spin_unlock(&logbuf_lock); lockdep_on(); -- 1.9.1