Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp998976imm; Wed, 25 Jul 2018 09:42:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcwMHKxzodSRmuL8gaGW7cBn5vJNcA+bdOERnHi4mx7mErg7p7LaoPkuaLfhDdOVFiFpGJE X-Received: by 2002:a62:4704:: with SMTP id u4-v6mr22820557pfa.76.1532536928895; Wed, 25 Jul 2018 09:42:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532536928; cv=none; d=google.com; s=arc-20160816; b=LzoIENeuEgCo6gcWDvb3bNpoMEvlVTs9mLrI2dbyonLtiKtF/EnJEhwx0AH38b5qTY iku/FP5ZcAs1UOo0+k+uwueiPLefM7LYT36JdXCEnfL//+9L6VM0MXJiF3uMszYcUBkU zHHf6lz3cimSsK/ftzDUpbbc8p71ZRCvVlWFNXajkIFNRPQHFHoqJ9tfs4KfDpY5nN9L DeAiXnCtS+mpCHSRvEaiYputntB22ePFMWQn2AQP304YHi6sCm+UfJV4NJFZUVqDhyIW J5W74IUxPZ/Mwc9c3w4m432kaydkFNgg5OoGCz09l3hrsl96atwPKN62DAytJA2oD1m7 dNYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=saqOiQtPwCP9wrT7ukjG2dtpz84XQq9SakSrXU0Ehhw=; b=xAON/tcWhyxH0q+53yegms+ADeCEtffWCioxMeFuIF4l41UVWiMBJH6bmRdLolu9yi ux4hAhrdTNH3yTkpB1WzFjnVNkReo+T86pCiLXTk8i9EA2biPn0Bw2H7b/wHKDXRpclt i/L+hdJj0+l0rZYUA9bKT0lK2HGQD0q4rkYntST4ztuFUevIrvQSrxQCLXaga9NdtBzG LNzDjgP9IGsxsPwmNdMtWM4mSLGtN5m1vc+xn9sj6TWZhA+YUAWXPaE2Ghm+6ObgVBfp Frmd8DThaLRe2KuJ5LR+V9UoKazbdj77mWlMoqhwVB2MbuhKWP/Zb9xH+6LH89l6Xurk ZwUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TEQueQZG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s10-v6si12552686pgv.47.2018.07.25.09.41.53; Wed, 25 Jul 2018 09:42:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TEQueQZG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731407AbeGYRxD (ORCPT + 99 others); Wed, 25 Jul 2018 13:53:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:55006 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729847AbeGYRxC (ORCPT ); Wed, 25 Jul 2018 13:53:02 -0400 Received: from localhost (unknown [104.132.1.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2D5BA20882; Wed, 25 Jul 2018 16:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532536835; bh=MgQIODeStXmnNf7VPafA43Qiw9AtESaoWbHgJnE8Amo=; h=To:From:In-Reply-To:Cc:References:Subject:Date:From; b=TEQueQZGIEOzOI53Q6O6CtUVO9bBMj1swUM6NQtBgatvwJJ8EQsxgVo1twOXFfW6C fP0Fz+3nqwvD/qqQrBy30oqdGuN09kc6A/OfRuhcfvH3hBQhrODeqKBbzBFBmPBtfq KBtfM1qFmUjkliItdV7ZmwwFx7OZyNYTqXhFvIoI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: Rajan Vaja , mturquette@baylibre.com From: Stephen Boyd In-Reply-To: <1531833420-27175-1-git-send-email-rajan.vaja@xilinx.com> Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Rajan Vaja References: <1531833420-27175-1-git-send-email-rajan.vaja@xilinx.com> Message-ID: <153253683456.48062.11538822357721957211@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: Re: [PATCH] clk: clk-fixed-factor: Clear OF_POPULATED flag in case of failure Date: Wed, 25 Jul 2018 09:40:34 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Rajan Vaja (2018-07-17 06:17:00) > Fixed factor clock has two initializations at of_clk_init() time > and during platform driver probe. Before of_clk_init() call, > node is marked as populated and so its probe never gets called. > = > During of_clk_init() fixed factor clock registration may fail if > any of its parent clock is not registered. In this case, it doesn't > get chance to retry registration from probe. Clear OF_POPULATED > flag if fixed factor clock registration fails so that clock > registration is attempted again from probe. > = > Signed-off-by: Rajan Vaja > --- > drivers/clk/clk-fixed-factor.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > = > diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-facto= r.c > index d72ef2d..f3ae4ff 100644 > --- a/drivers/clk/clk-fixed-factor.c > +++ b/drivers/clk/clk-fixed-factor.c > @@ -177,8 +177,15 @@ static struct clk *_of_fixed_factor_clk_setup(struct= device_node *node) > = > clk =3D clk_register_fixed_factor(NULL, clk_name, parent_name, fl= ags, > mult, div); > - if (IS_ERR(clk)) > + if (IS_ERR(clk)) { > + /* > + * If parent clock is not registered, registration would = fail. > + * Clear OF_POPULATED flag so that clock registration can= be > + * attempted again from probe function. > + */ > + of_node_clear_flag(node, OF_POPULATED); > return clk; > + } BTW, this patch was seriously mangled for me so I had to apply it by hand. Please be more careful next time and consider using something like git-send-email and git-format-patch to send patches.