Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3521927imm; Mon, 6 Aug 2018 06:20:03 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc067vts8LdNaBoKpnYzTjYMzof8EMV5ZS/KntrzVx5GZaHbYw0i0TmVgDkj/Qpe8k/4/cK X-Received: by 2002:a63:4283:: with SMTP id p125-v6mr14841220pga.142.1533561603009; Mon, 06 Aug 2018 06:20:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533561602; cv=none; d=google.com; s=arc-20160816; b=dP7KCdonurIJNxZZZ2gT8Z7qT33LDRi6bIaAcpGW3Jyg1W+6uT8S1KWK+L23DKVFm1 8qyh09oc4ijJKbczR26mj7NNcqxQu0zspXH2BNBtrC3FF7SQoB6/um1Vw3logrh8sgYm rRy2wZ4CbNYXZQbHsQsHvrIY3kjgVeM143DgcuecMuQqOwW0HdSLlNkXnnEBSJKYsR6+ W3FB2HiB27ksmH2zqV/tSNyaxQYIFhZlnaZUROKNf1BILU6ZAG13h2LE8MhlS6+qZRqt tnk8YoUmVDXjsBwMxIkYsqqh6p/MbmvlrVrVw7+w65oJQexNLZfNrLCSuB2WuL+W4net pFjw== 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=BaVLRCSdY5vRmupC116BnQPio1JUDtggAKLb27LmI14=; b=FsZOxV5+H4kXkHR4I0jJpKrOtNF2/Y5yYnxt3lRfvBjhDoTNMJ4aEQb+3A0MUTyV+/ 3bc/VbFyNBIO7FBVd0d3IqqS6/5yjK/xV22qAV3Xus96dcnn+edovF29rIqHUEcv91VY CI8DHoyhG1l5xByqewHoSf0e1dsnZZP5bp9GMtob9HU5p3Xq4KIgmLFmHaF4Zf1ZdQRS DusnBE6oV1CUHjeygMXlPPmVkCtDgczR19bv7jozqHNhTRnRzWOpZMmvxuh8kY9B4q4f Jg9lRCZ1fiEgEXd7LQMXeulLEEx6r2/Vx18wgMpU6HxG62Rleboami0u/BP2EeWNBNQo tdcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=b99iZZz3; 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 g1-v6si9859484plo.176.2018.08.06.06.19.48; Mon, 06 Aug 2018 06:20: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; dkim=pass header.i=@agner.ch header.s=dkim header.b=b99iZZz3; 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 S1732322AbeHFPME (ORCPT + 99 others); Mon, 6 Aug 2018 11:12:04 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:54788 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727340AbeHFPME (ORCPT ); Mon, 6 Aug 2018 11:12:04 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 31BFB5C05A2; Mon, 6 Aug 2018 15:03:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1533560581; 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=BaVLRCSdY5vRmupC116BnQPio1JUDtggAKLb27LmI14=; b=b99iZZz3m8cly754gIzfFHRUqHpj4mlS9cClGwxiWY/07qqyFfjZ6I24OIhUuLZScnO/Y9 qk05tYcUww7xjKW/Qxm+ZaalUrywKdVfgP3GnsLcDl8G1/e5JzAeKL3wD0ReTKjwvu9feE RfvTav7wMDICy27QZDWXN0pSb8eidfw= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Mon, 06 Aug 2018 15:03:01 +0200 From: Stefan Agner To: Dmitry Osipenko Cc: Linus Walleij , thierry.reding@gmail.com, Jon Hunter , Marcel Ziswiler , linux-tegra@vger.kernel.org, "open list:GPIO SUBSYSTEM" , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/2] pinctrl: tegra: Move drivers registration to arch_init level In-Reply-To: <2738202.Xfnp0pFbCN@dimapc> References: <20180802111144.12512-1-digetx@gmail.com> <20a52a0461e32e776e526171c250551a@agner.ch> <2738202.Xfnp0pFbCN@dimapc> Message-ID: 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 04.08.2018 16:01, Dmitry Osipenko wrote: > On Friday, 3 August 2018 20:24:56 MSK Linus Walleij wrote: >> On Thu, Aug 2, 2018 at 1:31 PM Stefan Agner wrote: >> > 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_az >> > Oic7AA@mail.gmail.com/T/#mf0596982324a6489b5537b0531ac5aed60a316ba >> You shouldn't listen too much to that guy he's not trustworthy. ;-) >> >> > 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. >> >> When we have the pin control and GPIO at different initlevels it makes me >> uneasy because I feel we have implicit init dependencies that seem more >> than a little fragile. > > Yes, it is not very good. > Btw, just noticed this now: GPIO driver -> arch_initcall pinctrl driver -> subsys_initcall And arch is before subsys. So we initialize GPIO driver first? But isn't pinctrl required for the GPIO range? Afaik, especially with gpio-ranges enabled, the GPIO probe will return -EPROBE_DEFER (I think due to pinctrl_get_device_gpio_range). So my intuition would be that it should be the other way around... -- Stefan >> My recent thinking has involved the component method used in DRM drivers >> such as drivers/gpu/drm/vc4/vc4_drv.c where a few different component >> subdrivers are linked together at bind time (not probe time!) into a master >> component. >> Rob was no big fan of this but the DRM people like it and I was thinking to >> make a try at it. >> >> This way we could at least probe and bind the pin control and GPIO drivers >> at the *same* initlevel and express the dependencies between them >> somewhat. > > Sounds interesting, maybe you could help to convert Tegra drivers to a such > method and others will follow afterwards. > >> > This should definitely go in, at least as a stop gap solution. >> >> Agreed. (And patch applied.) > > The best solution will be to fix the deferred probing, it's awkward that it > could break suspend-resume order. Hopefully somebody with a good knowledge of > driver/base will manage to fix it eventually.