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=-16.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 38B14C432BE for ; Fri, 20 Aug 2021 18:18:29 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4CE4E61101 for ; Fri, 20 Aug 2021 18:18:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4CE4E61101 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D549480796; Fri, 20 Aug 2021 20:18:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="B5dYTz6C"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2E8AF80C85; Fri, 20 Aug 2021 20:18:24 +0200 (CEST) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 47AA7800BF for ; Fri, 20 Aug 2021 20:18:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-wm1-x332.google.com with SMTP id g138so6443294wmg.4 for ; Fri, 20 Aug 2021 11:18:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=59kmoLMJPLidnA5sr6IWVQ2jBuUS0MQ9syWdjkuhmb4=; b=B5dYTz6CgyCDbI2V84OZujpwITWptpsnxKxqeKiPBgMTGPrAoQjhgOBaywVK/i5GNP IP9yIeuPV7SbKlO+iVfP1OI3AOeojxJE0eP73Keag3Mkxbu8+wk1wKc0v15n61NZrF11 /Hlm8DlJMFBlhTEV46KmkwYe6os2MUgsexpVA= 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; bh=59kmoLMJPLidnA5sr6IWVQ2jBuUS0MQ9syWdjkuhmb4=; b=X4cuYkI19/AA1g//uP1SrVm2fr+Vqij0g251JIsvzyPdXl1Zdyg7W0uyAUR4Q0eiOH TqJXqU3hK3B2rNNWwas4v+vKINoJbMtPYaR6rIWtF4+lrIbSecqwf6VdlAPBGZRamvAP yLa2wSgcYbrgOKFByLkUgZCPaut8LKFxacAnvbHf9VTxo5TgTr+n6lq+qoKn3YBtXwoP Y0mu/HLj9Cf8MKEfnhuXjTW5xdp+TaXPPQDikl7O5RZSksXC1e4ZVLrYIdy3V8VHdMAS lgwpKYi72dRvgsWjlgWWIKCsJAkhY2e2tNFUGZJRw0HQh4mdUAY7kzo+eNKc2IxjOoaT jWUQ== X-Gm-Message-State: AOAM532PovF4VGPdaVhndpVL6qmbBE03FnHW3ZFHB3vKNdH7SHGnDgmR 1pEZEg0j4njr9mrvBs0UkUej1KS5rcKjPT565wX34w== X-Google-Smtp-Source: ABdhPJzCApe9AeRwgnbwasK+7ZUgzutoHrvzoiWDbocpeBMiqsh20czV0IsCe87fVjN1EoYDDixte3i/Lmq9JSrClV0= X-Received: by 2002:a05:600c:4656:: with SMTP id n22mr1071504wmo.74.1629483498503; Fri, 20 Aug 2021 11:18:18 -0700 (PDT) MIME-Version: 1.0 References: <20210513193923.v2.1.I85633a7354c5b2ad5c55257607280392d069d70c@changeid> <20210514014011.2832707-13-sjg@chromium.org> <26a69021b0b97660de32a699f4cd2e50911a75b6.camel@nedap.com> In-Reply-To: <26a69021b0b97660de32a699f4cd2e50911a75b6.camel@nedap.com> From: Simon Glass Date: Fri, 20 Aug 2021 12:18:07 -0600 Message-ID: Subject: Re: [PATCH v2 15/16] clk: Detect failure to set defaults To: Harm Berntsen Cc: "u-boot@lists.denx.de" , "trini@konsulko.com" Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hi Harm, On Wed, 18 Aug 2021 at 08:09, Harm Berntsen wrote: > > On Thu, 2021-05-13 at 19:39 -0600, Simon Glass wrote: > > When the default clocks cannot be set, the clock is silently probed and > > the error is ignored. This is incorrect, since having the clocks at the > > correct speed may be important for operation of the system. > > > > Fix it by checking the return code. > > > > Signed-off-by: Simon Glass > > --- > > > > (no changes since v1) > > > > drivers/clk/clk-uclass.c | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c > > index 4ab3c402ed8..2a2e1cfbd61 100644 > > --- a/drivers/clk/clk-uclass.c > > +++ b/drivers/clk/clk-uclass.c > > @@ -796,13 +796,17 @@ void devm_clk_put(struct udevice *dev, struct clk > > *clk) > > > > int clk_uclass_post_probe(struct udevice *dev) > > { > > + int ret; > > + > > /* > > * when a clock provider is probed. Call clk_set_defaults() > > * also after the device is probed. This takes care of cases > > * where the DT is used to setup default parents and rates > > * using assigned-clocks > > */ > > - clk_set_defaults(dev, 1); > > + ret = clk_set_defaults(dev, 1); > > + if (ret) > > + return log_ret(ret); > > > > return 0; > > } > > Note that this patch broke booting my imx8mn based board on U-Boot > v2021.10-rc2. The failure is due to the clock-controller@30380000 > configuration in the imx8mn.dtsi file. I had to remove the following > clocks from the device tree to get my device to boot again (all from > the assigned-clocks of clock-controller@30380000): > > <&clk IMX8MN_CLK_A53_CORE>, > <&clk IMX8MN_CLK_NOC>, > <&clk IMX8MN_CLK_AUDIO_AHB>, > <&clk IMX8MN_CLK_IPG_AUDIO_ROOT>, > <&clk IMX8MN_SYS_PLL3>, > <&clk IMX8MN_AUDIO_PLL1>, > <&clk IMX8MN_AUDIO_PLL2>; > > I looked into the clk-imx8mn.c code and I see that we indeed miss > clocks there. Unfortunately I could not port code from the Linux > kernel: we are missing the imx_clk_hw_mux2 function for the > IMX8MN_CLK_A53_CORE clock. I did not look into the other clocks. Perhaps the iMX maintainer could help with this? It does sound like a bug. Regards, SImon > > > -- Harm