Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5935613ybi; Wed, 12 Jun 2019 11:00:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxf/oFZft8G6PdZTwTYsRAGYVeqqNQeRQoQFf3NRRoFPF4BKaIfxK4LNUBbVoO8IDlbk9KQ X-Received: by 2002:a17:902:aa83:: with SMTP id d3mr59810112plr.74.1560362420499; Wed, 12 Jun 2019 11:00:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560362420; cv=none; d=google.com; s=arc-20160816; b=tf2nivqGcYXMZCLlcNNHVhOYX7Yevgcu45XfGvis0mYAUCUuTp0ZjOCOYvauJyF9ch 5OhOAHMg/xK9LSozi3fRRDv0ek4AE50IPCEFhXhK/vDtto8zPjC+NsIrCKbKs7UPrnaX uDVCMAmatOAbTY0JVN4ralTVEl7BH6aep4gTUzSdBlyKGSzhDm8x+7bGeSXwk89vbnlP lU2gyuMOksWkASmzAPyjdMZkJgPykAOdyMUEhflJ8sdL9YBfBwJZHvRhYGZjoAJScruE gk7HopzGGy3dnCtgYc8hu3tm/cvDIcSRcMb1mCu/gFwiWV8jh8xruDvRDpv/fKRBsgKE bvYg== 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:dkim-signature; bh=X7IAGe15hnR1bCVoChbJ8jO7g/iz+ZHGCdiYlSO9YpI=; b=IcZDL4teJPQRF8YgKkpxXYmzsZzoFGgZnRyM+GH2FzAc04oOikdaQc+9TY2gslft5W 006G2jdYwpOFEoPvqPiVJxiyq88Swy4JIWd8x20/EUMSHQUk4EsR+zyMkqSsS2jjGVfD IBAPLYURNKiDW28TM7yYlGAawKuyFNoB93y5sGixSsiZnf4qBJACgcknyYWilFdkEioQ LDsxAeMyKALmGqRCbx7R+4OSc8v2gc21ISPqZbOMOntBTSK/0LPgus0t5uYzDv1Lth8E 4gkbhA/xnw7ZYTZdJ5OHsVX1ldq4FA14SxDD6CUWL6V0aNKB82v6J+/XxEQvR1rIOgDE mRnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="GeHtJa/2"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11si381398pgq.498.2019.06.12.11.00.05; Wed, 12 Jun 2019 11:00:20 -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=@kernel.org header.s=default header.b="GeHtJa/2"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408611AbfFLNxy (ORCPT + 99 others); Wed, 12 Jun 2019 09:53:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:59482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbfFLNxy (ORCPT ); Wed, 12 Jun 2019 09:53:54 -0400 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 88BA621743; Wed, 12 Jun 2019 13:53:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560347632; bh=gn8TCJNyRiv5D9lTgIxBZijS12em+KTdGU4PLC2tDjg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=GeHtJa/23P4wHnGjHGUXjskCMlVC9CpwXVWEiaYdpJokLuEL+ykWODo7hQSdxBjwz Cn1rmH3vK1NEQ22sNGorWRZHqw9fDWabE7Fs8nZ1ZyH+zkZ3jKrTRPlM9n1OxFdwBT 2gotYALDzsIxUWoVb8LrwCjqITOWl+R3nEPG0rwE= Received: by mail-qk1-f179.google.com with SMTP id t8so6565735qkt.1; Wed, 12 Jun 2019 06:53:52 -0700 (PDT) X-Gm-Message-State: APjAAAUMhzj+f56uMwoUHmS/1AO7GsmNtF6mgfHs1bfmNjikRDoLLPHp vzwfJLQy/l2/3rFcQWM0qJMuY/gVvrjXfmSa2w== X-Received: by 2002:a05:620a:13d1:: with SMTP id g17mr11258289qkl.121.1560347631657; Wed, 12 Jun 2019 06:53:51 -0700 (PDT) MIME-Version: 1.0 References: <20190604003218.241354-1-saravanak@google.com> <20190604003218.241354-2-saravanak@google.com> <570474f4-8749-50fd-5f72-36648ed44653@gmail.com> <20190611215242.GE212690@google.com> In-Reply-To: <20190611215242.GE212690@google.com> From: Rob Herring Date: Wed, 12 Jun 2019 07:53:39 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RESEND PATCH v1 1/5] of/platform: Speed up of_find_device_by_node() To: Sandeep Patil , Saravana Kannan Cc: Frank Rowand , Mark Rutland , Greg Kroah-Hartman , "Rafael J. Wysocki" , David Collins , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Android Kernel Team 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 On Tue, Jun 11, 2019 at 3:52 PM Sandeep Patil wrote: > > On Tue, Jun 11, 2019 at 01:56:25PM -0700, 'Saravana Kannan' via kernel-team wrote: > > On Tue, Jun 11, 2019 at 8:18 AM Frank Rowand wrote: > > > > > > Hi Saravana, > > > > > > On 6/10/19 10:36 AM, Rob Herring wrote: > > > > Why are you resending this rather than replying to Frank's last > > > > comments on the original? > > > > > > Adding on a different aspect... The independent replies from three different > > > maintainers (Rob, Mark, myself) pointed out architectural issues with the > > > patch series. There were also some implementation issues brought out. > > > (Although I refrained from bringing up most of my implementation issues > > > as they are not relevant until architecture issues are resolved.) > > > > Right, I'm not too worried about the implementation issues before we > > settle on the architectural issues. Those are easy to fix. > > > > Honestly, the main points that the maintainers raised are: > > 1) This is a configuration property and not describing the device. > > Just use the implicit dependencies coming from existing bindings. > > > > I gave a bunch of reasons for why I think it isn't an OS configuration > > property. But even if that's not something the maintainers can agree > > to, I gave a concrete example (cyclic dependencies between clock > > provider hardware) where the implicit dependencies would prevent one > > of the devices from probing till the end of time. So even if the > > maintainers don't agree we should always look at "depends-on" to > > decide the dependencies, we still need some means to override the > > implicit dependencies where they don't match the real dependency. Can > > we use depends-on as an override when the implicit dependencies aren't > > correct? > > > > 2) This doesn't need to be solved because this is just optimizing > > probing or saving power ("we should get rid of this auto disabling"): > > > > I explained why this patch series is not just about optimizing probe > > ordering or saving power. And why we can't ignore auto disabling > > (because it's more than just auto disabling). The kernel is currently > > broken when trying to use modules in ARM SoCs (probably in other > > systems/archs too, but I can't speak for those). > > > > 3) Concerns about backwards compatibility > > > > I pointed out why the current scheme (depends-on being the only source > > of dependency) doesn't break compatibility. And if we go with > > "depends-on" as an override what we could do to keep backwards > > compatibility. Happy to hear more thoughts or discuss options. > > > > 4) How the "sync_state" would work for a device that supplies multiple > > functionalities but a limited driver. > > > To be clear, all of above are _real_ problems that stops us from efficiently > load device drivers as modules for Android. > > So, if 'depends-on' doesn't seem like the right approach and "going back to > the drawing board" is the ask, could you please point us in the right > direction? Use the dependencies which are already there in DT. That's clocks, pinctrl, regulators, interrupts, gpio at a minimum. I'm simply not going to accept duplicating all those dependencies in DT. The downside for the kernel is you have to address these one by one and can't have a generic property the driver core code can parse. After that's in place, then maybe we can consider handling any additional dependencies not already captured in DT. Once all that is in place, we can probably sort device and/or driver lists to optimize the probe order (maybe the driver core already does that now?). Get rid of the auto disabling of clocks and regulators in late_initcall. It's simply not a valid marker that boot is done when modules are involved. We probably can't get rid of it as lot's of platforms rely on that, so it will have to be opt out. Make it the platform's responsibility for ensuring a consistent state. Perhaps we need a 'boot done' or 'stop deferring probe' trigger from userspace in order to make progress if dependencies are missing. Or maybe just some timeout would be sufficient. I think this is probably more useful for development than in a shipping product. Even if you could fallback to polling mode instead of interrupts for example, I doubt you would want to in a product. You should also keep in mind that everything needed for a console has to be built in. Maybe Android can say the console isn't needed, but in general we can't. Rob