Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2749667imm; Fri, 20 Jul 2018 04:22:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdVXj+kon5D71CgX1pssHIiSM0P7SHwPZTICQNoJIg5Gf7MHCMypaFW3WJkK/XAqjD54AGd X-Received: by 2002:a62:c1:: with SMTP id 184-v6mr1823375pfa.100.1532085722286; Fri, 20 Jul 2018 04:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532085722; cv=none; d=google.com; s=arc-20160816; b=AH7ju/6KgYxKLU+JCd078D5mUFexH+WJKYPD+3CbxA3Ze5Exe3tstfPKMS/hxzzH/j j+WyG1Siu2EsWPqll4Si8zxjSpEwLDHKJ1rYjQuDFp/fxcgq8HZOnCvekN34GT1+qvd7 ezkUWBUSAnDpUv1DuONqZrNuv+DiihGqCJ8DIos3lTBMZGYN8ybUp98sBCPkaMMhNKGa M+XEtpuaOaakxgP8Ma9TiUgBciwFWMdp+SG19tzSzZeBPTcLy8SLW9d99EiP+o3vNN6Y RszdlrXa3+LELm4DX6hlPtlA99VeTlH/bB/0wJ+06DkGHICHxyVIIWbTpLN7mNER+eKi skIA== 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=ghSroxoWTK03RFoqcvvCJU54uWCsfJ2cPVLLv+hH8PI=; b=LXiyGgeR8Hxdhl8hUtypUqh4CMFnJLFmyB6+9aopAkE2MaWtt2IRB/ps7unpmvllgO kns6BwjwjzGot5kTPJL+xQeZiPdOg6VHrV4glO89AVzMeZp/z/7EmYiE9K2JkacOLeOs HE9H++kM2c02uYkqN4tKcH83Ivv0sroH1zzP8OjQzi9HxtecZqGd4Kr2n6qCj+YP8h1c w2yqNFDcOVCorT/xDFYVhJRC7c80G4c7G6vrcdoS/UhEs0dj8q4qC/d0HgPfwhWx2agN iwx//L9q3hr2OAedIN/uR755MDRuwn/PmVt4XWiugtNeLFm6S+nUNFiJRlvNrsGLvF4M JLUQ== 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 x16-v6si1427231pln.165.2018.07.20.04.21.47; Fri, 20 Jul 2018 04:22:02 -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 S1729824AbeGTMJA (ORCPT + 99 others); Fri, 20 Jul 2018 08:09:00 -0400 Received: from mail-ua0-f194.google.com ([209.85.217.194]:33589 "EHLO mail-ua0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727233AbeGTMJA (ORCPT ); Fri, 20 Jul 2018 08:09:00 -0400 Received: by mail-ua0-f194.google.com with SMTP id i4-v6so7236379uak.0; Fri, 20 Jul 2018 04:21:13 -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=ghSroxoWTK03RFoqcvvCJU54uWCsfJ2cPVLLv+hH8PI=; b=BzYXUncmbvdTKTmCz9t6iBG0wsjjm6WOCiMb01bR0JrHgI0g515H6uTuI/Ao9MNYrA zJXsZAi2e5EWv87TzyOr1e/AiHLeYOB+zq+AdlQt6Z8lLgQo/2TGutTibhs+pJPfxwUZ 1qqDu7Vib5bFz7FmfLZ+xLBZ17fL9O94E+D6WS2nLcR5KoBVDOXnL1L/yAif7qMTjNxT IDwB9tKK6TAYN09hYtqjr8BZPKPK+qX/OKAMpLgiwh+ZIL54fI0S6sIHDgLKHEa8qpyK /BbhyCWfMYDi8MmCqAvjSRuhUOuzPxlX2LhgWu1eZrf4pskFF2zv3a9XEZIclCO3h9Sj JZ7w== X-Gm-Message-State: AOUpUlEOs8p6M+VbZ50pLjhV7QToQdwOT7GK4Y8p+TuLe9YqgqDjUOxE gompklvq/KqKKUhR5SsKkyRL789EommhfDpJXUlDx78Q X-Received: by 2002:ab0:4025:: with SMTP id h34-v6mr1034526uad.12.1532085673173; Fri, 20 Jul 2018 04:21:13 -0700 (PDT) MIME-Version: 1.0 References: <1531924476-23261-1-git-send-email-phil.edworthy@renesas.com> In-Reply-To: <1531924476-23261-1-git-send-email-phil.edworthy@renesas.com> From: Geert Uytterhoeven Date: Fri, 20 Jul 2018 13:21:01 +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 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, 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! The (not yet upstreamed) pinctrl driver uses postcore_initcall(), right? > --- a/drivers/clk/renesas/r9a06g032-clocks.c > +++ b/drivers/clk/renesas/r9a06g032-clocks.c > @@ -877,17 +877,18 @@ static const struct of_device_id r9a06g032_match[] = { > { } > }; > > -static struct platform_driver r9a06g032_clock_driver = { > +static struct platform_driver r9a06g032_clock_driver __refdata = { > .driver = { > .name = "renesas,r9a06g032-sysctrl", > .of_match_table = r9a06g032_match, > }, > + .probe = r9a06g032_clocks_probe, > }; > > static int __init r9a06g032_clocks_init(void) > { > - return platform_driver_probe(&r9a06g032_clock_driver, > - r9a06g032_clocks_probe); > + platform_driver_register(&r9a06g032_clock_driver); > + return 0; > } Why are all of the above changes needed? Shouldn't the platform_driver_probe() keep on working? If it does not, it means the clock driver has some other dependency, and cannot be bound immediately. This is potentially a dangerous situation, as r9a06g032_clocks_probe() is __init, but can still be called at any time later. Hence using platform_driver_probe() is the safe thing to do, possibly with a different reshuffling of the clock and pinctrl initcall priorities. > -subsys_initcall(r9a06g032_clocks_init); > +core_initcall(r9a06g032_clocks_init); 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