Received: by 10.192.165.148 with SMTP id m20csp4968819imm; Tue, 24 Apr 2018 11:21:49 -0700 (PDT) X-Google-Smtp-Source: AIpwx48PSvbpzf+iSmANVJwZolnIGqrWJJ4jAhVFL8VZpwUe/DbwScoq1FzY/n59QLSlzUkANpQC X-Received: by 2002:a17:902:1e2:: with SMTP id b89-v6mr26367355plb.389.1524594109304; Tue, 24 Apr 2018 11:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524594109; cv=none; d=google.com; s=arc-20160816; b=afUUMgW3QMOY2fz7OTKjlsAZ96WAAwpEEcjivpoDDPfQrUCm53+WknXoGEdZdm9QOC enAptmJy48RMKBkIXpevvPzWAn+NXEm+L+vpdx6+/e4VrJ5hlCWaNHh8/hd05GCcf3eQ PQmNqh7ctsjrgyF3yttR9xkNh89nFRm2YzC02O68hJBCRl4lS2uqage6KfTWm43b7DAn oyqsXzfY9pasGZdnkDfYo2iGFEZliMMVbrOs/AWgU6BaYCuhH3mzwxh+VainuvFtZ73s DxVoc9NWnViOPhfZQAgeIKYnCay/pk6sbkszHm9zbQPQ2YBZvbZPA6QAGuFUsO7ynmyt 6/tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=HnsmpAg983H0wvOfHIMYLaXBtBT5z7zeInJTX6eA0KA=; b=Sn5jexxJ0mDRJEYeHg/gWRBxVON/cGrxvZb023BO1xTt6FmIhLXcWVDFSXj92b42aG qsoF2rQIeEVnCwC4yCD3aDOOG8wmdpSRsFPgDLtMwvTA2drmfRSTBdtoNe58HTM54Q0d 5ZxNkxzKLsWcLhtDseE0t7sPxTuHkrOlJebmOFWMJ7jG8Be+FDnTQ4jxXPD2D1P2nImk lN6mQ8lxCdFUmNp9FiBVDbjW6jKInzOTOkUI90/aGJ2bKVEHuaeNSgM81PFJNdVqKWbE lPrs7whC8sSKUX+nnX8IbXP6fc0yNCcJjWTcadwhmTzPJUIXEAxrNGx5dZmZZqhejw/d aAyA== 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 w15-v6si14756265plq.183.2018.04.24.11.21.34; Tue, 24 Apr 2018 11:21:49 -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 S1753056AbeDXSSz (ORCPT + 99 others); Tue, 24 Apr 2018 14:18:55 -0400 Received: from 216-12-86-13.cv.mvl.ntelos.net ([216.12.86.13]:46326 "EHLO brightrain.aerifal.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752823AbeDXSSw (ORCPT ); Tue, 24 Apr 2018 14:18:52 -0400 Received: from dalias by brightrain.aerifal.cx with local (Exim 3.15 #2) id 1fB2E5-0007B6-00; Tue, 24 Apr 2018 17:59:37 +0000 Date: Tue, 24 Apr 2018 13:59:37 -0400 From: Rich Felker To: Mark Rutland Cc: Bartosz Golaszewski , Sekhar Nori , Kevin Hilman , David Lechner , Michael Turquette , Stephen Boyd , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Yoshinori Sato , Frank Rowand , "Rafael J . Wysocki" , Jarkko Sakkinen , Dmitry Torokhov , Arend van Spriel , Heikki Krogerus , Michal Suchanek , Jan Kiszka , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH 00/11] platform: device tree support for early platform drivers Message-ID: <20180424175937.GD3094@brightrain.aerifal.cx> References: <20180424173051.15099-1-brgl@bgdev.pl> <20180424175544.uq7f5x63a5il36sh@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180424175544.uq7f5x63a5il36sh@lakrids.cambridge.arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 24, 2018 at 06:55:45PM +0100, Mark Rutland wrote: > Hi bartosz, > > On Tue, Apr 24, 2018 at 07:30:40PM +0200, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > Device tree based systems often use OF_DECLARE() macros for devices > > that need to be initialized early in the boot process such as clocks, > > timers etc. However platform devices are more desirable. > > > > This series aims at introducing support for early platform drivers for > > OF-based systems. > > > > The idea is to have a special compatible fallback string: "earlydev" > > that similarily to "syscon" would be added to device nodes that need > > early probing. We then need to call of_early_platform_populate() early > > in the boot process to actually probe the registered devices. > > > > I am aware that this new compatible does not strictly correspond with > > the "hardware description only" rule of DT, but we already have many > > functionalities that break this rule: syscon, gpio hogs etc. > > I don't think we need the "earlydev" string at all, and can still keep > the rest of this infrastrcuture if it is helpful. > > So while I'm certainly oppposed to the "earlydev" string, I think that > the infrastrcuture could be useful. Yes. I think this agrees with my objection -- I'm not opposed to the infrastructure in the kernel, but to semantically-wrong and backwards-incompatible changes to the device tree contract. > > The first user of this new functionality will be the DaVinci platform > > for which we want to probe the pll, psc and timer drivers early in the > > boot sequence but keep them implemented as platform drivers. > > Can we have early_paltform_driver() take a reference to the driver's > of_match_table, and put that in a special section? > > Then instead of looking for "earlydev", we look for any compatible > string in that section. No magic string required in the DT, and we can > always mess around with probe ordering in future. Yes, this is pretty much exactly the change I had in mind. Rich