From patchwork Thu Nov 9 09:15:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 118414 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp6344972qgn; Thu, 9 Nov 2017 01:15:57 -0800 (PST) X-Google-Smtp-Source: ABhQp+QKY5/VBARoZZ9dA0wUAlVl1w/F8o9FIQ3mYGENcZ0QMq8gYrZ+013whqIUgxQ48aYaxi+I X-Received: by 10.98.196.143 with SMTP id h15mr3466262pfk.126.1510218957428; Thu, 09 Nov 2017 01:15:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510218957; cv=none; d=google.com; s=arc-20160816; b=IlkcN+vxb7ISLLEmdDpH/Vlw2IMIRSIvJYlcDMDNezAWez6K1AMxl+v10BDNkN48P6 MJablttJ6jY4U1Be3S9Tykgpzq+BFnsD0tTS9E3FyYqbd3s5t4PAt/sVSWbj+T5BzoE8 fzgdkM/EWhAxZdD8FtGeHchWrogTtb3ww5GGfLrl/0VStXL4yQdcrljRuhwgBau4bOgX movIWY1bKLUkG+kxcT9bfgHImTo4RfHNlhbRWMJhlJvRPe1Afqx49ld7OeCI52r7hQt5 p2MA1CL0h/tcz1VjOtDi4PTJo8cxp97wRQKDI10AOhh1XOF76W0CsJXHawhIX8tRyQ59 wonQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=2JBriqELmUncZCHa74TOvzx8a5I8GReleQsZIre1L6g=; b=pDdIAJCXUBd677pza9G3j1dkQCbHTmVH/1QTqcIRKvcg7ZNtRchTVtmaNtQJtiEJls xAAZ2gMRc2hwmbkVqzcotI1XvgtJlZE+bJwQfpctsm61tFFyCN8p2en7/MaPi8Rttp1o nDdYF7/rdr1HHROn4/lMzPa26sM3hvrWKJAnzSd/9SjBi34NYTgFhcU44KkxIjmURCq4 A7ZpSucCnsSoQtUv2Y+2Hyjg4Ur7KytD06s7qTh1OLWQ65Vm+PyI1hVjDcI41uwJlSwN PxEt+by7t4Ax3R6beGLk6dpd2PPI8S59tl8lVTGYzgTvnK15y2f1dHC6o9nSTznB4BXL KU7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=TKD8kwZw; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si5770893pgt.604.2017.11.09.01.15.57; Thu, 09 Nov 2017 01:15:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=TKD8kwZw; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753920AbdKIJPu (ORCPT + 4 others); Thu, 9 Nov 2017 04:15:50 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:43745 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753933AbdKIJPp (ORCPT ); Thu, 9 Nov 2017 04:15:45 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id vA99Fhw0030355; Thu, 9 Nov 2017 03:15:43 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1510218943; bh=jwPSNMdLqW8LgY12nKpBlGUB82f33zsIaHpfpr0mDp8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=TKD8kwZwYn2uru0mfTop4YcwyFh40iSYRLUtcc3h9XZEBiTMOhMoQDrxl5VBTVztu 2Ujgg0oqdAXoYaeWf1/3Vejgd7YBxJBtz+VFjvXTpyRcWw05dP/2uikXA3R9dbPIp2 0Xhr7Xspm3ugno77uKrcQQLNp104G3y2W5DP4/q0= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id vA99FhCR024035; Thu, 9 Nov 2017 03:15:43 -0600 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Thu, 9 Nov 2017 03:15:42 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Thu, 9 Nov 2017 03:15:42 -0600 Received: from gomoku.home (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id vA99FWbs012718; Thu, 9 Nov 2017 03:15:41 -0600 From: Tero Kristo To: , CC: , , Subject: [PATCHv2 06/28] clk: ti: clkctrl: add support for retrying failed init Date: Thu, 9 Nov 2017 11:15:16 +0200 Message-ID: <1510218917-1725-4-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1510218917-1725-1-git-send-email-t-kristo@ti.com> References: <1510218917-1725-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org In case the clkctrl node contains assigned-clock-* entries, registering the provider can fail with -EPROBE_DEFER. In this case, add the provider to the retry_init clock list so it will be cleaned up later. Signed-off-by: Tero Kristo --- drivers/clk/ti/clkctrl.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 1.9.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Stephen Boyd diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c index 38dbcc1..7d82fff 100644 --- a/drivers/clk/ti/clkctrl.c +++ b/drivers/clk/ti/clkctrl.c @@ -414,6 +414,12 @@ static struct clk_hw *_ti_omap4_clkctrl_xlate(struct of_phandle_args *clkspec, } } +static void __init _clkctrl_add_provider(void *data, + struct device_node *np) +{ + of_clk_add_hw_provider(np, _ti_omap4_clkctrl_xlate, data); +} + static void __init _ti_omap4_clkctrl_setup(struct device_node *node) { struct omap_clkctrl_provider *provider; @@ -425,6 +431,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) struct omap_clkctrl_clk *clkctrl_clk; const __be32 *addrp; u32 addr; + int ret; addrp = of_get_address(node, 0, NULL, NULL); addr = (u32)of_translate_address(node, addrp); @@ -519,7 +526,10 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) reg_data++; } - of_clk_add_hw_provider(node, _ti_omap4_clkctrl_xlate, provider); + ret = of_clk_add_hw_provider(node, _ti_omap4_clkctrl_xlate, provider); + if (ret == -EPROBE_DEFER) + ti_clk_retry_init(node, provider, _clkctrl_add_provider); + return; cleanup: