Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1495412pxk; Fri, 2 Oct 2020 10:54:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/31Lx0WnURw7fwerzLj6Ir2gIM6kLJI0FbqWcdct4xXnLQih97tx++522D5QdtGhpaJ4Z X-Received: by 2002:a17:906:4e86:: with SMTP id v6mr3399732eju.37.1601661271416; Fri, 02 Oct 2020 10:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601661271; cv=none; d=google.com; s=arc-20160816; b=LegiJn+oet4gbRXwlaTJvNmF5AD6nIK+lUltIfu9N9X9lLPzU4oA5M7HTZze//0mUF jMu+DgIlUSvBpGKIET7FlMzIVtIevP3PIR8QxvvoZGCEtFT7ONJCdXerM/lrv6+p6VKN DmR/s9p0VQIJ1EKfRHOo8Ka6TCPpJfAVFdP6xQjARzSXmDbPyAQExKRTU8NFEPmW4QMs W2YG9lMPzENuC675+UlRpU8zVm9bZ3WyYfkMeAPf127iisjUGgu3SPW9RxGyP9t4qBgn 3O0yZd/RZV3SiLA541lr0RgJDt9TfY6sCoouSl4KjruQBeO2qTcL4kJUJzG5GGLAisf8 Oyqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=lW22Qzd9PGiP/2qzJ0inuLN63Dw7cetpUVChJaty2gE=; b=EmQtYbxgBl84lkfht2p3Wh4g9P1xkL0dYHqBWhmEy4KlKaIZzGEC8XGcFdS3/N8HS0 hkYtZXdHxPH9lAQsh8WpGeFT0xR7uswi8nmj0Y60k8+59XAVfNzZGVkGH++mEWVs6Gv5 gIXPP8JIGdZc3DCJJItHTpQrNX4x0ZKAuLMzOXr2NchWbXQ5RrmhP6MPGmnvaAXoBXdo RB7Ut4FImywL5+21911DTxoJqe4Vcl4tqmNN1zuEeRMpAdhNX1GuIkIBNAQ56QEnOW5S afSk/tIjMUbHQ2SWoU302iBt5uz3VlY6x6L4+AiZWhg6bZanu/sOgpcMmuwc232EGrpU Gjwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Hrn+Czu+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si1417320ejt.519.2020.10.02.10.54.08; Fri, 02 Oct 2020 10:54:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Hrn+Czu+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388342AbgJBRwb (ORCPT + 99 others); Fri, 2 Oct 2020 13:52:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388337AbgJBRw2 (ORCPT ); Fri, 2 Oct 2020 13:52:28 -0400 Received: from mail-yb1-xb41.google.com (mail-yb1-xb41.google.com [IPv6:2607:f8b0:4864:20::b41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3504DC0613E4 for ; Fri, 2 Oct 2020 10:52:28 -0700 (PDT) Received: by mail-yb1-xb41.google.com with SMTP id v60so1739781ybi.10 for ; Fri, 02 Oct 2020 10:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lW22Qzd9PGiP/2qzJ0inuLN63Dw7cetpUVChJaty2gE=; b=Hrn+Czu+Upto30ahHpqz77XC0AVbryq8MDWS/Cg35v6e3+jm93XxMW799+oo0wmJCX mMXHudebFmP8Ys+9w/RQcPL2f7Mnerj3jbyFp39ZwzbpbQE1w9F3wldwtqRqjU7NFCl5 DXY7Fpi9XYkfpBnirOpPnGDsydsDjA/wUrp9tqJoR4VEgWXIW8BnE1IFn0tUNE0dYY3u KBLk/lWz4ZJ9bIQPBTjtRV0ygVvrkbXa9VWbhIV0G+8a0IkdILlriUf7qDpDEIHsrO5g 7lOOgb1hg4imG+RF8Ji9cqGBdhkknr3GVqfkmxdR+nREoCNPAFqg5UdDt8J+8Svgc4V2 kRJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lW22Qzd9PGiP/2qzJ0inuLN63Dw7cetpUVChJaty2gE=; b=ZA7Mn7i0SPw1GEYSR2lfqdvWbgZf7XiIxR0Y6dr3O83kwjKjq3YIn14md/XJqfD67H 8VX5n1Rlwtb9z86HhL8XjXE7Ij0XpfvSOMmkxuo1lL9afJvWvpg2KS06Fea0hhujg5hp koKUOAgxQGS+0/Y/jjRqTxdMEvLayjMYAiEIrWUATSRTuG39sq/pKzJUujuVrIiXGBuZ dnWv0lg+w3YH9UaGhUSWGB7pD+dk9a6Ije2gpGF3XSduRHtCuWGQ/bz2IKk2+ZJS8wRe Enjvzu+cTbeeNWJFl23wsWSc4CytB3ibBviVEDZ58hAAjGiGuC3kytlj5lSeHMkevhWF 57QQ== X-Gm-Message-State: AOAM532uJLMgJzutVKAXCiPWrxT9xhl1bYXeG28VOxAPo1QHIQvqTMaZ Xx6fBZiB5ELuWRnIia5clsPFtrTdrxccTsACQmv6kQ== X-Received: by 2002:a25:8041:: with SMTP id a1mr4363493ybn.412.1601661147077; Fri, 02 Oct 2020 10:52:27 -0700 (PDT) MIME-Version: 1.0 References: <20201001225952.3676755-1-saravanak@google.com> In-Reply-To: From: Saravana Kannan Date: Fri, 2 Oct 2020 10:51:51 -0700 Message-ID: Subject: Re: [PATCH v1] of: platform: Batch fwnode parsing in the init_machine() path To: Rob Herring Cc: Frank Rowand , Geert Uytterhoeven , Greg Kroah-Hartman , Grygorii Strashko , Laurent Pinchart , linux-omap , "open list:THERMAL" , Peter Ujfalusi , "Rafael J. Wysocki" , Tomi Valkeinen , Tony Lindgren , Ulf Hansson , Android Kernel Team , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 2, 2020 at 7:08 AM Rob Herring wrote: > > On Thu, Oct 1, 2020 at 5:59 PM Saravana Kannan wrote: > > > > When commit 93d2e4322aa7 ("of: platform: Batch fwnode parsing when > > adding all top level devices") optimized the fwnode parsing when all top > > level devices are added, it missed out optimizing this for platform > > where the top level devices are added through the init_machine() path. > > > > This commit does the optimization for all paths by simply moving the > > fw_devlink_pause/resume() inside of_platform_default_populate(). > > > > Reported-by: Tomi Valkeinen > > Signed-off-by: Saravana Kannan > > --- > > drivers/of/platform.c | 19 +++++++++++++++---- > > 1 file changed, 15 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/of/platform.c b/drivers/of/platform.c > > index 071f04da32c8..79972e49b539 100644 > > --- a/drivers/of/platform.c > > +++ b/drivers/of/platform.c > > @@ -501,8 +501,21 @@ int of_platform_default_populate(struct device_node *root, > > const struct of_dev_auxdata *lookup, > > struct device *parent) > > { > > - return of_platform_populate(root, of_default_bus_match_table, lookup, > > - parent); > > + int ret; > > + > > + /* > > + * fw_devlink_pause/resume() are only safe to be called around top > > + * level device addition due to locking constraints. > > + */ > > + if (!root) > > + fw_devlink_pause(); > > + > > + ret = of_platform_populate(root, of_default_bus_match_table, lookup, > > + parent); > > of_platform_default_populate() vs. of_platform_populate() is just a > different match table. I don't think the behavior should otherwise be > different. > > There's also of_platform_probe() which has slightly different matching > behavior. It should not behave differently either with respect to > devlinks. So I'm trying to do this only when the top level devices are added for the first time. of_platform_default_populate() seems to be the most common path. For other cases, I think we just need to call fw_devlink_pause/resume() wherever the top level devices are added for the first time. As I said in the other email, we can't add fw_devlink_pause/resume() by default to of_platform_populate(). Do you have other ideas for achieving "call fw_devlink_pause/resume() only when top level devices are added for the first time"? -Saravana