Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933035AbbHINDl (ORCPT ); Sun, 9 Aug 2015 09:03:41 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:36875 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932986AbbHINDf (ORCPT ); Sun, 9 Aug 2015 09:03:35 -0400 MIME-Version: 1.0 In-Reply-To: <55C4E597.1010701@ti.com> References: <1438870315-18689-1-git-send-email-tomeu.vizoso@collabora.com> <1438870315-18689-2-git-send-email-tomeu.vizoso@collabora.com> <55C4E597.1010701@ti.com> From: Tomeu Vizoso Date: Sun, 9 Aug 2015 15:03:14 +0200 X-Google-Sender-Auth: HUX68pn8bvyYQi1FyX4vIyFixl8 Message-ID: Subject: Re: [PATCH v3 01/18] platform: delay OF device-driver matches until late_initcall To: Grygorii Strashko Cc: Rob Herring , "devicetree@vger.kernel.org" , Arnd Bergmann , Stephen Warren , Javier Martinez Canillas , Linus Walleij , Dmitry Torokhov , "Rafael J. Wysocki" , "linux-kernel@vger.kernel.org" , "linux-acpi@vger.kernel.org" , Rob Herring , Thierry Reding , Mark Brown , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2817 Lines: 67 On 7 August 2015 at 19:06, Grygorii Strashko wrote: > On 08/07/2015 10:11 AM, Tomeu Vizoso wrote: >> On 6 August 2015 at 22:19, Rob Herring wrote: >>> On Thu, Aug 6, 2015 at 9:11 AM, Tomeu Vizoso wrote: >>>> Delay matches of platform devices with OF nodes until late_initcall, >>>> when we are sure that all built-in drivers have been registered already. >>>> This is needed to prevent deferred probes because of some drivers not >>>> having registered yet. >>>> >>>> The reason why only platform devices are delayed is that some other >>>> devices are expected to be probed earlier than late_initcall, for >>>> example, the system PNP driver needs to probe its devices in >>>> fs_initcall. >>>> >>>> Additionally, only platform devices with OF nodes are delayed because >>>> some machines may depend on oter platform devices being registered at >>>> specific times. >>> >>> How do we know that these probes occur before the unused clocks and >>> regulators are turned off? Just getting lucky (as is deferred probe)? >>> Can we do this one level earlier so we have a level left to do things >>> after probe. >> >> Those are already late_initcall_sync so I guess we're fine. > > I wouldn't be so sure :( > FYI: > http://git.ti.com/ti-linux-kernel/ti-linux-kernel/commit/763d643bbfc0f445c6685c541fcae3c370e4314a If I understand the situation correctly, this is one more instance of starting to do some work at some point and hoping that something else that started before has already finished happening. If that's the case, how does this series make that worst? During this development I have found many hacks intended to put some order, even if not enough care was taken to make sure that the order was guaranteed. In general I would recommend for moving code into proper drivers and have them to defer the probe of their devices if some dependency isn't fulfilled at that moment. Once that's done and we have a safe and reliable boot, we can avoid those deferred probes by fulfilling the dependency on-demand as this series shows. There was some recent thread about how the disabling of unused clocks and regulators isn't really safe because after late_initcall_sync more drivers can be registered from modules. Furthermore, there's async device probes. Regards, Tomeu > > -- > regards, > -grygorii > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/