Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp798968imm; Wed, 1 Aug 2018 05:36:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeBvbKZGEykWTsxUiezrrBZkvRB2GYzERZTw2woner8EwFoeSlnYloLhh1DU2TVw++jyhv7 X-Received: by 2002:a17:902:8303:: with SMTP id bd3-v6mr9423497plb.329.1533126995592; Wed, 01 Aug 2018 05:36:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533126995; cv=none; d=google.com; s=arc-20160816; b=UGOn1ccF8lZozJdFkOdtMbebGwAdsAE5/1G9r5Izemq5S3w4R1KxRpJBpF0UlwhsT1 Ne/IRXZngxeX8X6DiUVv3OiakQSuRiYjy+EL/CCp6IlEcZnn4S4QOd7R9V67dRRdlFgs W3nTokb/vRCUML0Hl0iTWPwz7wNZ214pguD8Yt8PGvgJ+8rFcWSap3jO2FREQbEB8auK 7pE7oAKi9dPsoAP1lBULaP2H7eDBarz/Cs/1Yv5jiqNvx+OHXh7mJlOhfH0ILK7RZKxv 9J572pVxk+XXfZC0kkeimsgTM4PBkrqYyLs8N4/XpXO36FFGaJSthbTrgY1cv+McEn9k hDHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:arc-authentication-results; bh=faaQ+DwaSkYvyfZQ2R8ChvatiKIGz1SC2HH7ZkalCfo=; b=UrW+JKrKfVqvOey/MHqo2Pe+dOBKXNGFOzu9QrHL2YMnv3ZBI+so0eM7RUTE2+dBA2 obZC33JHZ+cF7MQT32555SgYwWCeZaIALVnpOH6g4FiXWq5oYrE58bxTvAjEXHG36iV9 y0Xgax7SrPCAWUowBqNm6LuVj3d5njoM2R9jfFUpookA+QtOl4e3whIQSbb+gilZG4a2 NCOSkCw0GwMm0ZNcu4MiYO57AjeloHcKrtyi7MnCxUDvNeLM6vuTMpMHpnrf2wp3xqya j9nOUw2/qnAj/HkUV0pxDTt2hbxK1BZgC7vqKWQ8Re/C39oBSxpntBMhgGu0PDP0vW/p A2tQ== 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 s10-v6si14133276pgv.47.2018.08.01.05.36.21; Wed, 01 Aug 2018 05:36:35 -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 S2389204AbeHAOVJ (ORCPT + 99 others); Wed, 1 Aug 2018 10:21:09 -0400 Received: from mail-vk0-f68.google.com ([209.85.213.68]:45079 "EHLO mail-vk0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388896AbeHAOVH (ORCPT ); Wed, 1 Aug 2018 10:21:07 -0400 Received: by mail-vk0-f68.google.com with SMTP id b78-v6so9196655vka.12; Wed, 01 Aug 2018 05:35:32 -0700 (PDT) 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=faaQ+DwaSkYvyfZQ2R8ChvatiKIGz1SC2HH7ZkalCfo=; b=ZpmcykHepdTwN31jUEDVLH95VPczlKEWPXMJ3R1xmEK8MXwmAO85gODODWhsS5dKY7 Ilq3EECV7JUNwW3u6tUxN9vqM+tHgUYj4Z93C80blsCOybGDATGYns0rotqGZHLY3Sec D7kHiPCFE4y0+tt4OqtAdx7VBVx8WhwPcthYuG+47/RmMCYJBu6+Weqzdts4KCd9Bk+r BtwgF5b4cnRap0y7JPMX1GO79vQhpFGr4lgLIbXSfAbZ+L1OO+kehEzKhaM/QKGlrDRe f6/Qs1MoF00aVVHrWPu1uiKzrpn7z4NIa9GB4Mi7dRWIAlYjyDwdKWBC4XShfignH/bU WatQ== X-Gm-Message-State: AOUpUlGLh5PhVG/xQRhR/qCuiSBLRy/uqez+eNAut7kRhqRm+wv/TBTu wuLtGEwPFmahAmDtD1Axf2hYPvu58i6DHJgd1Nc= X-Received: by 2002:a1f:dd47:: with SMTP id u68-v6mr15777203vkg.137.1533126931568; Wed, 01 Aug 2018 05:35:31 -0700 (PDT) MIME-Version: 1.0 References: <1531924476-23261-1-git-send-email-phil.edworthy@renesas.com> In-Reply-To: From: Geert Uytterhoeven Date: Wed, 1 Aug 2018 14:35:19 +0200 Message-ID: Subject: Re: [PATCH] clk: renesas: r9a06g032: Avoid needless probe deferring To: Phil Edworthy Cc: Simon Horman , linux-clk , Linux Kernel Mailing List , Linux-Renesas , Jacopo Mondi Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Phil, CC Jacopo On Fri, Jul 20, 2018 at 3:57 PM Phil Edworthy wrote: > On 20 July 2018 13:41, Geert Uytterhoeven wrote: > > On Fri, Jul 20, 2018 at 2:26 PM Phil Edworthy wrote: > > > On 20 July 2018 13:12, Geert Uytterhoeven wrote: > > > > On Fri, Jul 20, 2018 at 2:06 PM Phil Edworthy wrote: > > > > > On 20 July 2018 12:21, Geert Uytterhoeven wrote: > > > > > > On Wed, Jul 18, 2018 at 4:34 PM Phil Edworthy wrote: > > > > > > > To avoid all SoC peripheral drivers deferring their probes, > > > > > > > both clock and pinctrl drivers should already be probed. Since > > > > > > > the pinctrl driver requires a clock to access the registers, > > > > > > > the clock driver should be probed before the pinctrl driver. > > > > > > > > > > > > > > Therefore, move the clock driver from subsys_initcall to > > core_initcall. > > > > > > > > > > > > > > Signed-off-by: Phil Edworthy > > > > > > > > > > > > Thanks for your patch! > > > > > Thanks for your review! > > > > > > > > > > > The (not yet upstreamed) pinctrl driver uses postcore_initcall(), right? > > > > > No, the pinctrl driver uses subsys_initcall, but postcore_initcall > > > > > or arch_initcall may be better to make it clear about the dependencies. > > > > > > > > if the pinctrl driver uses subsys_initcall(), ... > > > > > > > > > -subsys_initcall(r9a06g032_clocks_init); > > > > > > > +core_initcall(r9a06g032_clocks_init); > > > > > > > > ... using postcore_initcall() or arch_initcall() here, should work > > > > with platform_driver_probe()? > > > Nope, you have to use platform_driver_register() for DT based drivers. > > > subsys_initcall is the earliest you can use platform_driver_probe(). > > > > So drivers/misc/atmel_tclib.c and drivers/pinctrl/pinctrl-coh901.c, which use > > arch_initcall(), cannot work? > How those drivers work I do not know. However, I tried with the rzn1 clock > driver and it does not work. > > > If that is really true, you can still use subsys_initcall() in the clock driver, and > > subsys_initcall_sync() in the pinctrl driver. > True, I'm not sure how people decide which initcall to use and whether the > _sync variants of the initcalls have a special meaning or intention. As far as > I know they were introduced for threaded probes, so are we supposed to > use them for driver dependencies like this? > > Do you know why the rza1 pinctrl driver is running from core_initcall()? Probably because it can? Note that drivers/clk/renesas/clk-rz.c uses CLK_OF_DECLARE(). Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds