Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934068AbbELW4A (ORCPT ); Tue, 12 May 2015 18:56:00 -0400 Received: from mail-yh0-f45.google.com ([209.85.213.45]:36227 "EHLO mail-yh0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754040AbbELWz5 (ORCPT ); Tue, 12 May 2015 18:55:57 -0400 MIME-Version: 1.0 In-Reply-To: <1431452282-10207-1-git-send-email-sudeep.holla@arm.com> References: <1431452282-10207-1-git-send-email-sudeep.holla@arm.com> From: Rob Herring Date: Tue, 12 May 2015 17:55:36 -0500 Message-ID: Subject: Re: [PATCH] of: base: upgrade initcall level of of_init from core to pure To: Sudeep Holla Cc: "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , Grant Likely , Rob Herring , Benjamin Herrenschmidt , Greg Kroah-Hartman 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: 2056 Lines: 54 On Tue, May 12, 2015 at 12:38 PM, Sudeep Holla wrote: > Commit 5590f3196b29 ("drivers/core/of: Add symlink to device-tree from > devices with an OF node") adds the symlink `of_node` for each device > pointing to it's device tree node while creating/initialising it. > > However the devicetree sysfs is created and setup in of_init which is > executed at core_initcall level. For all the devices created at the core > initcall before of_init, the following error is thrown: > "Error -2(-ENOENT) creating of_node link" What devices have you seen the problem with? I'd rather see if those devices could now be moved later. > Since the core_initcall is the earliest point where devices get > registered, push initcall level of of_init from core to pure so that > the devicetree sysfs is ready before any devices are registered. Read the definition of pure: * A "pure" initcall has no dependencies on anything else, and purely * initializes variables that couldn't be statically initialized. Rob > Cc: Grant Likely > Cc: Rob Herring > Cc: Benjamin Herrenschmidt > Cc: Greg Kroah-Hartman > Signed-off-by: Sudeep Holla > --- > drivers/of/base.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/of/base.c b/drivers/of/base.c > index 99764db0875a..8c3d6b04c585 100644 > --- a/drivers/of/base.c > +++ b/drivers/of/base.c > @@ -210,7 +210,7 @@ static int __init of_init(void) > > return 0; > } > -core_initcall(of_init); > +pure_initcall(of_init); > > static struct property *__of_find_property(const struct device_node *np, > const char *name, int *lenp) > -- > 1.9.1 > -- 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/