Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1986588imm; Thu, 2 Aug 2018 04:33:09 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe4LHnoBf1bL9eTdmBKlDEhRoz6thNuirL/0p8lnYLCBuzw/zma3wV1O2JAl2fw8c97Y8/0 X-Received: by 2002:a17:902:64d7:: with SMTP id y23-v6mr2029116pli.53.1533209589137; Thu, 02 Aug 2018 04:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533209589; cv=none; d=google.com; s=arc-20160816; b=VnycSMFW/OBj3rgHomM0iKG/7Ccah/bChX2y6ZS0PzL6hN8AUK9K+HLzsSImm7Wgab nFApJAE4Ol09tU9rglGk+7NoPqbAsf/hPlTIRpcZXRGLuTVgMpVHxv7cM5j+TzFHbWJ+ Ft1oqXxmTTqQ8x8j8fiPqDfhcXXayqEjWmlu46yv7WRQDY4Af7qNeMsb8VjV1YnyoGNF N2n/nCOMxkMu9ylCAHkGRXil40i2ROKdLcWgRk71MWgluPX+OdvmKWHWbP/Gq6vCQlfr D0l1WNgKjEqi//WMW/dy3ZxHapzv1eDUDO9tlTyp34ei1KlG+Kwkrt+E+F80Y0GSoW0V mIUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=yZSBUeD+CS+p5XaryCa+J//p6fEF2SQJ9s4ukuXLGQw=; b=natFn366INbl5CoyH/tmx++rHSI+R1KcSjFFNlxBfnOvos7ZMf9Sakw8YGh1xQJRQR mhoS13sGHBbkjBdbrKOUblM+DgH6kVQKHLzTH2fo8ikJr9CMlJ/fZf3eh//UPRpqEZYE BBKOE8LqxkYwWUNsbx3NFhcpR1ZYUpMS29lydvYlm2upU8Kkgq66WR/IlMBtCuPW36eZ UOyY7CnbihKOsfKZeZ+RbbQLWea0eRNs1wSkURgoclQSnvG3RODNFOjQZ828WhHTyVE/ 8V9TNit4viP6+hKC1SpgCylQKvEb6nlUG4hELa1jIk+QdMxBDsxdA0kx7naX24Pods0W h82g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b="PPYgGdB/"; 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 w71-v6si1736831pgd.667.2018.08.02.04.32.54; Thu, 02 Aug 2018 04:33:09 -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=@agner.ch header.s=dkim header.b="PPYgGdB/"; 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 S1732273AbeHBNWT (ORCPT + 99 others); Thu, 2 Aug 2018 09:22:19 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:49288 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731083AbeHBNWT (ORCPT ); Thu, 2 Aug 2018 09:22:19 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id BF8C45C08AE; Thu, 2 Aug 2018 13:31:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1533209492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yZSBUeD+CS+p5XaryCa+J//p6fEF2SQJ9s4ukuXLGQw=; b=PPYgGdB/NVttiZ2DNbqFQE8Wf0owU6z/VuONKBoKhr6/SpWL5WMKKUZ1KZZNnWQryxjNRS dZhH51lROdeOMugOqQ7RMilwcTMz3YZV47BT4b6s5pVtbR3N823ilNCeADUiocfeWl4N+v UcqvQp0j7W0swlYCjekOLURHpcmXY6g= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Thu, 02 Aug 2018 13:31:32 +0200 From: Stefan Agner To: Dmitry Osipenko Cc: Linus Walleij , Thierry Reding , Jonathan Hunter , Marcel Ziswiler , linux-tegra@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/2] pinctrl: tegra: Move drivers registration to arch_init level In-Reply-To: <20180802111144.12512-1-digetx@gmail.com> References: <20180802111144.12512-1-digetx@gmail.com> Message-ID: <20a52a0461e32e776e526171c250551a@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02.08.2018 13:11, Dmitry Osipenko wrote: > There is a bug in regards to deferred probing within the drivers core > that causes GPIO-driver to suspend after its users. The bug appears if > GPIO-driver probe is getting deferred, which happens after introducing > dependency on PINCTRL-driver for the GPIO-driver by defining "gpio-ranges" > property in device-tree. The bug in the drivers core is old (more than 4 > years now) and is well known, unfortunately there is no easy fix for it. > The good news is that we can workaround the deferred probe issue by > changing GPIO / PINCTRL drivers registration order and hence by moving > PINCTRL driver registration to the arch_init level and GPIO to the > subsys_init. A while back at least using those init lists were not well received even for GPIO/pinctrl drivers: https://lore.kernel.org/lkml/CACRpkdYk0zW12qNXgOstTLmdVDYacu0Un+8quTN+J_azOic7AA@mail.gmail.com/T/#mf0596982324a6489b5537b0531ac5aed60a316ba I still think we should make an exception for GPIO/pinctrl and use earlier initcalls. Platform GPIO/pinctrl drivers provide basic infrastructure often used by many other drivers, we want to have them loaded early. It avoids unnecessary EPROBE_DEFER and hence probably even boots faster. And in this case it even resolves real world issues. This should definitely go in, at least as a stop gap solution. Acked-by: Stefan Agner -- Stefan > > Signed-off-by: Dmitry Osipenko > --- > drivers/pinctrl/tegra/pinctrl-tegra114.c | 7 ++++++- > drivers/pinctrl/tegra/pinctrl-tegra124.c | 7 ++++++- > drivers/pinctrl/tegra/pinctrl-tegra20.c | 7 ++++++- > drivers/pinctrl/tegra/pinctrl-tegra210.c | 7 ++++++- > drivers/pinctrl/tegra/pinctrl-tegra30.c | 7 ++++++- > 5 files changed, 30 insertions(+), 5 deletions(-) > > diff --git a/drivers/pinctrl/tegra/pinctrl-tegra114.c > b/drivers/pinctrl/tegra/pinctrl-tegra114.c > index 511a8774fd8d..d43c209e9c30 100644 > --- a/drivers/pinctrl/tegra/pinctrl-tegra114.c > +++ b/drivers/pinctrl/tegra/pinctrl-tegra114.c > @@ -1868,4 +1868,9 @@ static struct platform_driver tegra114_pinctrl_driver = { > }, > .probe = tegra114_pinctrl_probe, > }; > -builtin_platform_driver(tegra114_pinctrl_driver); > + > +static int __init tegra114_pinctrl_init(void) > +{ > + return platform_driver_register(&tegra114_pinctrl_driver); > +} > +arch_initcall(tegra114_pinctrl_init); > diff --git a/drivers/pinctrl/tegra/pinctrl-tegra124.c > b/drivers/pinctrl/tegra/pinctrl-tegra124.c > index 57e3cdcf4503..5b07a5834d15 100644 > --- a/drivers/pinctrl/tegra/pinctrl-tegra124.c > +++ b/drivers/pinctrl/tegra/pinctrl-tegra124.c > @@ -2080,4 +2080,9 @@ static struct platform_driver tegra124_pinctrl_driver = { > }, > .probe = tegra124_pinctrl_probe, > }; > -builtin_platform_driver(tegra124_pinctrl_driver); > + > +static int __init tegra124_pinctrl_init(void) > +{ > + return platform_driver_register(&tegra124_pinctrl_driver); > +} > +arch_initcall(tegra124_pinctrl_init); > diff --git a/drivers/pinctrl/tegra/pinctrl-tegra20.c > b/drivers/pinctrl/tegra/pinctrl-tegra20.c > index 624889ed3a9d..1fc82a9576e0 100644 > --- a/drivers/pinctrl/tegra/pinctrl-tegra20.c > +++ b/drivers/pinctrl/tegra/pinctrl-tegra20.c > @@ -2277,4 +2277,9 @@ static struct platform_driver tegra20_pinctrl_driver = { > }, > .probe = tegra20_pinctrl_probe, > }; > -builtin_platform_driver(tegra20_pinctrl_driver); > + > +static int __init tegra20_pinctrl_init(void) > +{ > + return platform_driver_register(&tegra20_pinctrl_driver); > +} > +arch_initcall(tegra20_pinctrl_init); > diff --git a/drivers/pinctrl/tegra/pinctrl-tegra210.c > b/drivers/pinctrl/tegra/pinctrl-tegra210.c > index 0956a1c73391..3e77f5474dd8 100644 > --- a/drivers/pinctrl/tegra/pinctrl-tegra210.c > +++ b/drivers/pinctrl/tegra/pinctrl-tegra210.c > @@ -1582,4 +1582,9 @@ static struct platform_driver tegra210_pinctrl_driver = { > }, > .probe = tegra210_pinctrl_probe, > }; > -builtin_platform_driver(tegra210_pinctrl_driver); > + > +static int __init tegra210_pinctrl_init(void) > +{ > + return platform_driver_register(&tegra210_pinctrl_driver); > +} > +arch_initcall(tegra210_pinctrl_init); > diff --git a/drivers/pinctrl/tegra/pinctrl-tegra30.c > b/drivers/pinctrl/tegra/pinctrl-tegra30.c > index c923ad58af84..10e617003e9c 100644 > --- a/drivers/pinctrl/tegra/pinctrl-tegra30.c > +++ b/drivers/pinctrl/tegra/pinctrl-tegra30.c > @@ -2503,4 +2503,9 @@ static struct platform_driver tegra30_pinctrl_driver = { > }, > .probe = tegra30_pinctrl_probe, > }; > -builtin_platform_driver(tegra30_pinctrl_driver); > + > +static int __init tegra30_pinctrl_init(void) > +{ > + return platform_driver_register(&tegra30_pinctrl_driver); > +} > +arch_initcall(tegra30_pinctrl_init);