From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FBD0C433FF for ; Mon, 29 Jul 2019 06:51:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D2735206BA for ; Mon, 29 Jul 2019 06:51:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HkFo8r+M" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726991AbfG2Gvg (ORCPT ); Mon, 29 Jul 2019 02:51:36 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44934 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725934AbfG2Gvg (ORCPT ); Mon, 29 Jul 2019 02:51:36 -0400 Received: by mail-wr1-f68.google.com with SMTP id p17so60465014wrf.11; Sun, 28 Jul 2019 23:51:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=v90YPXKI4GUWpeIkXpR1C/gf5jGZt8lyB8cJkCXtAs4=; b=HkFo8r+Mhc+dka46pBgHKGgOw300fimW1/wLqx0AmkfjaZpUky+65lpB0YHCCHXq8I DNUww9oNMwYxY56VcouIsLPOlKK3SktU6LgDv4UEFjwyqkz2b/P5+ScZt0H3eGTJW3A2 8003IepoQ+HaHMZ1Z7331VSbRmg8wg2JAvu997kFwUJm9mWpki0eGK7K7n4tLuqI5p29 m4u99JVqEfPTKWF27b8F+WOXiMZNnnjKinn2mo9MNgxmdPZqH6GC+9vrKUkXfmWWUv+O w2BxlKjy43/0WUQNjClkBMCBZb43GasqxlgND/BF43ZnnOjHqHKsfiSduFdo0Ke3XSTB 1KPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=v90YPXKI4GUWpeIkXpR1C/gf5jGZt8lyB8cJkCXtAs4=; b=Nqgos51BIcnJAMH7fvw9mtL0W0ZMNiwRHkKJaQPYoHKoG+fqExUwa28WclTUfr+Nvh 1O3pf3Tpfz/0GdEMVGl4zeDX8Z4QquUzQxpFv9ELZG1K2IPbXw9u+OuOT3n8+z9DZecu B3r7vWU+L3C1knfT8ayDCdNdyrKG67ie9yY5ZBkVYoC59QIfEIrlUj8cuH7rdtxBOL7c 8eZo7zQywAIWjrpp7ZyllW/9PmoeVfv03SgLANQG4pAPKSXZGZwUt/I6B+u53UfQ4NS7 Wc+YdW17+pbRdB0+nzCTjWM7qp3KK7Lc+ygisj1lQjRbyq9shVkXcNrGqBfcoihvmxXD LHLA== X-Gm-Message-State: APjAAAXftNOqzJcMGis4JXPi6XKCCd/jBqMaC9Yi9vHbMFmwxKaVFFcx xaWKBQ6Z5oe87s8IzCA703r3Fb4GdGrQMchPtTs= X-Google-Smtp-Source: APXvYqyv4uaMyeWcmvjY2UgFAZuoyar5QPXZqVXSg2irz44SilVKKkvVl6fLEdJb4ibwa0xYbImEpjtIbRtvw/3pXqY= X-Received: by 2002:a05:6000:14b:: with SMTP id r11mr44289431wrx.196.1564383092966; Sun, 28 Jul 2019 23:51:32 -0700 (PDT) MIME-Version: 1.0 References: <20190705045612.27665-1-Anson.Huang@nxp.com> <20190705045612.27665-5-Anson.Huang@nxp.com> <20190727161736.4dkfqgwftre67v56@fsr-ub1664-175> In-Reply-To: From: Daniel Baluta Date: Mon, 29 Jul 2019 09:51:21 +0300 Message-ID: Subject: Re: [PATCH 5/6] clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT To: Anson Huang Cc: Abel Vesa , "rui.zhang@intel.com" , "edubezval@gmail.com" , "daniel.lezcano@linaro.org" , Rob Herring , Mark Rutland , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Michael Turquette , Stephen Boyd , Lucas Stach , Andrey Smirnov , "Angus Ainslie (Purism)" , Carlo Caione , =?UTF-8?Q?Guido_G=C3=BCnther?= , Leonard Crestez , "linux-pm@vger.kernel.org" , Devicetree List , Linux Kernel Mailing List , linux-arm-kernel , "linux-clk@vger.kernel.org" , dl-linux-imx Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 29, 2019 at 4:29 AM Anson Huang wrote: > > Hi, Abel/Daniel > > > On 19-07-27 09:33:10, Daniel Baluta wrote: > > > On Sat, Jul 27, 2019 at 9:19 AM Anson Huang > > wrote: > > > > > > > > Hi, Daniel > > > > > > > > > Subject: Re: [PATCH 5/6] clk: imx8mq: Remove CLK_IS_CRITICAL flag > > > > > for IMX8MQ_CLK_TMU_ROOT > > > > > > > > > > Hi all, > > > > > > > > > > latest linux-next hangs at boot. > > > > > > > > > > commit fde50b96be821ac9673a7e00847cc4605bd88f34 (HEAD -> > > master, tag: > > > > > next-20190726, origin/master, origin/HEAD) > > > > > Author: Stephen Rothwell > > > > > Date: Fri Jul 26 15:18:02 2019 +1000 > > > > > > > > > > Add linux-next specific files for 20190726 > > > > > > > > > > Signed-off-by: Stephen Rothwell > > > > > > > > > > > > > > > I know this is crazy but reverting commit: > > > > > > > > > > commit 431bdd1df48ee2896ea9980d9153e3aeaf0c81ef > > (refs/bisect/bad) > > > > > Author: Anson Huang > > > > > Date: Fri Jul 5 12:56:11 2019 +0800 > > > > > > > > > > clk: imx8mq: Remove CLK_IS_CRITICAL flag for > > > > > IMX8MQ_CLK_TMU_ROOT > > > > > > > > > > IMX8MQ_CLK_TMU_ROOT is ONLY used for thermal module, the > > driver > > > > > should manage this clock, so no need to have CLK_IS_CRITICAL = flag > > > > > set. > > > > > > > > > > > > > > > > > > > > makes the boot work again. > > > > > > > > > > Any idea? > > > > > > > > I just found if disabling SDMA1, then kernel can boot up, it does > > > > NOT make sense TMU clock is related to SDMA1, I will check with des= ign > > and get back to you soon. > > > > > > > > > > Hi Anson, > > > > > > Applying Abel's patch: > > > > > > commit 8816c47db6a82f55bb4d64f62fd9dd3af680f0e4 (HEAD -> master) > > > Author: Abel Vesa > > > Date: Tue Jun 25 12:01:56 2019 +0300 > > > > > > clk: imx8mq: Mark AHB clock as critical > > > > > > Keep the AHB clock always on since there is no driver to control = it and > > > all the other clocks that use it as parent rely on it being alway= s enabled. > > > > > > > > > > > > The kernel boots up again. > > > > > > It make some sense. I don't understand though why having > > > IMX8MQ_CLK_TMU_ROOT as critical also "unhangs" the kernel. > > > > > > > OK, so this is how it works. > > > > By removing the critical flag from TMU, the AHB doesn't stay always on. > > With my patch the AHB is marked as critical and therefore stays on. > > > > The sdma1_clk has as parent the ipg_root which in turn has as parent th= e > > ahb clock. And I think what happens is some read from the sdma register= s > > hangs because, for whatever reason, enabling the sdma1_clk doesn't > > propagate to enable the ahb clock. I might be wrong though. > > > > I can explain why Abel's patch can fix this issue, the AHB clock is a MUS= T > always ON for system bus, while it does NOT have CLK_IS_CRITICAL flag set= for now, > when SDMA1 is probed, it will enable its clock, and the clk path is sdma1= _clk->ipg_root->ahb, > after SDMA1 probed done, it will disable its clock since no one use it, a= nd it will trigger > the ahb clock to be OFF, as its usecount is added by 1 when probe and dec= reased by 1 after > SDMA1 probe done, so usecount=3D0 will trigger AHB clock to be OFF. > > So I think the best solution should be applying Abel's patch as you menti= oned upper, the TMU > clock patch is NOT the root cause, it just triggers this issue accidently= =E2=98=B9 > > But I saw Abel's AHB patch is still under discussion, so I think we need = to speed it up and make > kernel boot up work for development. AHB/IPG are always critical for i.MX= SoCs. Thanks Anson, Your explanation makes a lot of sense. We will take care today of Abel's pa= tch. What do you think about Fabio's patch? I also think this is a valid patch: http://code.bulix.org/pd88jp-812381