Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2499355imm; Mon, 24 Sep 2018 05:31:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV61KlA6oGRy5e7IRmvkaxdOa31QlXDD60Ac2CQkWkks9U3xkCOc+MDsb1hTpEZC7GtkTw0Vm X-Received: by 2002:a63:525c:: with SMTP id s28-v6mr9315844pgl.78.1537792270758; Mon, 24 Sep 2018 05:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792270; cv=none; d=google.com; s=arc-20160816; b=n+35Zrdo7GnzNE5kVdgVwz17GSkfX6/EYXh9Zyw0CQQPQ5a5y9Vda5uesDaWFTSUue 7MpccYnw0jr6NPjCpamHZrwMKGmIZ5Bqf86lT/1KsBDSuqlSjmPkQ/7asrgkdBdlTZsi HuZINlUGbi6tP+NbzG1VOulonXBT4YF8TzrhnD1ZNQyl1QBVXaUh3OgPS93pO6djDbtU HQI4raySncTvvQTBbtjMGdzp+cj2wAlgF7ye95WaqwlL2J3OlFFxKoKG+yNzVXFuYhSr udSeGw5AWEH6xqk5zHlBa7dwEqykPz9lBMdltXxFZhTQ3rnxdWD24N7jfWbxQFm1Tpjq iEjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=haxF3E+C1lsGNS8Fvm7Fr3knzQgT4Gs6ksiRgLm0fLw=; b=nRpTmTt5ziRjVsxpQnHMZ8LYpucDFGQZX/FD3b4Xzc9vjpM/6lvxxeoABG3ttNZLPT Obx5KernB7bzTKNpuj/xe0UP2T7vyQ0hw17kotsF9NYJJEnsVJl8Shcxh865jjdhg4SP 1rmLCf1lBSqPxSXEO0Ttz7r0pGwCM76Q0GVeMv9HoILO2JhVcBe9S8NNwyMC9rMvid9I UvH25/C1QO8wOHqehaMVY8EsL0m0R3B9HaxBHQduuXzYnsUuhpSq0T2MKH0AJhpB36df wt0I9BwopQOtjRX9jMo21ua75VyaaUv6iQ/+X3aQw2ME04esdTPsIl34JIvCt+wgdzA2 6fCQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21-v6si34689005pgk.418.2018.09.24.05.30.55; Mon, 24 Sep 2018 05:31:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387566AbeIXSa0 (ORCPT + 99 others); Mon, 24 Sep 2018 14:30:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57462 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730233AbeIXSaZ (ORCPT ); Mon, 24 Sep 2018 14:30:25 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 5764F1018; Mon, 24 Sep 2018 12:28:31 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rajan Vaja , Stephen Boyd , Sasha Levin Subject: [PATCH 4.18 033/235] clk: clk-fixed-factor: Clear OF_POPULATED flag in case of failure Date: Mon, 24 Sep 2018 13:50:19 +0200 Message-Id: <20180924113108.273112386@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rajan Vaja [ Upstream commit f6dab4233d6b64d719109040503b567f71fbfa01 ] 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 Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/clk/clk-fixed-factor.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- 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_ clk = clk_register_fixed_factor(NULL, clk_name, parent_name, flags, 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; + } ret = of_clk_add_provider(node, of_clk_src_simple_get, clk); if (ret) {